AhmedSabry
02-13-2008, 03:49 AM
Hello All
I am beginner in OpenGL, and I am coding some 2D staff now, I had initialized OpenGL by
gluOrtho2D(-10.0f,10.0f,-10.0f,10.0f);
Then in my render function I tried the following
glLineWidth(3);
glBegin(GL_LINES);
glColor3f(1.0f,1.0f,0.0f);//Yellow Line
glVertex2f(7.0f,3.0f);
glVertex2f(5.0f,-3.0f);
glColor3f(1.0f,0.0f,0.0f);//Red Line
glVertex2f(5.0f,3.0f);
glVertex2f(7.0f,-3.0f);
glEnd();
And it works fine and I got the 2 lines drawn
But for my surprise I got the yellow line drawn over the red line, which should be in contrast
Is there any one have explanation?
I am beginner in OpenGL, and I am coding some 2D staff now, I had initialized OpenGL by
gluOrtho2D(-10.0f,10.0f,-10.0f,10.0f);
Then in my render function I tried the following
glLineWidth(3);
glBegin(GL_LINES);
glColor3f(1.0f,1.0f,0.0f);//Yellow Line
glVertex2f(7.0f,3.0f);
glVertex2f(5.0f,-3.0f);
glColor3f(1.0f,0.0f,0.0f);//Red Line
glVertex2f(5.0f,3.0f);
glVertex2f(7.0f,-3.0f);
glEnd();
And it works fine and I got the 2 lines drawn
But for my surprise I got the yellow line drawn over the red line, which should be in contrast
Is there any one have explanation?