#include <Game.hpp>

Public Member Functions

 Game (Window *window, GameIdentity const &identity)
 
 ~Game ()
 
SystemContainersystem_container ()
 
RenderTarget::Geometry geometry () const
 
RenderTargetrender_target () const
 

Protected Member Functions

virtual void game_geometryChanged (RenderTarget::Geometry geometry)=0
 
virtual void game_draw ()=0
 Rendering. More...
 
virtual void game_focusLost ()=0
 Application lost focus, meaning mostly input focus. Game should get automatically paused. More...
 
virtual bool game_input (Input const *input)=0
 Returns true if input was processed (used for example on emscripten to determine if input was consumed by application or should be passed to web browser for further processing). More...
 
virtual bool input (Input const *input) override
 
virtual void focus_lost () override
 
virtual void update (uint64_t delta_ms) override
 
virtual bool extra_update () override
 
virtual void draw () override
 
virtual void gpu (bool enabled, bool dropped) override
 
virtual void resized (RenderTarget::Geometry) override
 
- Protected Member Functions inherited from iv::WindowListener
virtual ~WindowListener ()
 

Detailed Description

Definition at line 14 of file Game.hpp.

Constructor & Destructor Documentation

◆ Game()

iv::Game::Game ( Window window,
GameIdentity const &  identity 
)

Definition at line 90 of file Game.cpp.

◆ ~Game()

iv::Game::~Game ( )

Definition at line 119 of file Game.cpp.

Member Function Documentation

◆ system_container()

SystemContainer * iv::Game::system_container ( )

Definition at line 140 of file Game.cpp.

◆ geometry()

RenderTarget::Geometry iv::Game::geometry ( ) const

Definition at line 145 of file Game.cpp.

◆ render_target()

RenderTarget * iv::Game::render_target ( ) const

Definition at line 150 of file Game.cpp.

◆ game_geometryChanged()

virtual void iv::Game::game_geometryChanged ( RenderTarget::Geometry  geometry)
protectedpure virtual

◆ game_draw()

virtual void iv::Game::game_draw ( )
protectedpure virtual

Rendering.

◆ game_focusLost()

virtual void iv::Game::game_focusLost ( )
protectedpure virtual

Application lost focus, meaning mostly input focus. Game should get automatically paused.

◆ game_input()

virtual bool iv::Game::game_input ( Input const *  input)
protectedpure virtual

Returns true if input was processed (used for example on emscripten to determine if input was consumed by application or should be passed to web browser for further processing).

◆ input()

bool iv::Game::input ( Input const *  input)
overrideprotectedvirtual

Called when input to a Window occured.

Returns
True when input was processed by someone.

Implements iv::WindowListener.

Definition at line 155 of file Game.cpp.

◆ focus_lost()

void iv::Game::focus_lost ( )
overrideprotectedvirtual

Implements iv::WindowListener.

Definition at line 160 of file Game.cpp.

◆ update()

void iv::Game::update ( uint64_t  delta_ms)
overrideprotectedvirtual

Called with frequency specified in class Window.

Implements iv::WindowListener.

Definition at line 165 of file Game.cpp.

◆ extra_update()

bool iv::Game::extra_update ( )
overrideprotectedvirtual

When there is some extra time remaining in the frame, this will be called. Returns true if someting was done so that window will consider calling it again in the same frame.

Implements iv::WindowListener.

Definition at line 198 of file Game.cpp.

◆ draw()

void iv::Game::draw ( )
overrideprotectedvirtual

Implements iv::WindowListener.

Definition at line 174 of file Game.cpp.

◆ gpu()

void iv::Game::gpu ( bool  enabled,
bool  dropped 
)
overrideprotectedvirtual

Called when gpu state changed - it got released or attached again.

Implements iv::WindowListener.

Definition at line 179 of file Game.cpp.

◆ resized()

void iv::Game::resized ( RenderTarget::Geometry  )
overrideprotectedvirtual

Called when window size is changed. Not called on app init (only when window size is changed). Physical resolution is winsize * pixel_density. Uusal values for pixel_density are: LDPI: 0.75 MDPI: 1.0 HDPI: 1.5 XHDPI: 2.0 XXHDPI: 3.0 XXXHDPI: 4.0

Implements iv::WindowListener.

Definition at line 192 of file Game.cpp.


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