I'm writing an image processing app, and using OpenGL for the image viewing.
I am trying to use MipMap and Textures to display the 2D data in a window.
I read in the image data, and create a window that is equal to the images
height and width. But, when I create the Rectangle (using glVertex2f), I am
just using the -1,-1,1,1 coords for a standard rectangle. The image is
therefore becoming a square, no matter what the width and height are.
Next step was to create width and height ratios:
GLfloat width_r = width / height;
GLfloat height_r = height / width;
This works ok when height is greater than width, or vice versa. But, when
they are equal or near equal, the rectangle takes up only part of the
Is there any way to just create a rectangle using Object coords that will be
equal to the Window size I have specified?
Thanks for any help,