Strange Texturing Quirk
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]](http://simreality.playmacgames.com/background_image.png)
But in game it looks like this:
![[Image: screen2.jpg]](http://simreality.playmacgames.com/screen2.jpg)
Here's all the drawing code for the background. The NSRect being reference is set to the exact size of the window.
Any ideas why this is happening? It doesn't make a lick of sense to me.
The actual image looks like this:
![[Image: background_image.png]](http://simreality.playmacgames.com/background_image.png)
But in game it looks like this:
![[Image: screen2.jpg]](http://simreality.playmacgames.com/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();
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| GL view bounds question/quirk | rezwits | 3 | 2,784 |
Jul 12, 2009 08:45 AM Last Post: rezwits |
|

