Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Topic Gosu / Gosu Exchange / Max screen resolution?
- - By danikaze Date 2011-08-21 13:23
I've searched about this topic but I didn't find anything useful.

I have Windows 7 / C++ and my screen resolution is Full HD (1920x1080), and Gosu doesn't allow me to create a window of, let's say 1440x900 (it has enough space for the window decorator).
The created window is 1382x864 (1398x902 with the window borders)

If I try to create the window HD Ready (1280x720) it works perfectly: 1280x720 (1296x758 with borders).

If I try to create a 1904x1002 px I only get a 1641x864 one (1657x902 with borders)

NOTE: W7 dock has 40px of height, and the windows borders are: (top: 30px, left, right, bottom: 8px), so the maximum window size for me should be 1904x1002 px)

So, is there any restriction for this? Thx!
Parent - - By Spooner Date 2011-08-21 13:46
Gosu prevents you creating a window over 0.8 * screen width or 0.9 * screen height. If it is too large, it scales it so it will fit. There is no way to override this, even if you know it will fit, so check Gosu::screen_height and Gosu::screen_width before you create the window.
Parent - - By danikaze Date 2011-08-21 14:01
Are you sure? Because 0.8*1920 is 1536, and I got widder windows (1641). Maybe that's the behaviour but with another constants, right?

Is there any reason for Gosu to do this restriction?
Parent - By Spooner Date 2011-08-21 14:08
It must be the other way around then for width and height (0.8 * height and 0.9 * width then - I know those are the two numbers). Remember that it keeps aspect ratio when resizing, so it will generally only be limited in one dimension. "If I try to create a 1904x1002 px I only get a 1641x864 one (1657x902 with borders)" - This is limited vertically more than horizontally because 1080 * 0.8 is 864, so the end width of the window isn't as big as it could be.

The reason is to prevent creating a window that is too big to fit on the screen (allowing for window decoration and desktop bars). It is, however, quite an arbitrary and conservative measurement.
Parent - - By jlnr (dev) Date 2011-08-21 15:27
Exactly what Spooner said. I think there was a proper way to get the available screen estate (task bar excluded), so Gosu should be adjusted to respect that size instead.

Feel free to fork & send a pull request, I am busy fixing other things for the next days :(
Parent - By danikaze Date 2011-08-21 16:06
Nice explanation.
Now I know the limits it's ok. If I need something more, I'll try to fork.
Up Topic Gosu / Gosu Exchange / Max screen resolution?

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill