Skip to main content
gamedev.net
🔒 Locked

TEXTURE FILL problem

Started by psicor Sep 26, 2002 at 7:30 PM 3 replies 400+ views
Original Post
psicor
psicor
hi i have a question that dont let me sleep how i fill a texture from an array supose i have a full array // The RGB data in a 128x128 image byte imageBits[128][128][3]; and i want to use the data to fill a texture how i do that ??
thelyingspy
thelyingspy
First create a texture of the same size.

Then lock it.

Make sure you know the format of the texture e.g. A8R8G8B8 and get the pitch right. The pitch varies, you get the value when you lock the texture.

Loop through your values, setting the corresponding texture values.

Unlock the texture.
psicor
psicor
Thank you
you have a example of that method ???
Uttar
Uttar
http://www.flipcode.com/tutorials/tut_dx8adv2d.shtml

Look at the end of the tutorial, in the texture section.


Uttar
psicor
psicor
Thank you guys !!!!!!!!!!
that all i need thank i am a happy programer now !!!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.