So, I'm just trying to draw a texture to two triangles that are the same size as the viewport, but it breaks up the image and distorts it. I have tried resizing the image file and everything, but nothing seems to work. Below is the code that maps the texture and draws the triangles.
public void Render()
{
Texture texture = _textureManager.Get("splash");
Gl.glEnable(Gl.GL_TEXTURE_2D);
Gl.glBindTexture(Gl.GL_TEXTURE_2D, texture.Id);
double height = 720;
double width = 1280;
double x = 0;
double y = 0;
double z = 0;
float topUV = 0;
float bottomUV = 1;
float leftUV = 0;
float rightUV = 1;
Gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
Gl.glClear(Gl.GL_COLOR_BUFFER_BIT);
Gl.glBegin(Gl.GL_TRIANGLES);
{
Gl.glTexCoord2d(leftUV, topUV);
Gl.glVertex3d(x - width, y + height, z);
Gl.glTexCoord2d(rightUV, topUV);
Gl.glVertex3d(x + width, y + height, z);
Gl.glTexCoord2d(leftUV, bottomUV);
Gl.glVertex3d(x - width, y - height, z);
Gl.glTexCoord2d(rightUV, topUV);
Gl.glVertex3d(x + width, y + height, z);
Gl.glTexCoord2d(rightUV, bottomUV);
Gl.glVertex3d(x + width, y - height, z);
Gl.glTexCoord2d(leftUV, bottomUV);
Gl.glVertex3d(x - width, y - height, z);
}
Gl.glEnd();
}
Here is the original image:

And here's the result:

The image is 1920 x 1080, and the viewport is 1280 x 720, but I'm not too sure that matters because I have tried resizing the image and nothing seems to work.
edit: this is a cross-post from stack overflow (I asked it here as well because nobody seemed to have an answer): https://stackoverflow.com/questions/26723470/opengl-texture-mapping-distorts-image