View Full Version : Pixelwidth retrieving

02-08-2002, 07:15 AM
Hi, I'm programming an Isometric game and I'm supposed to find out the image pixelwidth. I can find out the image width in pixels, but isn't the whole trick of OpenGL texture mapping that the texture is automatically scaled? How do I find out how wide my texture is if I have a quad which is 1.0f wide and map a 64*64 pixels bitmap onto it.
Is there a way to do this?


02-08-2002, 08:07 AM
Do you want to know how large the texture is when drawn on the window?

You transform the coordinates of the quad to viewport coordinartes (use gluProject). The coordinates you get will be the corners of the quad, and from them you can calculate the size of the quad.