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

Author Topic: Windowed to Fullscreen (change resolution)  (Read 2313 times)

0 Members and 1 Guest are viewing this topic.

Kanefa

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Windowed to Fullscreen (change resolution)
« on: August 09, 2014, 12:37:41 pm »
I've been working on letting the user switch between windowed and fullscreen.  When I switch from 800x600 windowed mode to fullscreen I want to use the desktop's resolution.  I can fetch the desktop's resolution using VideoMode::GetDesktopMode() function.  However, I am not sure how to apply the new resolution.



« Last Edit: August 09, 2014, 01:08:09 pm by Kanefa »

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Windowed to Fullscreen (change resolution)
« Reply #1 on: August 09, 2014, 01:15:15 pm »
You have to recreate the window with the appropriate flags. Use sf::Window::create for that.
SFML / OS X developer

Kanefa

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: Windowed to Fullscreen (change resolution)
« Reply #2 on: August 09, 2014, 05:56:58 pm »
Thanks for the response.  I have a follow-up question.  In what circumstance would I want the resolution to be different than the size of the view?  Or is this achieving the same effect as calling zoom on the view?

mWindow.create(sf::VideoMode(800, 600), "MyApp", sf::Style::Fullscreen);
sf::View(sf::FloatRect(0, 0, 400, 300));
 

G.

  • Hero Member
  • *****
  • Posts: 1593
    • View Profile
Re: Windowed to Fullscreen (change resolution)
« Reply #3 on: August 09, 2014, 10:57:16 pm »
Yes, it's the same effect.