Original Post
🔒 Locked
Pixel data from texture?
Advertisement
If you want the pixel data without passing the texture to the graphics card and wasting space you can take the data pointer (from whatever you use to load the texture) and then iterate through it and delete it before passing it on.
You can also use glGetTexImage
Quote:
Original post by Aph3x
umm not too sure what you meant there, daniel...
When you load a texture you call the following commands:
GLuint texture;Texture = LoadPicture("pic.bmp"); //whatever you load the pic withglGenTextures(1, &texture); glBindTexture(GL_TEXTURE_2D, texture);glTexImage2D(GL_TEXTURE_2D, 0, 3, Texture->sizeX, Texture->sizeY, 0, GL_RGB,GL_UNSIGNED_BYTE, Texture->data);free(Texture->data); Now if you only want the data without actually generating a texture you can skip everything except the first line and use TextureData->data and the free it.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement