Base class for all games. Provides graphics initialization, game loop, and rendering code. Inherit from this class when creating your own game.
More...
#include <Game.h>
|
| static void | SetScreenResolution (int width, int height) |
| | Sets the screen resolution.
|
| |
| static void | SetWindowTitle (std::string title) |
| | Sets the title of the game window.
|
| |
Base class for all games. Provides graphics initialization, game loop, and rendering code. Inherit from this class when creating your own game.
Definition at line 21 of file Game.h.
◆ Game()
| KatanaEngine::Game::Game |
( |
| ) |
|
◆ ~Game()
| KatanaEngine::Game::~Game |
( |
| ) |
|
|
virtual |
◆ DisplayFrameRate()
| void KatanaEngine::Game::DisplayFrameRate |
( |
| ) |
|
|
protectedvirtual |
Displays the game's current frame rate.
Definition at line 195 of file Game.cpp.
◆ Draw()
| void KatanaEngine::Game::Draw |
( |
SpriteBatch & | spriteBatch | ) |
|
|
virtual |
Called when the game determines it is time to draw a frame.
- Parameters
-
| spriteBatch | A reference to the game's sprite batch, used for rendering. |
Reimplemented in SpaceFighter.
Definition at line 78 of file Game.cpp.
◆ GetName()
| virtual std::string KatanaEngine::Game::GetName |
( |
| ) |
const |
|
pure virtual |
Gets the name of the game.
- Returns
- The name of the game.
Implemented in SpaceFighter.
◆ GetResourceManager()
◆ GetScreenCenter()
| static Vector2 KatanaEngine::Game::GetScreenCenter |
( |
| ) |
|
|
inlinestatic |
Gets the screen size in pixels.
- Returns
- A Point representing the width and height of the screen.
Definition at line 44 of file Game.h.
◆ GetScreenHeight()
| static int KatanaEngine::Game::GetScreenHeight |
( |
| ) |
|
|
inlinestatic |
Gets the screen width in pixels.
- Returns
- The width in pixels.
Definition at line 40 of file Game.h.
◆ GetScreenManager()
| virtual ScreenManager * KatanaEngine::Game::GetScreenManager |
( |
| ) |
const |
|
inlinevirtual |
◆ GetScreenWidth()
| static int KatanaEngine::Game::GetScreenWidth |
( |
| ) |
|
|
inlinestatic |
Gets the screen width in pixels.
- Returns
- The width in pixels.
Definition at line 36 of file Game.h.
◆ GetSpriteBatch()
| virtual SpriteBatch * KatanaEngine::Game::GetSpriteBatch |
( |
| ) |
const |
|
inlinevirtual |
◆ InitializeScreenManager()
| virtual void KatanaEngine::Game::InitializeScreenManager |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ LoadContent()
| virtual void KatanaEngine::Game::LoadContent |
( |
ResourceManager & | resourceManager | ) |
|
|
inlinevirtual |
Called when resources need to be loaded.
- Parameters
-
| resourceManager | A reference to the game's resource manager, used for loading and managing game assets (resources). |
Reimplemented in SpaceFighter.
Definition at line 65 of file Game.h.
◆ Quit()
| virtual void KatanaEngine::Game::Quit |
( |
| ) |
|
|
inlinevirtual |
Quits the game.
Definition at line 80 of file Game.h.
◆ ResetGameTime()
| virtual void KatanaEngine::Game::ResetGameTime |
( |
| ) |
|
|
inlineprotectedvirtual |
Resets the game's timing values.
Definition at line 120 of file Game.h.
◆ Run()
| int KatanaEngine::Game::Run |
( |
| ) |
|
|
virtual |
Runs the game instance.
- Returns
- Error code for exit status.
Definition at line 86 of file Game.cpp.
◆ SetFrameCounterFont()
| virtual void KatanaEngine::Game::SetFrameCounterFont |
( |
Font * | pFont | ) |
|
|
inlineprotectedvirtual |
Sets the font for the frame counter.
- Parameters
-
| pFont | A pointer to the font. |
Definition at line 105 of file Game.h.
◆ SetFullScreen()
| virtual void KatanaEngine::Game::SetFullScreen |
( |
bool | isFullScreen | ) |
|
|
inlineprotectedvirtual |
Sets the game to display in fullscreen mode.
Definition at line 114 of file Game.h.
◆ SetOpenGLFlag()
| virtual void KatanaEngine::Game::SetOpenGLFlag |
( |
| ) |
|
|
inlineprotectedvirtual |
Sets the OpenGL flag, which forces OpenGL rendering.
Definition at line 117 of file Game.h.
◆ SetResourceDirectory()
| virtual void KatanaEngine::Game::SetResourceDirectory |
( |
const std::string & | path | ) |
|
|
inlineprotectedvirtual |
Sets the location of the directory where the game's resources are stored.
- Parameters
-
| path | The relative path to the resource directory. |
Definition at line 97 of file Game.h.
◆ SetScreenResolution()
| static void KatanaEngine::Game::SetScreenResolution |
( |
int | width, |
|
|
int | height ) |
|
inlinestaticprotected |
Sets the screen resolution.
- Parameters
-
| width | The width of the screen in pixels. |
| height | The height of the screen in pixels. |
Definition at line 88 of file Game.h.
◆ SetTargetFramesPerSecond()
| void KatanaEngine::Game::SetTargetFramesPerSecond |
( |
int const | frames | ) |
|
|
protectedvirtual |
Sets the target frame rate for the game.
- Parameters
-
| frames | The target number of frames per second. |
Definition at line 243 of file Game.cpp.
◆ SetWindowTitle()
| static void KatanaEngine::Game::SetWindowTitle |
( |
std::string | title | ) |
|
|
inlinestaticprotected |
Sets the title of the game window.
- Parameters
-
Definition at line 93 of file Game.h.
◆ UnloadContent()
| virtual void KatanaEngine::Game::UnloadContent |
( |
| ) |
|
|
inlinevirtual |
Called when resources need to be unloaded. Override this method to unload any game-specific resources.
Definition at line 69 of file Game.h.
◆ Update()
| void KatanaEngine::Game::Update |
( |
const GameTime & | gameTime | ) |
|
|
virtual |
Called when the game has determined that game logic needs to be processed.
- Parameters
-
| gameTime | A reference to the game time object. |
Definition at line 70 of file Game.cpp.
The documentation for this class was generated from the following files: