Click or drag to resize
DigitalRuneGraphicsManager Class
Manages graphics-related objects, like graphics screens and presentation targets, and graphics resources.
Inheritance Hierarchy
SystemObject
  DigitalRune.GraphicsGraphicsManager

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

The GraphicsManager type exposes the following members.

Constructors
  NameDescription
Public methodGraphicsManager(GraphicsDevice, ContentManager)
Initializes a new instance of the GraphicsManager class.
Public methodGraphicsManager(GraphicsDevice, GameWindow, ContentManager)
Initializes a new instance of the GraphicsManager class.
Top
Methods
  NameDescription
Protected methodCreateRenderContext
Creates a new render context.
Public methodDispose
Releases all resources used by an instance of the GraphicsManager class.
Protected methodDispose(Boolean)
Releases the unmanaged resources used by an instance of the GraphicsManager 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 methodPresent Obsolete.
Presents the current back buffer target into the specified presentation target. (Windows Forms only!)
Public methodRender(Boolean)
Renders the graphics screens to the back buffer.
Public methodRender(IPresentationTarget)
Renders the registered graphics screens into the given presentation target.
Public methodRender(IPresentationTarget, IListGraphicsScreen)
Renders the specified graphics screens into the given presentation target.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUpdate
Updates the graphics service and the registered graphics screens.
Top
Extension Methods
  NameDescription
Public Extension MethodGetCopyFilter
Gets a default CopyFilter that can be used to copy a texture into a render target.
(Defined by PostProcessHelper.)
Public Extension MethodGetDefaultNormalTexture
Gets a 1x1 normal map. The normal vector is (0, 0, 1).
(Defined by TextureHelper.)
Public Extension MethodGetDefaultTexture2DBlack
Gets a black 2D texture with 1x1 pixels.
(Defined by TextureHelper.)
Public Extension MethodGetDefaultTexture2DWhite
Gets a white 2D texture with 1x1 pixels.
(Defined by TextureHelper.)
Public Extension MethodGetDefaultTexture3DBlack
Gets a black 3D texture with 1x1 pixels.
(Defined by TextureHelper.)
Public Extension MethodGetDefaultTexture3DWhite
Gets a white 3D texture with 1x1 pixels.
(Defined by TextureHelper.)
Public Extension MethodGetDefaultTextureCubeBlack
Gets a cubemap texture where each face consists of 1 black pixel.
(Defined by TextureHelper.)
Public Extension MethodGetDefaultTextureCubeWhite
Gets a cubemap texture where each face consists of 1 white pixel.
(Defined by TextureHelper.)
Public Extension MethodGetDownsampleFilter
Gets a default DownsampleFilter that can be used to downsample an image into a low-resolution render target.
(Defined by PostProcessHelper.)
Public Extension MethodGetNormalsFittingTexture
Gets the normals fitting texture for calculating "best fit" normals.
(Defined by TextureHelper.)
Public Extension MethodGetSpriteBatch
Gets a shared SpriteBatch instance.
(Defined by GraphicsHelper.)
Top
Properties
  NameDescription
Public propertyContent
Gets the content manager that can be used to load predefined DigitalRune Graphics content (e.g. predefined shaders, post-processing effects, lookup textures, etc.).
Public propertyData
Gets custom data associated with this graphics service or the graphics device.
Public propertyDeltaTime
Gets the elapsed time since the last frame.
Public propertyEffectBinders
Gets or sets the effect binders.
Public propertyEffectInterpreters
Gets or sets the effect interpreters.
Public propertyFrame
Gets the number of the current frame.
Public propertyGameForm
Gets the main form (main window) of the Game.
Public propertyGraphicsDevice
Gets the graphics device.
Public propertyIsDisposed
Gets a value indicating whether this instance has been disposed of.
Public propertyPresentationTargets
A collection of all presentation targets.
Public propertyRenderTargetPool
Gets or sets the render target pool.
Public propertyScreens
Gets or sets the graphics screens.
Public propertyTime
Gets or sets the total elapsed time.
Top
Remarks

This class implements the IGraphicsService for a 3D application or game. (See also IGraphicsService for more information.)

The method Update(TimeSpan) must be called once per frame to update the graphics service and the registered graphics screens. The methods Render(Boolean) or Render(IPresentationTarget) must be called to render the screens. Render(Boolean) renders the screens to the back buffer; the XNA game will automatically display this back buffer in the game window.

The method Render(IPresentationTarget) or Render(IPresentationTarget, IListGraphicsScreen) can be used to display graphics in a Windows Forms or WPF application. These methods render the graphics screens into a presentation target. A presentation target (see interface IPresentationTarget) is a Windows Forms control or a WPF control where the graphics can be displayed.

Windows Forms: Windows Forms applications can host a FormsPresentationTarget. The methods Render(IPresentationTarget) or Render(IPresentationTarget, IListGraphicsScreen) can be used to render a scene into this presentation target. The method first renders the graphics screens into the back buffer and then displays the result in the specified presentation target. The method Present(IPresentationTarget) can be used to display the current back buffer content in a presentation target (without re-rendering the screens).

WPF: WPF applications can host an ElementPresentationTarget (legacy) or a D3DImagePresentationTarget (recommended, MonoGame only). The methods Render(IPresentationTarget) or Render(IPresentationTarget, IListGraphicsScreen) can be used to render a scene directly into a D3DImagePresentationTarget.

See Also