souleng
Game engine providing full Python scripting support
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
ResourceManager Struct Reference

Singleton class which stores and manages resources like fonts and images. More...

#include <ResourceManager.hpp>

Public Member Functions

std::shared_ptr< SDL_Texture > LoadTexture (std::string filepath)
 
std::shared_ptr< TTF_Font > LoadFont (std::string filepath, int ptsize)
 

Static Public Member Functions

static ResourceManagerinstance ()
 Singleton accessor.
 

Detailed Description

Singleton class which stores and manages resources like fonts and images.

Member Function Documentation

◆ LoadFont()

std::shared_ptr< TTF_Font > ResourceManager::LoadFont ( std::string filepath,
int ptsize )
inline

Loads a font from disk into a TTF_Font.

Parameters
filepathThe name of the font file to load
ptsizeThe desired font size
Returns
Shared pointer to the loaded font

◆ LoadTexture()

std::shared_ptr< SDL_Texture > ResourceManager::LoadTexture ( std::string filepath)
inline

Loads an image from disk into an SDL_Texture. Will load any image type supported by SDL_image.h

Parameters
filepathThe name of the image file to load
Returns
Shared pointer to the loaded texture

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