Corners of the screen?

Started by
4 comments, last by OrangyTang 16 years, 3 months ago
Is there any way to get the coordinates for the screen window? If for example i want to fill the upper-half of the window with an image?
•°*”˜˜”*°•.˜”*°•..•°*”˜.•°*”˜˜”*°•..•°*”˜˜”*°•.˜”*°•.˜”*°•. Mads .•°*”˜.•°*”˜.•°*”˜˜”*°•.˜”*°•..•°*”˜.•°*”˜.•°*”˜ ˜”*°•.˜”*°•.˜”*°•..•°*”˜I am going to live forever... or die trying!
Advertisement
what library are you using to open the window?
(win32,glfw ,glut )?
win32
•°*”˜˜”*°•.˜”*°•..•°*”˜.•°*”˜˜”*°•..•°*”˜˜”*°•.˜”*°•.˜”*°•. Mads .•°*”˜.•°*”˜.•°*”˜˜”*°•.˜”*°•..•°*”˜.•°*”˜.•°*”˜ ˜”*°•.˜”*°•.˜”*°•..•°*”˜I am going to live forever... or die trying!
http://msdn2.microsoft.com/en-us/library/ms633519(VS.85).aspx
How exactly would i draw the image with OpenGL? Doesn't win32 use pixels and OpenGL units as lenght units? I am not quite sure how i would use the information given by bovinedragon. The only way i can see, is if i draw it with windows, but then i would have to set up my ugly bitmap class again. Is there no other way?
•°*”˜˜”*°•.˜”*°•..•°*”˜.•°*”˜˜”*°•..•°*”˜˜”*°•.˜”*°•.˜”*°•. Mads .•°*”˜.•°*”˜.•°*”˜˜”*°•.˜”*°•..•°*”˜.•°*”˜.•°*”˜ ˜”*°•.˜”*°•.˜”*°•..•°*”˜I am going to live forever... or die trying!
You can use glOrtho() to set the openGL coord system to be exactly the same as the window size in pixels. Then you can draw using pixel coords and it'll work as expected.

This topic is closed to new replies.

Advertisement