I'm having some problems with the glViewport, because the point xy 0.0 window is wrong.
if I try to draw a line in the coordinates 1.1 and 32.32, the line does not appear in the window, it seems that the drawing area begins at the edge of the window.
I do not know if I was clear.
but I will post the picture of the problem here
im using this code, to create the viewport
Code :glViewport(0,0,640,480); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0.0f,640,480,0.0f,0.0f,1.0f);
and this code to draw the triangle
Code :glBegin(GL_TRIANGLES); glVertex2f(mouse_x,mouse_y); glVertex2f(1.0f,1.0f); glVertex2f(320.0f,470.0f); glEnd();
and this is the result
see? the point glVertex2f(1.0f,1.0f); its much behind the window
I wanted to happen was this.
could understand?






