Landscape rendering
As you can observe in the C++ sample for this chapter, our aircraft travels continuously over a desert. This continuity can be achieved in many ways and with many different levels of detail and complexity. However, we chose to go in a very simple and yet effective way of doing it, using a feature that SFML provides out of the box.
SpriteNode
In order to display our background sprite through the scene graph, we created a new SceneNode
type, the SpriteNode
, which acts as a simple sf::Sprite
that can be plugged into our tree structure. Conveniently, this is all we need to make our landscape. We only have to create SpriteNode
and attach it to our background layer of the scene graph.
To demonstrate the implementation of a new node ...
Get SFML Game Development now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.