PDA

View Full Version : Strange problem



dukey
09-23-2008, 06:07 AM
Hi,
I am drawing a 2d display in opengl, but I have problems where by on my pc running vista + quadro fx the display looks different to another pc i've tested running xp + nvidia card. There seems to be a precision problem somewhere, causing my lines to draw in the wrong places.

I am setting up opengl like this

Say if the window size is 100,100

glViewport(0,0,100,100);
glOrtho (0.0,100,0.0,100,-1.0,1.0);

modelview matrix is the identity matrix

glBegin(GL_LINES);
glVertex2i(0,0);
glVertex2i(100,0);
glEnd();

On my pc, this works and will draw the line at the bottom of the viewport (as expected?) On other machines the line will be off the bottom of the display and thus invisible.

My pc seems to want to draw in the range
0-99

and other machines
1-100

How can I solve this ? Do I need to tweak the projection matrix?