V66ras
08-30-2002, 09:39 AM
hi!
I constantly fail to create orthogonal
projection where i could reference all
screen points with integer numbers...
was this clear enough ...
more specific :
a example code that produces a error...
/.../
glViewport(0,0,W,H); glMatrixModeGL_PROJECTION);
glLoadIdentity();
glOrtho(0,W,H,0,-1,1);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
/.../
glClearColor(0.0f,0.5f,0.0f,1.0f);
glClear(GL_COLOR_BUFFER_BIT);
/.../
glColor3ub(0,0,255);
glBegin(GL_LINES);
for(int i=0;i<W;i++) {
glVertex2i(i,0);
glVertex2i(i,H-1); }
glEnd();
/.../
well. Now should the entire screen be blue,
but it is NOT. (green line in middle of screen)
How to get that working ?
Is it even possible in oGL? (ie. is oGL precise enough)
I constantly fail to create orthogonal
projection where i could reference all
screen points with integer numbers...
was this clear enough ...
more specific :
a example code that produces a error...
/.../
glViewport(0,0,W,H); glMatrixModeGL_PROJECTION);
glLoadIdentity();
glOrtho(0,W,H,0,-1,1);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
/.../
glClearColor(0.0f,0.5f,0.0f,1.0f);
glClear(GL_COLOR_BUFFER_BIT);
/.../
glColor3ub(0,0,255);
glBegin(GL_LINES);
for(int i=0;i<W;i++) {
glVertex2i(i,0);
glVertex2i(i,H-1); }
glEnd();
/.../
well. Now should the entire screen be blue,
but it is NOT. (green line in middle of screen)
How to get that working ?
Is it even possible in oGL? (ie. is oGL precise enough)