DXDevice |
public class DXDeviceResourcesCache : IDisposable
The DXDeviceResourcesCache type exposes the following members.
Name | Description | |
---|---|---|
AddDXMaterial | Adds the DXEngine's dxMaterial that was created from the WPF material to this DXDeviceResourcesCache. | |
AddDXMeshGeometry3D | Adds the DXEngine's DXMeshGeometry3D that was created from the WPF MeshGeometry3D to this DXDeviceResourcesCache. | |
Dispose | Dispose | |
GetDXDeviceResourcesCache | Returns the DXDeviceResourcesCache for the specified dxDevice or create a new cache if it was not yet created for the DXDevice. | |
RemoveDXMaterial | Removes the cached DXEngine's material for the specified WPF material. | |
RemoveDXMeshGeometry3D | Removes the cached DXEngine's DXMeshGeometry3D for the specified WPF MeshGeometry3D. | |
TryGetDXMaterial | Returns true and sets the dxMaterial parameter when the WPF material was cached in this DXDeviceResourcesCache. Otherwise returns false and sets dxMaterial to null. | |
TryGetDXMeshGeometry3D | Returns true and sets the dxMeshGeometry3D parameter when the WPF MeshGeometry3D was cached in this DXDeviceResourcesCache. Otherwise returns false and sets dxMeshGeometry3D to null. |
DXDeviceResourcesCache is used to store DXEngine's objects that are created from WPF objects.
This allows reusing DXEngine's objects when one instance of WPF object is used on multiple objects - for example one DiffuseMaterial can be used on many GeometryModel3D objects.
This class caches objects per DXDevice and is set to the DXDevice's ResourcesCache property.
To get an instance of the DXDeviceResourcesCache, call the static GetDXDeviceResourcesCache(DXDevice) method. It will get the DXDeviceResourcesCache for the specified dxDevice or create a new cache if it was not yet created.
The constructor of the class is protected to allow creating a derived classes.
This class is not thread safe. When DXEngine objects are created in multiple threads you need to synchronize access to this class with using lock. This is already done when this class is used in DXEngine.