Game Development Reference
In-Depth Information
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
The window doesn't have any decorations, and it cannot be combined with any other
This adds a titlebar.
This adds a maximize button. This also enables the window to be manually resized.
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.
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-
Search WWH ::

Custom Search