SFML community forums

General => Feature requests => Topic started by: Jebbs on June 03, 2013, 11:57:51 pm

Title: VideoMode method to find native Resolution
Post by: Jebbs on June 03, 2013, 11:57:51 pm
I was thinking that it could be very handy to know the native resolution of the user's monitor. I would like to request a method(presumably for VideoMode) that returns a Vector2u with the native resolution.

I didn't see anything related to this when I did a search, so I'm guessing there hasn't been a lot/any request for this previously?
Title: Re: VideoMode method to find native Resolution
Post by: FRex on June 04, 2013, 12:02:25 am
http://www.sfml-dev.org/documentation/2.0/classsf_1_1VideoMode.php#ac1be160a4342e6eafb2cb0e8c9b18d44
I guess you have to hope user isn't masochist and has native res set up. First from vector of fullscreen modes seems to be native too.
Title: Re: VideoMode method to find native Resolution
Post by: Jebbs on June 04, 2013, 12:24:12 am
I definitely thought about using getDesktopMode, but they could have a different resolution set.

First from vector of fullscreen modes seems to be native too.

I thought it returns videomodes sorted from highest to lowest resolutions supported though. It is possible that a monitor supports a higher resolution than its native one.

Quote from: SFML Documentation
The returned array is sorted from best to worst, so that the first element will always give the best mode (higher width, height and bits-per-pixel).