Sly Engine
Sly Class Reference

#include <Sly.h>

Inheritance diagram for Sly:
Inheritance graph
Collaboration diagram for Sly:
Collaboration graph

Static Public Member Functions

static void Run ()
 Kick starts the engine. Begins by loading the framework followed by initializing the Sly Engine. More...
 
static int GetHeight ()
 Gets the window height. More...
 
static int GetWidth ()
 Gets the window width. More...
 
static void SetClear (float r, float g, float b, float a)
 Sets the color to clear the screen with. More...
 
static void SetWidthHeight (int w, int h)
 Sets width and height of the main window. More...
 
static void SetWindowName (const char *name)
 Sets window name. More...
 

Private Member Functions

 Sly ()=default
 Default constructor. More...
 
 Sly (const Sly &)=delete
 Copy constructor. More...
 
 Sly (Sly &&)=delete
 Move constructor. More...
 
Slyoperator= (const Sly &)=delete
 Assignment operator. More...
 
Slyoperator= (Sly &&)=delete
 Move assignment operator. More...
 
 ~Sly ()=default
 Deconstructor. More...
 
virtual void Initialize ()
 Engine initialization. Setups up various managers. More...
 
virtual void LoadContent ()
 Loads engine starting content. Loads first scene. More...
 
virtual void Update ()
 Main update loop. More...
 
virtual void Draw ()
 Main draw loop. More...
 
virtual void UnLoadContent ()
 Cleans up engine content. More...
 
int privGetHeight ()
 Internal get height, pulls height from Azul framework. More...
 
int privGetWidth ()
 Internal get width, pulls width from Azul framework. More...
 
void privSetClear (float r, float g, float b, float a)
 Internal set clear. Passes values to Azul framework. More...
 
void privSetWidthHeight (int w, int h)
 Internal set Width and Height, passes values to Azul framework. More...
 
void privSetWindowName (const char *name)
 Internal set window name. Passes this info to the Azul framework. More...
 
 Sly (const char *windowName, const int Width, const int Height)
 Legacy Constructor. More...
 
void LoadAllResources ()
 User defined LoadResources. Content to be defined by the user. Typically models, textures, and shaders are loaded here. More...
 
void GameInitialize ()
 Game initialize, window and engine modifications to be defined by the user.
More...
 
void GameEnd ()
 Game end, to be defined by the user. Typically used for cleaning up memory. More...
 
float privGetTime ()
 Gets internal time. More...
 

Static Private Member Functions

static SlyInstance ()
 Gets the instance. More...
 
static float GetTime ()
 Gets the time. More...
 

Static Private Attributes

static SlyptrInstance = nullptr
 

Friends

class SlyAttorney
 

Constructor & Destructor Documentation

◆ Sly() [1/4]

Sly::Sly ( )
privatedefault

Default constructor.

Here is the caller graph for this function:

◆ Sly() [2/4]

Sly::Sly ( const Sly )
privatedelete

Copy constructor.

◆ Sly() [3/4]

Sly::Sly ( Sly &&  )
privatedelete

Move constructor.

◆ ~Sly()

Sly::~Sly ( )
privatedefault

Deconstructor.

◆ Sly() [4/4]

Sly::Sly ( const char *  windowName,
const int  Width,
const int  Height 
)
private

Legacy Constructor.

Parameters
windowNameName of the window.
WidthThe width.
HeightThe height.

Member Function Documentation

◆ Draw()

void Sly::Draw ( )
privatevirtual

Main draw loop.

Calls internal systems to process their draw loops. Routed through the SceneManager.

Here is the call graph for this function:

◆ GameEnd()

void Sly::GameEnd ( )
private

Game end, to be defined by the user. Typically used for cleaning up memory.

void Sly::GameEnd() {
BulletFactory::Terminate();
TankFactory::Terminate();
}
Here is the caller graph for this function:

◆ GameInitialize()

void Sly::GameInitialize ( )
private

Game initialize, window and engine modifications to be defined by the user.

this->setWindowName("Sly Engine");
this->setWidthHeight(800, 600);
this->SetClearColor(0.4f, 0.4f, 0.8f, 1.0f);
}
Here is the caller graph for this function:

◆ GetHeight()

static int Sly::GetHeight ( )
inlinestatic

Gets the window height.

Returns
The height.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetTime()

static float Sly::GetTime ( )
inlinestaticprivate

Gets the time.

To be used by internal processes. Specifically, passes current time info to the TimeManager. Not user accessible, all calls for time should be routed through the TimeManager.

Returns
The time.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetWidth()

