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

Author Topic: A way to get sf::Style of an existing window  (Read 2406 times)

0 Members and 1 Guest are viewing this topic.

PhiLLe

  • Newbie
  • *
  • Posts: 36
    • View Profile
A way to get sf::Style of an existing window
« on: April 21, 2010, 07:29:11 pm »
Is there a way to get the style of a window that exists?
I want to check if my window is fullscreen and didn't find a function for that purpose in the documentation.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
A way to get sf::Style of an existing window
« Reply #1 on: April 21, 2010, 07:32:30 pm »
There no GetStyle() function, you must store the style on your side.
Laurent Gomila - SFML developer

PhiLLe

  • Newbie
  • *
  • Posts: 36
    • View Profile
A way to get sf::Style of an existing window
« Reply #2 on: April 21, 2010, 07:45:10 pm »
Is there going to be one one in 2.0 or is there a reason why there is none?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
A way to get sf::Style of an existing window
« Reply #3 on: April 21, 2010, 08:17:25 pm »
Quote
Is there going to be one one in 2.0

I don't know, maybe.

Quote
is there a reason why there is none?

I don't like the idea of putting a pair of getter/setter for every member of every class. Classes provide services, not data. And one service that a window provides is changing its title. Retrieving it is another service that is much less relevant (in my opinion).
Laurent Gomila - SFML developer

PhiLLe

  • Newbie
  • *
  • Posts: 36
    • View Profile
A way to get sf::Style of an existing window
« Reply #4 on: April 21, 2010, 09:28:54 pm »
Quote
I don't like the idea of putting a pair of getter/setter for every member of every class. Classes provide services, not data. And one service that a window provides is changing its title. Retrieving it is another service that is much less relevant (in my opinion).


I see what you mean. My opinion is that a class should have a method to get each member that it can set. It makes everything a lot easier.

Maybe a simple solution would be if the sf::Style would be added to the sf::WindowSettings member of the sf::Window. What do you think?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
A way to get sf::Style of an existing window
« Reply #5 on: April 21, 2010, 09:31:53 pm »
Quote
My opinion is that a class should have a method to get each member that it can set. It makes everything a lot easier.

I understand your point of view.

Quote
Maybe a simple solution would be if the sf::Style would be added to the sf::WindowSettings member of the sf::Window. What do you think?

No, WindowSettings are all the settings that are related to the OpenGL context (it's called ContextSettings in SFML 2).
If I add it, it will be a Window::GetStyle() function.
Laurent Gomila - SFML developer