Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Mulligan

Saving textures

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

How do I save a texture to a file? I don't need to know how t format the data for a particular file type, I just need to know how to get the texture data. How is it done? EDIT: I tried using glGetTexImage( GL_TEXTURE_2D, 0, GL_RGB, GL_UNSIGNED_INT, pPicture ); pPicture is "unsigned int pPicture[256*256*3];" but I can't tell if the operation successfully filled pPicture with the correct data. How could I test it out? [edited by - Mulligan on December 2, 2002 7:35:58 PM]

Share this post


Link to post
Share on other sites
Advertisement
normally u use unsigned byte

GLubyte pPicture[256*256*3];
glGetTexImage( GL_TEXTURE_2D, 0, GL_RGB, GL_UNSIGNED_BYTE pPicture );

this should work, to see if it did save the data inot a tga file (for example) + open it up in a paint program


http://uk.geocities.com/sloppyturds/kea/kea.html
http://uk.geocities.com/sloppyturds/gotterdammerung.html

Share this post


Link to post
Share on other sites

  • 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!