Bomberman
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
BBM::RenderSystem Class Reference

#include <RenderSystem.hpp>

Inheritance diagram for BBM::RenderSystem:
Collaboration diagram for BBM::RenderSystem:

Public Member Functions

void onSelfUpdate (std::chrono::nanoseconds dtime) override
 A method called after all entities that this system manage has been updated. More...
 
void onUpdate (WAL::ViewEntity< CameraComponent, PositionComponent > &entity, std::chrono::nanoseconds dtime) override
 
void setDebug (bool debug)
 
void drawBoundingBox (const WAL::Entity &entity, const PositionComponent &posComponent, const Drawable3DComponent &drawable) const
 
 RenderSystem (WAL::Wal &wal, RAY::Window &window, bool debugMode=false)
 ctor More...
 
 RenderSystem (const RenderSystem &)=default
 Default copy ctor. More...
 
 ~RenderSystem () override=default
 Default dtor. More...
 
RenderSystemoperator= (const RenderSystem &)=delete
 A render screen system can't be assigned. More...
 
- Public Member Functions inherited from WAL::System< CameraComponent, PositionComponent >
 ~System () override=default
 A virtual, default, destructor. More...
 
 System (System &&) noexcept=default
 A system can be moved. More...
 
View< Dependencies... > & getView () override
 Get a view of all entities containing every dependencies of this system. More...
 
virtual void onUpdate (ViewEntity< Dependencies... > &entity, std::chrono::nanoseconds dtime)
 Update the corresponding component of the given entity. More...
 
virtual void onFixedUpdate (ViewEntity< Dependencies... > &entity)
 An alternative of onUpdate that is called every 8ms (120 times per seconds). If the system slow down, it will try to catch up. More...
 
void update (std::chrono::nanoseconds dtime) final
 Update the whole system (every entities that this system is responsible can be updated. More...
 
void fixedUpdate () final
 An alternative of update that is called every 8ms (120 times per seconds). If the system slow down, it will try to catch up. More...
 
- Public Member Functions inherited from WAL::ISystem
virtual ~ISystem ()=default
 A virtual default destructor. More...
 

Private Member Functions

void drawRescaledDrawable (RAY::Drawables::ADrawable2D &drawable, const Vector2f &newDims)
 rescale the drawables dimensions according to new window dimensions More...
 
Vector2f getRescaledPosition (Vector3f &position, const Vector2f &newWinDims)
 rescale the drawables position according to new window dimensions More...
 
void resizeWindow (Vector2f &newDims)
 

Private Attributes

RAY::Window_window
 The window to render on. More...
 
RAY::Camera::Camera3D _camera
 The camera used to render. More...
 
bool _debugMode
 Defines if the debug informations must be displayed or not. More...
 

Static Private Attributes

static constexpr short FPS = 60
 Window framerate limit. More...
 

Additional Inherited Members

- Protected Member Functions inherited from WAL::System< CameraComponent, PositionComponent >
 System (Wal &wal)
 A system can't be instantiated, it should be derived. More...
 
 System (const System &)=default
 A system can't be instantiated, it should be derived. More...
 
Systemoperator= (const System &)=default
 A system can't be instantiated, it should be derived. More...
 
- Protected Attributes inherited from WAL::System< CameraComponent, PositionComponent >
Wal_wal
 A reference to the ECS. More...
 

Constructor & Destructor Documentation

◆ RenderSystem() [1/2]

BBM::RenderSystem::RenderSystem ( WAL::Wal wal,
RAY::Window window,
bool  debugMode = false 
)

ctor

◆ RenderSystem() [2/2]

BBM::RenderSystem::RenderSystem ( const RenderSystem )
default

Default copy ctor.

◆ ~RenderSystem()

BBM::RenderSystem::~RenderSystem ( )
overridedefault

Default dtor.

Member Function Documentation

◆ drawBoundingBox()

void BBM::RenderSystem::drawBoundingBox ( const WAL::Entity entity,
const PositionComponent posComponent,
const Drawable3DComponent drawable 
) const
Parameters
entityentity to draw bounding box of

◆ drawRescaledDrawable()

void BBM::RenderSystem::drawRescaledDrawable ( RAY::Drawables::ADrawable2D drawable,
const Vector2f newDims 
)
private

rescale the drawables dimensions according to new window dimensions

Parameters
drawablethe drawable to rescale
newDimsthe new window's dimensions

◆ getRescaledPosition()

Vector2f BBM::RenderSystem::getRescaledPosition ( Vector3f position,
const Vector2f newWinDims 
)
private

rescale the drawables position according to new window dimensions

Parameters
positiona reference to position
newDimsthe new window's dimensions

◆ onSelfUpdate()

void BBM::RenderSystem::onSelfUpdate ( std::chrono::nanoseconds  dtime)
overridevirtual

A method called after all entities that this system manage has been updated.

Note
render on screen here

Reimplemented from WAL::System< CameraComponent, PositionComponent >.

◆ onUpdate()

void BBM::RenderSystem::onUpdate ( WAL::ViewEntity< CameraComponent, PositionComponent > &  entity,
std::chrono::nanoseconds  dtime 
)
override

◆ operator=()

RenderSystem& BBM::RenderSystem::operator= ( const RenderSystem )
delete

A render screen system can't be assigned.

◆ resizeWindow()

void BBM::RenderSystem::resizeWindow ( Vector2f newDims)
private

◆ setDebug()

void BBM::RenderSystem::setDebug ( bool  debug)
Parameters
debugtrue if debug mode should be enabled

Member Data Documentation

◆ _camera

RAY::Camera::Camera3D BBM::RenderSystem::_camera
private

The camera used to render.

◆ _debugMode

bool BBM::RenderSystem::_debugMode
private

Defines if the debug informations must be displayed or not.

◆ _window

RAY::Window& BBM::RenderSystem::_window
private

The window to render on.

◆ FPS

constexpr short BBM::RenderSystem::FPS = 60
staticconstexprprivate

Window framerate limit.


The documentation for this class was generated from the following files: