Strange Texturing Quirk

Sage
Posts: 1,066
Joined: 2004.07
Post: #1
I'm trying to simply use an NSRect and set a background image for my menu screen. Only problem is that it's skewing the image (which it shouldn't). Pardon the crappy graphics. These are all placeholder textures while I code everything.
The actual image looks like this:
[Image: background_image.png]
But in game it looks like this:
[Image: screen2.jpg]
Here's all the drawing code for the background. The NSRect being reference is set to the exact size of the window.
Code:
//draw our background image
    GLfloat leftX = backgroundRect.origin.x;
    GLfloat rightX = backgroundRect.origin.x + backgroundRect.size.width;
    GLfloat bottomY = backgroundRect.origin.y;
    GLfloat topY = backgroundRect.origin.y + backgroundRect.size.height;
    glBindTexture(GL_TEXTURE_2D, backgroundImage[0]);
    glBegin(GL_QUADS);
    {
        glTexCoord2f(0,0);    glVertex2f(leftX,topY);
        glTexCoord2f(1,0);    glVertex2f(rightX,topY);
        glTexCoord2f(1,1);    glVertex2f(rightX,bottomY);
        glTexCoord2f(0,1);    glVertex2f(leftX,bottomY);
    }
    glEnd();
Any ideas why this is happening? It doesn't make a lick of sense to me.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  GL view bounds question/quirk rezwits 3 3,321 Jul 12, 2009 08:45 AM
Last Post: rezwits