Jump to content
  • Advertisement
Sign in to follow this  
jbremer

glTexSubImage2D

This topic is 4888 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

If I load two pixmaps. Make one of them into a texture. Then wants to update that one with the other pixmap, how would that work? I have tried this approach, which doesn't work. The texture just gets updated with some garbage pixels:
tmp1 = LoadPixmap( "test1.png" )
tmp2 = LoadPixmap( "test2.png" )
tex1 = bglTexFromPixmap( tmp1 )
glBindTexture GL_TEXTURE_2D,tex1
glTexSubImage2D( GL_TEXTURE_2D, 0, xOffset, yOffset, width, height , GL_RGBA, GL_UNSIGNED_BYTE, tmp2.pixels )

Anyone got working examples of doing this?

Share this post


Link to post
Share on other sites
Advertisement
Well, that should work... Given that tmp2 is indeed stored in unsigned bytes RGBA. You should check the type and format (as well as width, height etc.) As to exactly how, well, I can't help you, since I don't know what kind of structure tmp2 is (though I guess the information you need is stored there), or how LoadPixmap and bglTexFromPixmap look.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!