hx3d  1
2D/3D Simple Game Framework
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | List of all members
hx3d::window::Game Class Reference

Game main class: multiple screens management. More...

#include <game.hpp>

Public Member Functions

virtual void create ()
 Initialize the game.
 
virtual void render ()
 Render the current scren.
 
virtual void update (float delta)
 Update the current screen. More...
 
virtual void resize (int width, int height)
 Resize the current screen. More...
 
virtual void pause ()
 Pause the current screen.
 
virtual void resume ()
 Resume the current screen.
 
virtual void dispose ()
 Clean the current screen.
 
virtual void stop ()
 Stop the game.
 
void setScreen (Ptr< Screen > screen)
 Set the current screen. More...
 
void activateStats (bool enabled)
 Activate the stats. More...
 
void setTransition (const Ptr< graphics::Transition > &transition)
 Set the current transition. More...
 
void setViewport (const Ptr< graphics::viewports::Viewport > &viewport)
 Set the current viewport. More...
 
const Ptr< graphics::viewports::Viewport > & getViewport ()
 Get the current viewport. More...
 
ObjectMapgetSession ()
 Get the session. More...
 
glm::vec2 getSize ()
 Get the current game size. More...
 
bool isRunning ()
 Test if the game is running. More...
 

Detailed Description

Game main class: multiple screens management.

Definition at line 42 of file game.hpp.

Member Function Documentation

void hx3d::window::Game::activateStats ( bool  enabled)

Activate the stats.

Parameters
enabledTrue/False

Definition at line 222 of file game.cpp.

ObjectMap & hx3d::window::Game::getSession ( )

Get the session.

Returns
Session

Definition at line 161 of file game.cpp.

glm::vec2 hx3d::window::Game::getSize ( )

Get the current game size.

If a viewport is enabled, return the viewport size. Else, return the application size.

Returns
Game size

Definition at line 88 of file game.cpp.

const Ptr< graphics::viewports::Viewport > & hx3d::window::Game::getViewport ( )

Get the current viewport.

Returns
Viewport

Definition at line 84 of file game.cpp.

bool hx3d::window::Game::isRunning ( )

Test if the game is running.

Returns
True/False

Definition at line 190 of file game.cpp.

void hx3d::window::Game::resize ( int  width,
int  height 
)
virtual

Resize the current screen.

Parameters
widthNew width
heightNew height

Definition at line 185 of file game.cpp.

void hx3d::window::Game::setScreen ( Ptr< Screen screen)

Set the current screen.

Parameters
screenScreen (Ptr)

Definition at line 199 of file game.cpp.

void hx3d::window::Game::setTransition ( const Ptr< graphics::Transition > &  transition)

Set the current transition.

Parameters
transitionTransition

Definition at line 67 of file game.cpp.

void hx3d::window::Game::setViewport ( const Ptr< graphics::viewports::Viewport > &  viewport)

Set the current viewport.

Parameters
viewportViewport

Definition at line 71 of file game.cpp.

void hx3d::window::Game::update ( float  delta)
virtual

Update the current screen.

Parameters
deltaDelta time

Definition at line 165 of file game.cpp.


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