I'm using OpenGL and I'm trying to figure out how to query the width and height of an already loaded texture. Is this possible after I've already loaded it into memory?
Assuming you've already created the texture, then the following code will return the width of the currently bound texture (height, same method just change one parameter):
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, @iWidth);
Writeln('Width = ', iWidth);
[size=10px]"In science one tries to tell people, in such a way as to be understood by everyone, something that no one ever knew before. But in poetry, it's the exact opposite." -- Paul Dirac[/size]