Skip to main content
GameDev.net gamedev.net
🔒 Locked

Saving textures

Started by Mulligan Dec 2, 2002 at 6:32 PM 0 replies 200+ views
Original Post
Mulligan
Mulligan
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]
zedzeek
zedzeek
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

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.