Diligent Engine
 
Loading...
Searching...
No Matches
Diligent.IResourceMapping Struct Referenceabstract

Resource mapping. More...

#include <ResourceMapping.h>

Inheritance diagram for Diligent.IResourceMapping:
Diligent.IObject

Public Member Functions

virtual void DILIGENT_CALL_TYPE AddResource (const Char *Name, IDeviceObject *pObject, Bool bIsUnique)=0
 Adds a resource to the mapping.
 
virtual void DILIGENT_CALL_TYPE AddResourceArray (const Char *Name, Uint32 StartIndex, IDeviceObject *const *ppObjects, Uint32 NumElements, Bool bIsUnique)=0
 Adds resource array to the mapping.
 
virtual void DILIGENT_CALL_TYPE RemoveResourceByName (const Char *Name, Uint32 ArrayIndex=0)=0
 Removes a resource from the mapping using its literal name.
 
virtual IDeviceObject *DILIGENT_CALL_TYPE GetResource (const Char *Name, Uint32 ArrayIndex=0)=0
 Finds a resource in the mapping.
 
virtual size_t DILIGENT_CALL_TYPE GetSize ()=0
 Returns the size of the resource mapping, i.e. the number of objects.
 
- Public Member Functions inherited from Diligent.IObject
virtual void DILIGENT_CALL_TYPE QueryInterface (const INTERFACE_ID &IID, IObject **ppInterface)=0
 Queries the specific interface.
 
virtual ReferenceCounterValueType DILIGENT_CALL_TYPE AddRef ()=0
 Increments the number of strong references by 1.
 
virtual ReferenceCounterValueType DILIGENT_CALL_TYPE Release ()=0
 
virtual IReferenceCounters *DILIGENT_CALL_TYPE GetReferenceCounters () const =0
 

Detailed Description

Resource mapping.

This interface provides mapping between literal names and resource pointers. It is created by IRenderDevice::CreateResourceMapping().

Remarks
Resource mapping holds strong references to all objects it keeps.

Member Function Documentation

◆ AddResource()

virtual void DILIGENT_CALL_TYPE Diligent.IResourceMapping.AddResource ( const Char * Name,
IDeviceObject * pObject,
Bool bIsUnique )
pure virtual

Adds a resource to the mapping.

Parameters
[in]Name- Resource name.
[in]pObject- Pointer to the object.
[in]bIsUnique- Flag indicating if a resource with the same name is allowed to be found in the mapping. In the latter case, the new resource replaces the existing one.
Remarks
Resource mapping increases the reference counter for referenced objects. So an object will not be released as long as it is in the resource mapping.

◆ AddResourceArray()

virtual void DILIGENT_CALL_TYPE Diligent.IResourceMapping.AddResourceArray ( const Char * Name,
Uint32 StartIndex,
IDeviceObject *const * ppObjects,
Uint32 NumElements,
Bool bIsUnique )
pure virtual

Adds resource array to the mapping.

Parameters
[in]Name- Resource array name.
[in]StartIndex- First index in the array, where the first element will be inserted
[in]ppObjects- Pointer to the array of objects.
[in]NumElements- Number of elements to add
[in]bIsUnique- Flag indicating if a resource with the same name is allowed to be found in the mapping. In the latter case, the new resource replaces the existing one.
Remarks
Resource mapping increases the reference counter for referenced objects. So an object will not be released as long as it is in the resource mapping.

◆ GetResource()

virtual IDeviceObject *DILIGENT_CALL_TYPE Diligent.IResourceMapping.GetResource ( const Char * Name,
Uint32 ArrayIndex = 0 )
pure virtual

Finds a resource in the mapping.

Parameters
[in]Name- Resource name.
[in]ArrayIndex- for arrays, index of the array element.
Returns
Pointer to the object with the given name and array index.
Remarks
The method does NOT increase the reference counter of the returned object, so Release() must not be called. The pointer is guaranteed to be valid until the object is removed from the resource mapping, or the mapping is destroyed.

◆ RemoveResourceByName()

virtual void DILIGENT_CALL_TYPE Diligent.IResourceMapping.RemoveResourceByName ( const Char * Name,
Uint32 ArrayIndex = 0 )
pure virtual

Removes a resource from the mapping using its literal name.

Parameters
[in]Name- Name of the resource to remove.
[in]ArrayIndex- For array resources, index in the array