Provides the base class for graphics screens, which implement the rendering pipeline and draw game content.

Namespace: DigitalRune.Graphics
Assembly: DigitalRune.Graphics (in DigitalRune.Graphics.dll) Version: 1.0.0.0 (1.0.0.9509)

Syntax

C#
public abstract class GraphicsScreen : INamedObject
Visual Basic
Public MustInherit Class GraphicsScreen _
	Implements INamedObject
Visual C++
public ref class GraphicsScreen abstract : INamedObject

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 falseFalsefalsefalse (False in Visual Basic) 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.

Inheritance Hierarchy

System..::..Object
  DigitalRune.Graphics..::..GraphicsScreen
    DigitalRune.Graphics..::..DelegateGraphicsScreen

See Also