Polygon Dash
Loading...
Searching...
No Matches
ResourceManager Struct Reference

Handle all loading of assets. More...

Public Member Functions

 ~this ()
 Destroy assets stored in memory when the ResourceManager is destroyed.
 

Static Public Member Functions

static ResourceManagerGetInstance ()
 Return a static instance of ResourceManager for global use.
 
static SDL_Texture * LoadTexture (SDL_Renderer *renderer, string filename)
 Load an image texture from a file path.
 
static TTF_Font * LoadFont (string fontPath, int fontSize)
 Load a font from a file path.
 
static ref Random GetRNG ()
 Load a randomness generator.
 

Detailed Description

Handle all loading of assets.

Member Function Documentation

◆ GetInstance()

static ResourceManager * ResourceManager::GetInstance ( )
inlinestatic

Return a static instance of ResourceManager for global use.

Returns
the global ResourceManager.

◆ GetRNG()

static ref Random ResourceManager::GetRNG ( )
inlinestatic

Load a randomness generator.

Returns
the randomness generator.

◆ LoadFont()

static TTF_Font * ResourceManager::LoadFont ( string fontPath,
int fontSize )
inlinestatic

Load a font from a file path.

Parameters
fontPaththe file path to the .ttf file.
fontSizethe font size to load.
Returns
a loaded SDL font pointer.

◆ LoadTexture()

static SDL_Texture * ResourceManager::LoadTexture ( SDL_Renderer * renderer,
string filename )
inlinestatic

Load an image texture from a file path.

Parameters
rendererthe SDL renderer.
filenamethe file path to the .bmp file.
Returns
a loaded SDL texture pointer.

The documentation for this struct was generated from the following file: