Click or drag to resize
DigitalRuneGraphicsScreen Class
Provides the base class for graphics screens, which implement the rendering pipeline and draw game content.
Inheritance Hierarchy

Namespace: DigitalRune.Graphics
Assembly: DigitalRune.Graphics (in DigitalRune.Graphics.dll) Version: 1.2.0.0 (1.2.1.14562)
Syntax
public abstract class GraphicsScreen : INamedObject

The GraphicsScreen type exposes the following members.

Constructors
  NameDescription
Protected methodGraphicsScreen
Initializes a new instance of the GraphicsScreen class.
Top
Methods
  NameDescription
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.)
Protected methodOnRender
Called when Render(RenderContext) is called.
Protected methodOnUpdate
Called when Update(TimeSpan) is called.
Public methodRender
Renders the graphics screen.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUpdate
Updates the state of the graphics screen.
Top
Properties
  NameDescription
Public propertyCoverage
Gets or sets a value indicating whether the screen covers the entire view or only a part of it.
Public propertyGraphicsService
Gets the graphics service.
Public propertyIsVisible
Gets or sets a value indicating whether this instance is visible.
Public propertyName
Gets or sets the name of this graphics screen.
Public propertyRenderPreviousScreensToTexture
Gets or sets a value indicating whether the previous graphics screens should render into an off-screen render target.
Public propertySourceTextureFormat
Gets or sets the source texture format.
Top
Remarks

A graphics screen represents a layer in a 3D application. Multiple screens might be stacked on one another, for example:

  • The back (first) screen renders a 3D world.
  • In front of the first screen is another screen that renders the HUD.
  • In front of these layers is a graphics screen that renders a GUI. For example an "Options Dialog".

To display a graphics screen it must be added to a IGraphicsService (see property Screens). The graphics service renders screens back to front.

Each class that derives from GraphicsScreen can override the methods OnUpdate(TimeSpan) and OnRender(RenderContext). OnUpdate(TimeSpan) is usually called once per frame and the screen can update its internal state in this method. OnUpdate(TimeSpan) is called by the GraphicsManager in its Update(TimeSpan) method.

Each screen implements its own rendering pipeline by overriding OnRender(RenderContext). That means, a screen that renders a 3D world can implement a different render pipeline than a screen that draws the HUD or a GUI on top. Each graphics screen can use its own type of scene management. OnRender(RenderContext) is called by the GraphicsManager when one of its Render-methods is called. Special notes: If a screen is fully covered by another screen, the graphics service might not call OnRender(RenderContext). On the other hand, if the application has several IPresentationTargets, it can happen that OnRender(RenderContext) is called several times per frame.

OnUpdate(TimeSpan) and OnRender(RenderContext) are usually not called in a frame if the screen is invisible (e.g. if IsVisible is or if the screen is totally covered by another screen).

The property Coverage indicates whether a screen covers the entire view or whether a screen is partially transparent. The property needs to be set by each graphics screen depending on the content which is going to be rendered. The graphics service reads the property to determine which screens need to be rendered.

See Also