From 09e3690f3af48ed563bcb9e0fb64c756ae9e7f5c Mon Sep 17 00:00:00 2001 From: afreen Date: Sun, 30 Mar 2014 22:42:39 +0530 Subject: [PATCH] Issue : Inverted image The previously assigned coordinates were causing the image to invert. It is fixed by assigning the coordinates in a clockwise manner --- main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.cpp b/main.cpp index 6e29af2..e5d9730 100644 --- a/main.cpp +++ b/main.cpp @@ -43,15 +43,15 @@ void display() glBindTexture(GL_TEXTURE_2D, tex_2d); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - //determint coordinates of the quad on which you will 'load' an image + //determint coordinates of the quad on which you will 'load' an image glBegin(GL_POLYGON); - glTexCoord2f(1.0, 1.0); + glTexCoord2f(0.0, 1.0); glVertex2f(0,0); - glTexCoord2f(1.0, 0.0); - glVertex2f(0,x); glTexCoord2f(0.0, 0.0); + glVertex2f(0,x); + glTexCoord2f(1.0, 0.0); glVertex2f(x,x); - glTexCoord2f(0.0, 1.0); + glTexCoord2f(1.0, 1.0); glVertex2f(x,0); glEnd(); glDisable(GL_TEXTURE_2D);