Wraith  0.1.5
Basic 3D game engine in C++
WraithEngine

The Wraith engine class is the core aspect of the program that runs everything. It also offers settings for the window display. More...

Collaboration diagram for WraithEngine:

Functions

static void Wraith::SetWindowName (const char *windowName)
 Sets window name. More...
 
static void Wraith::SetWindowWidthAndHeight (const int windowWidth, const int windowHeight)
 Sets window width and height. More...
 
static void Wraith::SetBackgroundColor (const float red, const float green, const float blue, const float alpha)
 Sets background color of the window. More...
 
static int Wraith::GetWindowWidth ()
 Gets window width. More...
 
static int Wraith::GetWindowHeight ()
 Gets window height. More...
 

Detailed Description

The Wraith engine class is the core aspect of the program that runs everything. It also offers settings for the window display.

Useful tool for users include functions to set the window dimensions (width and height), background color, and name for the window (All of which should be called in the GameInitialize.cpp file). Users can also access the window width and height.

Here is an example of how these tools are used: NOTE: You must include Wraith.h header file to acesss Wraith functions.

\\ in GameInitialize.cpp
#include "Wraith.h"
{
// Wraith Window Device setup
Wraith::SetWindowName("Wraith Engine");
Wraith::SetBackgroundColor(0.4f, 0.4f, 0.8f, 1.0f);
}
\\ in HUD.cpp (a user defined object)
#include "Wraith.h"
#include "Sprite.h"
HUD::HUD
{
_pHealthBarSprite = new Sprite("HealthBarImage");
// Here I want to set this HealthBarSprite to be in the top-center of the window.
// NOTE (0, 0) is the bottom left corner of the screen
float xPosition = (float) Wraith::GetWindowWidth() / 2.0f;
float yPosition = (float) Wraith::GetWindowHeight() - _pHealthSprite->getHeight();
_pHealthBarSprite->setPosition(xPosition, yPosition);
}
A sprite used to display 2D images.
Definition: Sprite.h:18
void gameInitialize()
User defined are for initializing the game.
static void SetBackgroundColor(const float red, const float green, const float blue, const float alpha)
Sets background color of the window.
Definition: Wraith.h:149
static void SetWindowName(const char *windowName)
Sets window name.
Definition: Wraith.h:121
static void SetWindowWidthAndHeight(const int windowWidth, const int windowHeight)
Sets window width and height.
Definition: Wraith.h:134
static int GetWindowHeight()
Gets window height.
Definition: Wraith.h:173
static int GetWindowWidth()
Gets window width.
Definition: Wraith.h:161

Function Documentation

◆ GetWindowHeight()

static int Wraith::GetWindowHeight ( )
inlinestatic

Gets window height.

Returns
The window height.

◆ GetWindowWidth()

static int Wraith::GetWindowWidth ( )
inlinestatic

Gets window width.

Returns
The window width.

◆ SetBackgroundColor()

static void Wraith::SetBackgroundColor ( const float  red,
const float  green,
const float  blue,
const float  alpha 
)
inlinestatic

Sets background color of the window.

Parameters
redThe red value.
greenThe green value.
blueThe blue value.
alphaThe alpha value.

◆ SetWindowName()

static void Wraith::SetWindowName ( const char *  windowName)
inlinestatic

Sets window name.

Steven, 2/27/2021.

Parameters
windowNameName of the window.

◆ SetWindowWidthAndHeight()

static void Wraith::SetWindowWidthAndHeight ( const int  windowWidth,
const int  windowHeight 
)
inlinestatic

Sets window width and height.

Parameters
windowWidthWidth of the window.
windowHeightHeight of the window.