Game

Game

Constructors

this
this(string title, GameConfig config)

Game constructor.

Destructor

~this
~this()

Game destructor.

Members

Functions

addEvent
void addEvent(OnEvent event)

Adds event that will be processed by the main thread.

addScheduledTask
void addScheduledTask(float time, OnEvent task)

Adds scheduled event that will be processed by the main thread.

fixedUpdate
void fixedUpdate()

Processes game logic at fixed time rate, defined by m_tickrate.

onKey
void onKey(GLFWwindow* window, int key, int scancode, int action, int mods)

Event called on key action.

onMouseButton
void onMouseButton(GLFWwindow* window, int button, int action, int dunno)

Event called on mouse button action.

onMouseMove
void onMouseMove(GLFWwindow* window, double x, double y)

Event called on mouse movement.

onMouseWheel
void onMouseWheel(GLFWwindow* window, double xoffset, double yoffset)

Event called on mouse wheel action.

onText
void onText(GLFWwindow* window, uint codepoint)

Event called on character input.

onWindowClose
void onWindowClose(GLFWwindow* window)

Event called on window close action.

onWindowResize
void onWindowResize(GLFWwindow* window, int width, int height)

Event called on window resize action.

pollEvents
void pollEvents()

Polls window events.

run
void run()

Deault game loop.

setCursor
void setCursor(Cursor cursor)

Sets window mouse cursor.

setGameState
void setGameState(Variant[] params)

Defines current game state.

update
void update(float interpolation)

Processes game rendering.

Properties

assetLoader
AssetLoader assetLoader [@property getter]

Properties.

currentGameState
GameState currentGameState [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
deltaTime
float deltaTime [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
i18n
I18n i18n [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
inputHandler
InputHandler inputHandler [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
maxFrameSkip
int maxFrameSkip [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
maxFrameSkip
int maxFrameSkip [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
running
bool running [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
tickrate
float tickrate [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
window
Window window [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Meta