Jump to content
  • Advertisement
Sign in to follow this  
DredKnoT

OpenGL OpenGL texture pointer question

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

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

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!