Game Development Reference
In-Depth Information
it, and the program naturally exits after it reaches the end of the main() method. The
fact that we created a window doesn't mean that it is fully functional (at least not yet). We
will have to program it according to what we want it to do. Now, let's block the main
function from finishing, by delaying the window's thread. SFML provides a simple inter-
face for that; just add the sf::sleep(sf::seconds(3)) line after the line which
creates the window. Now, the window is clearly visible for the duration of the sleep.
We can specify various configurations while creating the window—window size, title,
style, and graphics settings. You may have noticed that we pass two arguments to the the
Window constructor—an instance of VideoMode and a string (the title). The constructor
can actually take up to four parameters, the last two being optional— Style and Con-
textSettings . The next part covers what those arguments mean, and how to use
them.
Search WWH ::




Custom Search