SFML community forums

Help => Window => Topic started by: PhiLLe on April 21, 2010, 07:29:11 pm

Title: A way to get sf::Style of an existing window
Post by: PhiLLe 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.
Title: A way to get sf::Style of an existing window
Post by: Laurent on April 21, 2010, 07:32:30 pm
There no GetStyle() function, you must store the style on your side.
Title: A way to get sf::Style of an existing window
Post by: PhiLLe 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?
Title: A way to get sf::Style of an existing window
Post by: Laurent 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).
Title: A way to get sf::Style of an existing window
Post by: PhiLLe 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?
Title: A way to get sf::Style of an existing window
Post by: Laurent 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.