Fidning the coordinates of the edges of the screen

Started by
3 comments, last by griffenjam 22 years, 5 months ago
I know this sounds dumb, but I can''t figure out how to find out the coordinates of the edges of the screen. I initally thought that it was a set number, but I guess not. Is there a formula? Jason Mickela ICQ : 873518 E-Mail: jmickela@sbcglobal.net ------------------------------ "Evil attacks from all sides but the greatest evil attacks from within." Me ------------------------------
"The paths of glory lead but to the grave." - Thomas GrayMy Stupid BlogMy Online Photo Gallery
Advertisement
Are you talking 2D or 3D?

"Evil attacks from all sides
but the greatest evil attacks
from within." Me

Me = you or Windows ME edition?

Edited by - Shag on October 25, 2001 8:26:52 PM
the extents would be whatever you set for glViewport in 3d or in glOrtho in 2d

------------------General Equation, this is Private Function reporting for duty, sir!a2k
a2k: glViewport should be called in the same way regardless of whether you''re going to setup an orthographic projection or a perspective projection. It provides the mapping from normalized device coordinates to window coordinates.

griffenjam: It depends on how you setup your projection matrix.
I set up my projection like this.

gluPerspective(45.0f,(GLfloat)glWidth/(GLfloat)
glHeight,0.1f,1000.0f);

Now, given the current depth can you figure out the displayable width and height?



Jason Mickela
ICQ : 873518
E-Mail: jmickela@sbcglobal.net
------------------------------
"Evil attacks from all sides
but the greatest evil attacks
from within." Me
------------------------------
"The paths of glory lead but to the grave." - Thomas GrayMy Stupid BlogMy Online Photo Gallery

This topic is closed to new replies.

Advertisement