Platformer
Platformer
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
RenderManager Class Reference

This class manages the rendering of images in our game as a singleton. More...

#include <RenderManager.hpp>

Collaboration diagram for RenderManager:
Collaboration graph

Public Member Functions

bool init (int screenWidth, int screenHeight)
 Initializes the render manager, SDL, and TTF, and creates the SDL_Window and SDL_Renderer. More...
 
void shutdown ()
 Shuts down the render manager, SDL, and TTF.
 
void Render ()
 Render the game.
 
 RenderManager (const RenderManager &)=delete
 Stop the compiler from generating methods to copy the object.
 
RenderManageroperator= (const RenderManager &)=delete
 Stop the compiler from generating methods to copy the object.
 

Static Public Member Functions

static RenderManagerinstance ()
 The singleton instance of the RenderManager.
 
static SDL_Renderer * GetRenderer ()
 Gets the SDL_Renderer. More...
 
static std::shared_ptr< CameraComponentGetCamera ()
 Gets the current active camera. More...
 
static void SetActiveCamera (std::shared_ptr< CameraComponent > camera)
 Sets the current active camera. More...
 
static int getWidth ()
 Gets the screen width. More...
 
static int getHeight ()
 Gets the screen height. More...
 

Private Member Functions

 RenderManager ()
 Constructs a RenderManager.
 
 ~RenderManager ()
 Destructs a RenderManager.
 

Private Attributes

int screenWidth_
 The width of the screen.
 
int screenHeight_
 The height of the screen.
 
SDL_Window * gWindow
 The window we'll be rendering to.
 
SDL_Renderer * gRenderer
 The SDL_Renderer for this instance.
 
std::shared_ptr< CameraComponentcamera_
 The Camera to use to render game objects.
 

Detailed Description

This class manages the rendering of images in our game as a singleton.

Member Function Documentation

◆ GetCamera()

std::shared_ptr< CameraComponent > RenderManager::GetCamera ( )
static

Gets the current active camera.

Returns
A shared pointer to the current active camera.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getHeight()

int RenderManager::getHeight ( )
static

Gets the screen height.

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

◆ GetRenderer()

SDL_Renderer * RenderManager::GetRenderer ( )
static

Gets the SDL_Renderer.

Returns
The SDL_Renderer
Here is the call graph for this function:

◆ getWidth()

int RenderManager::getWidth ( )
static

Gets the screen width.

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

◆ init()

bool RenderManager::init ( int  screenWidth,
int  screenHeight 
)

Initializes the render manager, SDL, and TTF, and creates the SDL_Window and SDL_Renderer.

Returns
Whether or not the RenderManager was properly initialized
Parameters
screenWidthThe width of the screen
screenHeightThe height of the screen

◆ SetActiveCamera()

void RenderManager::SetActiveCamera ( std::shared_ptr< CameraComponent camera)
static

Sets the current active camera.

Parameters
cameraThe camera to be set as the current active camera
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: