Archived

This topic is now archived and is closed to further replies.

LessThanJoe

800x600

Recommended Posts

LessThanJoe    122
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...

Share this post


Link to post
Share on other sites
Null and Void    1088
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.

Share this post


Link to post
Share on other sites