Diligent Engine API Reference
|
Facilitates resource mapping. More...
Public Member Functions | |
MapHelper () | |
Initializes the class member with null values. | |
MapHelper (IDeviceContext *pContext, IBuffer *pBuffer, MAP_TYPE MapType, Uint32 MapFlags) | |
Initializes the object and maps the provided resource. See Map() for details. | |
MapHelper (MapHelper &&Helper) | |
Move constructor: takes over resource ownership from Helper. | |
MapHelper & | operator= (MapHelper &&Helper) |
Move-assignement operator: takes over resource ownership from Helper. | |
void | Map (IDeviceContext *pContext, IBuffer *pBuffer, MAP_TYPE MapType, Uint32 MapFlags) |
Maps the provided resource. More... | |
void | Unmap () |
Unamps the resource and resets the object state to default. | |
operator DataType * () | |
Converts mapped data pointer to DataType*. | |
operator const DataType * () const | |
Converts mapped data pointer to const DataType*. | |
DataType * | operator-> () |
Operator -> | |
const DataType * | operator-> () const |
Operator const -> | |
~MapHelper () | |
Unamps the resource. | |
Facilitates resource mapping.
DataType | - type of the mapped data. |
This class is designed to automate resource mapping/unmapping process. The class automatically unmaps the resource when the class instance gets out of scope.
Usage example:
{ MapHelper<float> UniformData( pDeviceContext, pUniformBuff, MAP_WRITE_DISCARD, 0 ); UniformData[0] = UniformData[1] = UniformData[2] = UniformData[3] = 1; }
|
inline |
Maps the provided resource.
pContext | - Pointer to the device context to perform mapping with. |
pBuffer | - Pointer to the buffer interface to map. |
MapType | - Type of the map operation, see Diligent::MAP_TYPE for details. |
MapFlags | - Additional map flags, see Diligent::MAP_FLAGS. |