Space Fighter
A "shmup" game for Computer Programming C++
Loading...
Searching...
No Matches
KatanaEngine::ResourceManager Class Reference

Loads and manages the lifespan of objects from external files. More...

#include <ResourceManager.h>

Public Member Functions

 ResourceManager ()
 
void SetContentPath (const std::string &path)
 Sets the location of the folder where game resources are stored.
 
void UnloadAllResources ()
 Unloads all game resources.
 
template<typename T >
TLoad (const std::string &path, const bool cache=true, const bool appendContentPath=true)
 Load and manage a resource.
 

Detailed Description

Loads and manages the lifespan of objects from external files.

Definition at line 20 of file ResourceManager.h.

Constructor & Destructor Documentation

◆ ResourceManager()

KatanaEngine::ResourceManager::ResourceManager ( )
inline

Definition at line 25 of file ResourceManager.h.

Member Function Documentation

◆ Load()

template<typename T >
T * KatanaEngine::ResourceManager::Load ( const std::string & path,
const bool cache = true,
const bool appendContentPath = true )
inline

Load and manage a resource.

Parameters
pathThe path to the resource.
cacheSets whether the resource manager will manage the resource.
appendContentPathAllows the use of shorter paths when loading assets.
Remarks
Usually a game's content is kept in a single folder which is set by calling SetContentPath. This allows you to use shorter paths when loading assets. Occasionally a resource is outside of this folder and not using the content path is more convenient.

Definition at line 58 of file ResourceManager.h.

◆ SetContentPath()

void KatanaEngine::ResourceManager::SetContentPath ( const std::string & path)
inline

Sets the location of the folder where game resources are stored.

Parameters
pathThe file path to the content folder.

Definition at line 29 of file ResourceManager.h.

◆ UnloadAllResources()

void KatanaEngine::ResourceManager::UnloadAllResources ( )
inline

Unloads all game resources.

Definition at line 32 of file ResourceManager.h.


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