Is there a simple query to do this? I couldn’t find it after spending close to an hour searching the red book, blue book, and the 1.5 spec.
Basically, I have the texture name (ie. a GLint) and I want to get the target associated with that texture (eg. GL_TEXTURE_2D, GL_TEXTURE_3D, etc.). The reason I’m doing this is because I want to be able to enumerate all the textures and their types in a debug function.
Currently, what I’m trying is taking the texture and binding it all the various targets and checking for glGetError() after, until I find the target to which it binds without errors.