Nameless Engine
|
#include <ShaderArrayIndexManager.h>
Classes | |
struct | InternalData |
Public Member Functions | |
ShaderArrayIndexManager (const std::string &sName, unsigned int iArraySize) | |
~ShaderArrayIndexManager () | |
std::unique_ptr< ShaderArrayIndex > | reserveIndex () |
Private Member Functions | |
void | onIndexNoLongerUsed (unsigned int iIndex) |
Private Attributes | |
std::pair< std::recursive_mutex, InternalData > | mtxData |
const unsigned int | iArraySize = 0 |
const std::string | sName |
Friends | |
class | ShaderArrayIndex |
Controls and provides indices into shader arrays (defined in shaders).
ne::ShaderArrayIndexManager::ShaderArrayIndexManager | ( | const std::string & | sName, |
unsigned int | iArraySize | ||
) |
Constructs a new index manager.
sName | Name of the manager (used for logging). It's recommended to not only specify the shader resource name (that this manager is handling) but also some additional information if possible. |
iArraySize | Specified to mark the maximum possible number of elements in the array, if reached a warning will be logged. |
ne::ShaderArrayIndexManager::~ShaderArrayIndexManager | ( | ) |
Makes sure there are no active indices in use.
|
private |
Called by index objects in their destructor to notify that an index is no longer used.
iIndex | Index that's no longer being used. |
std::unique_ptr< ShaderArrayIndex > ne::ShaderArrayIndexManager::reserveIndex | ( | ) |
Returns a new (unused) index into the shader array that this manager is handling.
|
private |
Optional parameter that could be specified during creation to mark the maximum possible number of elements in the array.
|
private |
Internal data.
|
private |
Name of the manager (used for logging).