Game Development Reference
In-Depth Information
Style
The Style argument is a bit mask. A mask is a combination of flags where each flag rep-
resents a specific bit of the mask. In this case, the flags are stored in an enum in the
sf::Style namespace. We can use a combination of flags to create the desired mask.
Here is what SFML offers in terms of styles:
Enum value
Description
The window doesn't have any decorations, and it cannot be combined with any other
style.
sf::Style::None
sf::Style::Titlebar
This adds a titlebar.
This adds a maximize button. This also enables the window to be manually resized.
sf::Style::Resize
sf::Style::Close
This adds a close button.
sf::Style::Fullscreen This launches the window in fullscreen mode. Note that this cannot be combined with
any other style and requires a valid video mode.
sf::Style::Default
This combines Titlebar , Resize , and Close . This is the default style.
The way you can combine different styles is by using the bitwise OR operator. So in a case
where we want a window with a titlebar and a close button, we write:
sf::Uint32 style = sf::Style::Titlebar | sf::Style::Close;
The only thing left to do here is to pass that style as the third argument of the Window con-
struct.
Search WWH ::




Custom Search