Skip to content
Carl Hewett edited this page Sep 17, 2017 · 29 revisions

This class contains everything concerning your game. The only way to get a reference to it is by calling getGame().

Class Game

quit()

Quit the game. No cleanup is required.

setName(string name)

Set the game's name (this name will be visible on the window's title bar). The default name of a game is SDL3D.

string getName()

Get the game's name.

setSize(IVec2 size)

Set the game window's size in pixels. Consider calling reCenterMainWindow() after calling this. The default width is 800 and height, 600.

IVec2 getSize()

Get the game's window size.

setMaxFramesPerSecond(int maxFPS)

Set the game's max frames per second. Normally, this is 60. Surpassing 120 can lead to weirdness right now since game movement is based on the fact that the frame rate will not surpass 120. If 120 is not enough, you can easily change it in Game.cpp, but make sure you don't have v-sync!

setMainWindowPosition(IVec2 position)

Set the upper left corner of the game's window based on the screen's upper left corner.

IVec2 getMainWindowPosition()

Get the game's window upper left corner position on the screen.

reCenterMainWindow()

Re-center the game's window. Useful after changing the size.

ResourceManager& getResourceManager()

Get the game's resource manager object.

InputManager& getInputManager()

Get the game's input manager.

EntityManager getEntityManager()

Get the game's entity manager.

GraphicsManager getGraphicsManager()

Get the game's graphics manager.