JNGL
Public Member Functions | List of all members
Work Class Reference

Active state of the game, e.g. a menu or the game itself. More...

#include <jngl/work.hpp>

Public Member Functions

virtual void onQuitEvent ()
 Gets called when the user closes the main window or quit() has been called. More...
 
virtual void onPauseEvent ()
 Gets called when the main window loses focus or the app is put in the background. More...
 
virtual void onLoad ()
 Gets called when the Work is activated by App::mainLoop()
 
- Public Member Functions inherited from Job
virtual void step ()=0
 Advance the game logic. More...
 
virtual void draw () const =0
 Draw the game state. More...
 
 Job ()=default
 Does nothing.
 
 Job (const Job &)=default
 Copy constructor.
 
Joboperator= (const Job &)=default
 Copy assignment.
 
 Job (Job &&)=default
 Move constructor.
 
Joboperator= (Job &&)=default
 Move assignment.
 
virtual ~Job ()
 Does nothing.
 

Detailed Description

Active state of the game, e.g. a menu or the game itself.

Definition at line 13 of file work.hpp.

Inheritance diagram for Work:
[legend]
Collaboration diagram for Work:
[legend]

Member Function Documentation

◆ onQuitEvent()

virtual void onQuitEvent ( )
virtual

Gets called when the user closes the main window or quit() has been called.

On Android this will happen when the back button is pressed.

To continue with the main loop, call cancelQuit().

◆ onPauseEvent()

virtual void onPauseEvent ( )
virtual

Gets called when the main window loses focus or the app is put in the background.

On iOS and Android this will happen when the user switches to another app. As the main loop continues to run you might want to pause the game if necessary.


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