|
JNGL
Easy to use cross-platform 2D game library
|
Background job which stays part of the main loop independent of the active jngl::Work. More...
#include <jngl/job.hpp>
Public Member Functions | |
| virtual void | step ()=0 |
| Advance the game logic. | |
| virtual void | draw () const =0 |
| Draw the game state. | |
| virtual void | onFileDrop (const std::filesystem::path &) |
| Called when a file has been dropped onto the window. | |
| virtual void | onControllersChanged () |
| Whenever the return value of jngl::getConnectedControllers would change, this method gets called. | |
| Job ()=default | |
| Does nothing. | |
| Job (const Job &)=default | |
| Copy constructor. | |
| Job & | operator= (const Job &)=default |
| Copy assignment. | |
| Job (Job &&)=default | |
| Move constructor. | |
| Job & | operator= (Job &&)=default |
| Move assignment. | |
| virtual | ~Job () |
| Does nothing. | |
Background job which stays part of the main loop independent of the active jngl::Work.
This can be used for an achievement system for example. Override this class and use jngl::addJob to register it.
Jobs (meaning instances of this class that were added using jngl::addJob) are always stepped before the active jngl::Work and drawn after it.
|
pure virtual |
Advance the game logic.
This function gets called 60 times per second or whatever has been set by setStepsPerSecond().
Implemented in Fade, and WorkFactory.
|
pure virtual |