View Full Version : How to findout texture Dimensionality
04-07-2005, 11:21 PM
How can I programmaticaLly find out wether the texture is for example a TEXTURE_2D or TEXTURE_3D?
What do you mean? Texture objects in graphics memory or before uploading?
(not that I know the answer to either - but I'd say it depends on the person making the artwork)
04-08-2005, 03:41 AM
I want something like glIsTexture2D or glIsTextureCube
void render (int name)
printf("you are using 2d texture");
printf("you are using 3d texture");
04-08-2005, 04:10 AM
Afaik, there is only one possibility:
Try to bind the texture, and check the error status...
For example: glBindTexture(GL_TEXTURE_2D, texture) will give an INVALID_OPERATION error if "texture" is not actually a 2D texture object.
For level 0
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, params);
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, params);
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.