Dear All,
I've created an OpenGL program to load and draw a texture. Texture is
having 800x600 size. but the window has 1440x900 pixels size.
the projection is of type orthogonal - glOrtho(0, win_w, 0, win_h,
-1.0, 1.0);
the texture is loaded as follows
glTexImage2D( GL_TEXTURE_RECTANGLE_NV, 0, GL_RGB, TextureImage[i]-
>sizeX, TextureImage[i]->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE,
TextureImage[i]->data );
the textures are mapped as follows
glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_WRAP_S,
GL_CLAMP_TO_BORDER);
glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_WRAP_T,
GL_CLAMP_TO_BORDER);
glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_MAG_FILTER,
GL_LINEAR);
glTexParameteri(GL_TEXTURE_RECTANGLE_NV, GL_TEXTURE_MIN_FILTER,
GL_LINEAR);
glBegin(GL_QUADS);
glTexCoord2f(0.0, 0.0); glVertex2f(0.0, 0.0);
glTexCoord2f(1, 0.0); glVertex2f(win_w, 0.0);
glTexCoord2f(1, 1); glVertex2f(win_w, win_h);
glTexCoord2f(0.0, 1); glVertex2f(0.0, win_h);
glEnd();
How can make the texture fit to window?


|