Jump to content
  • Advertisement
Sign in to follow this  
Elahrairah

Use IplImages for textures!

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

Okay, boys, how is it done? My current code... glGenTextures( 1, &savedTexId); glBindTexture( GL_TEXTURE_2D, savedTexId); glTexImage2D(GL_TEXTURE_2D, 0, 3, savedImage->width, savedImage->height, 0, GL_RGB, GL_UNSIGNED_BYTE, savedImage->imageData); ...produces only white for the texture. Anybody ever worked with IplImages? Anybody know how to convert them to something more useful?

Share this post


Link to post
Share on other sites
Advertisement
Check to see if savedimage->imagedata exists (that is savedimage->imagedata != NULL). I get a lot of dumb errors, so I figure thats your problem too lol. If it doesn't exists as I suspect, make sure the file is in the directory.

If it does exist, check to see if its a power of 2 texture. That means that each dimension can be 16,32,64,128,256,512,1024,2048 etc...(Note that I said powers, 640 and 10240 are not powers of 2).

First time I probably ever helped someone. Wow.

Share this post


Link to post
Share on other sites
Hmmmm... I copied code from someone else and that seemed to work. It may have just been that power of two problem. Thanks for the advice!

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!