Game Development Reference
In-Depth Information
The render frame
Do you, remember the Window class? That isn't of much use now, since it doesn't provide
an interface to draw SFML shapes. We have to use a class called RenderWindow to do
that. This class is derived from the Window class and adds the drawing functionality. Don't
worry though, it doesn't strip any functionality from its parent, it just adds more functional-
ity on top of it. So we can still create it, poll events, and so on, in the same way we do with
the base class Window . Here is an example of a game loop with a render cycle:
It is important to note here that the RenderWindow class is from the SFML graphics
module, which means that we have to include <SFML/Graphics.hpp> , rather than
Search WWH ::




Custom Search