-
How to findout texture Dimensionality
How can I programmaticaLly find out wether the texture is for example a TEXTURE_2D or TEXTURE_3D?
-
Member
Regular Contributor
Re: How to findout texture Dimensionality
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)
-
Re: How to findout texture Dimensionality
I want something like glIsTexture2D or glIsTextureCube
for example:
void render (int name)
{
if (glIsTexture2D(name))
printf("you are using 2d texture");
if (glIsTexture3D(name))
printf("you are using 3d texture");
...
}
-
Re: How to findout texture Dimensionality
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.
-
Re: How to findout texture Dimensionality
For level 0
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, params);
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, params);
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules