Jump to content
  • Advertisement
Sign in to follow this  
Doggan

Retrieving Texture Info using it's ID

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

This has slipped my mind if it is possible. It seems like it should be. Say I generate a texture ID, bind the ID, assign a texture to the ID. Later, if I want to query the information (height, width, etc) about the texture assigned to this particular ID, how would I do that?

Share this post


Link to post
Share on other sites
Advertisement
Yeah, as MichaelMook said, just store the information in an array to parallel your texture array, or make a structure to store both.

Share this post


Link to post
Share on other sites
Thanks for the replies.

Yea, I knew about glGetTexLevelParameter, but that only gives you info about the currently set texture. I was thinking more along the lines of giving it a specific ID (although it is just as easy to set a texture, then call the previous function, I guess). You're all right, though. It seems a lot more natural to just store the info when I load the texture, in some array in my texture manager class.

Thanks again.

Share this post


Link to post
Share on other sites
Quote:
Original post by Doggan
Thanks for the replies.

Yea, I knew about glGetTexLevelParameter, but that only gives you info about the currently set texture. I was thinking more along the lines of giving it a specific ID (although it is just as easy to set a texture, then call the previous function, I guess). You're all right, though. It seems a lot more natural to just store the info when I load the texture, in some array in my texture manager class.

Thanks again.


Yeah, or you could just store the present index (if you use an array), call glBindTexture with the desired texture, glGetTexLevelParameter (sorry I didn't know that existed), and then re-bind the old texture. It's costly but it should work.

Good Luck!

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!