Original Post
As you can see from this image that I am having a problem drawing a 2d image. This is the same GL_QUADS code I use to draw a colored rectangle and that works fine. EDIT: I fixed the shape...now I just need to fix the texture being stretched. Here is my drawing code:
if(image == NULL)
return;
float texX1 = src.x / (float)image->getWidth();
float texY1 = src.y / (float)image->getHeight();
float texX2 = (src.x + src.width) / (float)image->getWidth();
float texY2 = (src.y + src.height) / (float)image->getHeight();
glBindTexture( GL_TEXTURE_2D, image->getTexture() );
glEnable( GL_TEXTURE_2D );
glBegin( GL_QUADS );
glTexCoord2f( texX1, texY1 );
glVertex3f( dest.x , dest.y, 0 );
glTexCoord2f( texX1, texY2 );
glVertex3f( dest.x + src.width, dest.y, 0 );
glTexCoord2f( texX2, texY2 );
glVertex3f( dest.x + src.width, dest.y + src.height, 0 );
glTexCoord2f( texX2, texY1 );
glVertex3f( dest.x, dest.y + src.height, 0 );
glEnd();
glDisable( GL_TEXTURE_2D );