OpenGL texture pointer question

Started by
2 comments, last by DredKnoT 17 years, 4 months ago
I was wondering, when you load textures in OpenGL, and you make the GLuint pointer that points to the texture data, is there any kind of way to extract that data into some concrete form, like moving it into some sort of matrix class or something? I figured it would be kinda useful to be able to do, since you'd be able to load/save the data directly to file, modify the color values within the program without the use of pixel shaders, etc.
Advertisement
The number you get is nothing but a number. It's not a pointer. Even if it was a pointer, it could very well "point to" memory that you don't have access too, or even a part of the memory that isn't mapped into your address space. The video memory isn't necessary part of the memory you can address with a pointer.
Quote:Original post by DredKnoT
I figured it would be kinda useful to be able to do, since you'd be able to load/save the data directly to file, modify the color values within the program without the use of pixel shaders, etc.


As Brother Bob said its not a pointer its just an int, but that asside ... you already have the texture data because you used it to create the texture in the first place - why would you need to read/write it from OpenGL's memory when you already have it to begin with? And you already can update parts of the texture (can't remember the exact call but its something like glSubImage2D() or something) which lets you update colour values and the like by resuplying that part of the texture. Have access to OpenGL's version of the texture wouldn't help you at all, especially seeing you have no garentee that different cards/drivers will store it in the same way.
ah, so. ok thanks guys.

This topic is closed to new replies.

Advertisement