Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: VideoMode method to find native Resolution  (Read 2851 times)

0 Members and 2 Guests are viewing this topic.

Jebbs

  • Sr. Member
  • ****
  • Posts: 358
  • DSFML Developer
    • View Profile
    • Email
VideoMode method to find native Resolution
« 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?
DSFML - SFML for the D Programming Language.

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: VideoMode method to find native Resolution
« Reply #1 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.
Back to C++ gamedev with SFML in May 2023

Jebbs

  • Sr. Member
  • ****
  • Posts: 358
  • DSFML Developer
    • View Profile
    • Email
Re: VideoMode method to find native Resolution
« Reply #2 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).
DSFML - SFML for the D Programming Language.

 

anything