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?
cragwolf
25-10-2006, 07:42 AM
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):
var
iWidth: Integer;
begin
//.....
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, @iWidth);
Writeln('Width = ', iWidth);
//.....
end;
Excellent! Thanks this is what I needed. ;)
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.