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

Author Topic: Get Window Style?  (Read 1117 times)

0 Members and 1 Guest are viewing this topic.


  • Newbie
  • *
  • Posts: 10
    • View Profile
Get Window Style?
« on: June 23, 2013, 04:22:00 pm »
Hi :)

I was wondering if there is a way to get the current window style?

background is, that i would only want to recreate the window when the style changes (fullscreen to windowed and vice versa) and not always uppon applying my settings.

(atm i just recreate it either with one or the other style, but every time).

Code: [Select]
mMainStateWindow->create(sf::VideoMode(sf::VideoMode::getDesktopMode()), "Test", sf::Style::Fullscreen);
mMainStateWindow->create(sf::VideoMode(mSettings->GetXRes(), mSettings->GetYRes(), 32), "Testn", sf::Style::Close);

sure, i could have a history of my fullscreen setting but  i don't really like that solution.


  • SFML Team
  • Hero Member
  • *****
  • Posts: 10226
    • View Profile
    • development blog
    • Email
Re: Get Window Style?
« Reply #1 on: June 23, 2013, 04:50:19 pm »
It's fairly simple to figure out on your own. ;)
Go to the documentation, open the overview for the sf::Window class and go over all the function names. Then ask yourself: "Is there a function that sounds similar to getStyle()?"

I've just done it, just to make sure and can now tell you: nope there isn't. :)

It's fairly simple to keep track of the different styling yourself.
« Last Edit: June 23, 2013, 04:52:12 pm by eXpl0it3r »
Official FAQ: https://www.sfml-dev.org/faq.php
Nightly Builds: https://www.nightlybuilds.ch/
Dev Blog: https://dev.my-gate.net/
Thor: http://www.bromeon.ch/libraries/thor/


  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Get Window Style?
« Reply #2 on: June 23, 2013, 05:06:51 pm »
been there, done that, but i thought i have overseen something^^

guess i have to it this way...