PDA

View Full Version : Getting the screen width and height


khellendros
10-16-2008, 08:42 AM
Hi,
I would like to know if it is possible to get the screen width and height during runtime. I have read Chopsticks' post on how to calibrate the mouse for an fps game. However, is it possible to get just the screen size and divide it by half to get the centrepoint of the screen?

DrJim
10-19-2008, 12:51 PM
Hi,
I would like to know if it is possible to get the screen width and height during runtime.

There is not a function call that I am aware of to get (or set) that information, which is unfortunate since it would be a useful thing to have.

The mouse postion calls all just give the current cursor postion relative to the top and left edges of the display window - regardless of whether the cursor is in the display window or not (see attached).

You can do a calibration routine to locate the bottom right corner of the window - which will thus give you the window's size - but I don't see any real advantage of that approach over the direct calibration approach you reference.