Click or drag to resize
DigitalRuneRenderTargetPool Class
Manages a pool of reusable render targets.
Inheritance Hierarchy
SystemObject
  DigitalRune.GraphicsRenderTargetPool

Namespace: DigitalRune.Graphics
Assembly: DigitalRune.Graphics (in DigitalRune.Graphics.dll) Version: 1.2.0.0 (1.2.1.14562)
Syntax
public class RenderTargetPool : IDisposable

The RenderTargetPool type exposes the following members.

Constructors
  NameDescription
Public methodRenderTargetPool
Initializes a new instance of the RenderTargetPool class.
Top
Methods
  NameDescription
Public methodClear
Removes all cached render targets.
Public methodDispose
Releases all resources used by an instance of the RenderTargetPool class.
Protected methodDispose(Boolean)
Releases the unmanaged resources used by an instance of the RenderTargetPool class and optionally releases the managed resources.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodObtain2D
Obtains a 2D render target that matches the given specification.
Public methodObtainCube
Obtains a cube map render target that matches the given specification.
Public methodRecycle(RenderTarget2D)
Releases a render target and puts it back into the pool for future reuse.
Public methodRecycle(RenderTargetCube)
Releases a render target and puts it back into the pool for future reuse.
Public methodRecycle(Texture)
Releases a render target and puts it back into the pool for future reuse.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUpdate
Manages the cached render targets.
Top
Properties
  NameDescription
Public propertyEnabled
Gets or sets a value indicating whether render target pooling is enabled.
Public propertyFrameLimit
Gets or sets the number of frames a recycled render target will be cached before it is released.
Public propertyGraphicsService
Gets the graphics service.
Top
Remarks

This class manages a list of render targets. To get a render target call the Obtain2D or ObtainCube method. After the render target is not needed any more call Recycle. Once per frame, Update must be called. This method updates internal render target usage data and removes render targets which have not been used for a while (see property FrameLimit). Clear should be called when the graphics settings of the game have changed, e.g. when the size of the back buffer is changed, or at certain events, e.g. when a new level is loaded.

Thread-Safety: This class is not thread-safe.

See Also