Slippers Engine
 
Loading...
Searching...
No Matches
Game

Responsible for Game Start, Game End, Load Resources, and window related functions. More...

Classes

class  Game
 Responsible for Game Start, Game End, Load Resources, and window related functions. More...
 

Detailed Description

Responsible for Game Start, Game End, Load Resources, and window related functions.

Example: GameStart.cpp

Game::SetWindowName("Demo Game");
Game::SetClear(0.4f, 0.4f, 0.8f, 1.0f);
//Game::SetClear(Color::LightSkyBlue);
Game::SetWidthHeightDefault(); // 1/4 of the screen
//Game::SetWidthHeight(800, 600); // set dimension directly
}
static void SetWidthHeightDefault()
Sets width and height of the window to be a quarter of the monitor size.
Definition Game.h:192
static void SetWindowName(const char *name)
Sets window's name.
Definition Game.h:198
void GameStart()
Fill GameStart.cpp with actions that should occur when the game is launched.
static void SetClear(float r, float g, float b, float a)
Sets window's background color to an RGBA value.
Definition Game.h:176

GameEnd.cpp

void Game::GameEnd() {
//Delete static objects
}
void GameEnd()
Fill GameEnd.cpp with actions that should occur when the game is closed.

LoadResources.cpp

//Models
ModelManager::LoadModel("Plane", 400, 2, 2);
ModelManager::LoadModel("Demo Model", "demo_model.azul");
ModelManager::LoadModel("Unit Sphere", Model::UnitSphere);
//Textures
TextureManager::LoadTexture("Demo Texture", "demo_texture.tga");
TextureManager::LoadTexture("Grid", "grid.tga");
//Shaders
ShaderManager::LoadShader("ColorNoText", "colorNoTextureRender");
//Images
ImageManager::Load("Demo Image", TextureManager::GetTexture("Demo Texture"));
//Fonts
FontManager::LoadFont("Demo Font", "ComicSans30");
SceneManager::SetStartScene(new SceneDemo());
}
static void LoadFont(const MapKey &key, const std::string &path)
Load Font with KEY and FILE PATH.
Definition FontManager.h:60
void LoadResources()
Fill LoadResources.cpp with assets you want to load.
static void Load(const MapKey &key, Texture *tex)
Image Model with KEY and TEXTURE.
Definition ImageManager.h:63
static void LoadModel(const MapKey &key, const std::string &path)
Load Model with KEY and FILE PATH.
Definition ModelManager.h:69
static void SetStartScene(Scene *start)
Sets pointer to start scene.
Definition SceneManager.h:64
static void LoadShader(const MapKey &key, const std::string &path)
Load Shader with KEY and FILE PATH.
Definition ShaderManager.h:63
static Texture * GetTexture(const MapKey &key)
Returns texture pointer with given KEY.
Definition TextureManager.h:134
static void LoadTexture(const MapKey &key, const std::string &path)
Load Texture with KEY and FILE PATH.
Definition TextureManager.h:100