Jump to content
  • Advertisement
Sign in to follow this  
rpg_code_master

glTexSubImage2D

This topic is 4875 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

I'm passing to this funciton a set of pixels 800*600*3. The texture set is 800*600*3. When the texture is this size, the function returns an error. This function works when the texture is 1600*1200*3. Is there any way to get this function working with the same sized pixel data as the texture? Thank you

Share this post


Link to post
Share on other sites
Advertisement
I'm calling it like this:-

glTexSubImage2D( GL_TEXTURE_2D, nMipMap, nXOff, nYOff, w,h, dwFormat, GL_UNSIGNED_BYTE, pPixels );

The error I get is this:-

GLI | GL ERROR - Function glTexSubImage2D(GL_TEXTURE_2D,0,0,0,800,600,GL_RGB,GL_UNSIGNED_BYTE,0x4900040) generated error GL_INVALID_VALUE

Share this post


Link to post
Share on other sites
Have you first called glTexImage2D() on the texture object that's currently bound when you call glTexSubImage2D()? And is that texture big enough to fit the 800x600 image?

Share this post


Link to post
Share on other sites
if i'm not mistaken, you need a texture with power of two dimentions for the GL_TEXTURE_2D-target. GL_TEXTURE_RECTANGLE_ARB, can however use 800x600-textures.
you could always use a 1024x1024-texture and only use the lower left 800x600 texels or something.

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!