static int Sly::GetWidth ( )
inlinestatic

Gets the window width.

Returns
The width.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Initialize()

void Sly::Initialize ( )
privatevirtual

Engine initialization. Setups up various managers.

Here is the call graph for this function:

◆ Instance()

static Sly & Sly::Instance ( )
inlinestaticprivate

Gets the instance.

Returns
A reference to a Sly.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadAllResources()

void Sly::LoadAllResources ( )
private

User defined LoadResources. Content to be defined by the user. Typically models, textures, and shaders are loaded here.

// Models
ModelManager::Load("Axis", "Axis.azul");
ModelManager::Load("Plane", "Plane.azul");
// Textures
TextureManager::Load("Space_Frigate", "space_frigate.tga");
TextureManager::Load("red", 'F', '0', '0', 'F');
// Shaders
ShaderManager::Load("TextureFlatRender", "textureFlatRender");
ShaderManager::Load("TextureLightRender", "textureLightRender");
}
Here is the caller graph for this function:

◆ LoadContent()

void Sly::LoadContent ( )
privatevirtual

Loads engine starting content. Loads first scene.

Here is the call graph for this function:

◆ operator=() [1/2]

Sly& Sly::operator= ( const Sly )
privatedelete

Assignment operator.

◆ operator=() [2/2]

Sly& Sly::operator= ( Sly &&  )
privatedelete

Move assignment operator.

◆ privGetHeight()

int Sly::privGetHeight ( )
private

Internal get height, pulls height from Azul framework.

Returns
An int.
Here is the caller graph for this function:

◆ privGetTime()

float Sly::privGetTime ( )
private

Gets internal time.

Accesses the Azul framework to retrieve the time.

Returns
The time.
Here is the caller graph for this function:

◆ privGetWidth()

int Sly::privGetWidth ( )
private

Internal get width, pulls width from Azul framework.

Returns
An int.
Here is the caller graph for this function:

◆ privSetClear()

void Sly::privSetClear ( float  r,
float  g,
float  b,
float  a 
)
private

Internal set clear. Passes values to Azul framework.

Parameters
rA float to process.
gA float to process.
bA float to process.
aA float to process.
Here is the caller graph for this function:

◆ privSetWidthHeight()

void Sly::privSetWidthHeight ( int  w,
int  h 
)
private

Internal set Width and Height, passes values to Azul framework.

Parameters
wThe width.
hThe height.
Here is the caller graph for this function:

◆ privSetWindowName()

void Sly::privSetWindowName ( const char *  name)
private

Internal set window name. Passes this info to the Azul framework.

Parameters
nameThe name.

◆ Run()

static void Sly::Run ( )
static

Kick starts the engine. Begins by loading the framework followed by initializing the Sly Engine.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetClear()

static void Sly::SetClear ( float  r,
float  g,
float  b,
float  a 
)
inlinestatic

Sets the color to clear the screen with.

Parameters
rred.
ggreen.
bblue.
aalpha.
Here is the call graph for this function:

◆ SetWidthHeight()

static void Sly::SetWidthHeight ( int  w,
int  h 
)
inlinestatic

Sets width and height of the main window.

Parameters
wThe width.
hThe height.
Here is the call graph for this function:

◆ SetWindowName()

static void Sly::SetWindowName ( const char *  name)
inlinestatic

Sets window name.

Parameters
nameThe name of the window.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ UnLoadContent()

void Sly::UnLoadContent ( )
privatevirtual

Cleans up engine content.

Here is the call graph for this function:

◆ Update()

void Sly::Update ( )
privatevirtual

Main update loop.

Here is the call graph for this function:

Friends And Related Function Documentation

◆ SlyAttorney

friend class SlyAttorney
friend

Member Data Documentation

◆ ptrInstance

Sly * Sly::ptrInstance = nullptr
staticprivate

The documentation for this class was generated from the following files:
Sly::GameEnd
void GameEnd()
Game end, to be defined by the user. Typically used for cleaning up memory.
ShaderManager::Load
static void Load(std::string key, const char *path)
Loads the specified shader.
Definition: ShaderManager.h:104
Sly::GameInitialize
void GameInitialize()
Game initialize, window and engine modifications to be defined by the user.
TextureManager::Load
static void Load(std::string key, const char *path)
Loads the texture.
Definition: TextureManager.h:107
ModelManager::Load
static void Load(std::string key, const char *path)
Loads.
Definition: ModelManager.h:123
Sly::LoadAllResources
void LoadAllResources()
User defined LoadResources. Content to be defined by the user. Typically models, textures,...