|
Simple C++ Game
|
A system that manages Entity sprite sizes, positions, and drawing. More...
#include <RenderSystem.hpp>


Public Member Functions | |
| RenderSystem () | |
| Construct a new RenderSystem. | |
| void | render (sf::RenderTarget &target) const |
| Draws the prepared sprites to the sf::RenderTarget. More... | |
Public Member Functions inherited from IteratingSystem | |
| IteratingSystem () | |
| Construct a new IteratingSystem with the default EntitySystem constructor. More... | |
| IteratingSystem (const std::shared_ptr< EntityFamily > &family) | |
| Construct a new IteratingSystem with the EntityFamily EntitySystem constructor. More... | |
| void | update (const sf::Time deltaTime) |
| Iterates through each element in the system to perform updates. More... | |
Public Member Functions inherited from EntitySystem | |
| EntitySystem () | |
| Construct a new default EntitySystem. More... | |
| EntitySystem (const std::shared_ptr< EntityFamily > &family) | |
| Construct a new EntitySystem that acts on a specified family. More... | |
| virtual void | engineEntityAdded (const std::shared_ptr< Entity > &entity) |
| Performs any operations required after an entity has been added to an EntityEngine the system is a part of. More... | |
Protected Member Functions | |
| void | process (std::shared_ptr< Entity > &entity, sf::Time deltaTime) |
| Processes the Entity graphical data. More... | |
Protected Member Functions inherited from EntitySystem | |
| virtual std::map< int, std::shared_ptr< Entity > > | getEntities () const |
| Get the Entities in the system. More... | |
A system that manages Entity sprite sizes, positions, and drawing.
It acts on all elements with a RenderComponent and LocationComponent
|
protectedvirtual |
Processes the Entity graphical data.
Sprites are moved and scaled to align with the Entity LocationComponent data.
| entity | The entity being processed |
| deltaTime | The amount of time that has passed since process() was last called on this entity |
Implements IteratingSystem.
| void RenderSystem::render | ( | sf::RenderTarget & | target | ) | const |
Draws the prepared sprites to the sf::RenderTarget.
This method assumes that it is part of a larger pipeline and that entities may not be the only thing being rendered. Methods such as sf::RenderWindow.display() need to be called after RenderSystem::render() to ensure everything is displayed correctly.
| target | The target to draw the entities on. |