800x600

Started by
1 comment, last by LessThanJoe 21 years, 11 months ago
ok, this is what I think is a simple question...and I hope it is. How would I set it up so that when using glvertex3f I can put in 0, 0, -1 and get the top left of the screen, then put in 800, 600, -1 and get the bottom right. This would make getting some code I''ve written to work as it should far easier. Thanks in advance...
Advertisement
This is asked a lot.
glViewport(0, 0, (GLsizei) ScreenWidth, (GLsizei) ScreenHeight);glMatrixMode(GL_PROJECTION);glLoadIdentity();glOrtho(0.0f,ScreenWidth,ScreenHeight,0.0f,Near,Far);glMatrixMode(GL_MODELVIEW);glLoadIdentity(); 

Just plug in -1.0f and 1.0f for near and far, respectively, if you don''t need to use the depth buffer.

thanks

This topic is closed to new replies.

Advertisement