Advertisement Jump to content
Sign in to follow this  


This topic is 4979 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
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, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!