GraphicsScreen Class |
Namespace: DigitalRune.Graphics
The GraphicsScreen type exposes the following members.
Name | Description | |
---|---|---|
GraphicsScreen |
Initializes a new instance of the GraphicsScreen class.
|
Name | Description | |
---|---|---|
Equals | (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
OnRender |
Called when Render(RenderContext) is called.
| |
OnUpdate |
Called when Update(TimeSpan) is called.
| |
Render |
Renders the graphics screen.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
Update |
Updates the state of the graphics screen.
|
Name | Description | |
---|---|---|
Coverage |
Gets or sets a value indicating whether the screen covers the entire view or only a part of
it.
| |
GraphicsService |
Gets the graphics service.
| |
IsVisible |
Gets or sets a value indicating whether this instance is visible.
| |
Name |
Gets or sets the name of this graphics screen.
| |
RenderPreviousScreensToTexture |
Gets or sets a value indicating whether the previous graphics screens should render into an
off-screen render target.
| |
SourceTextureFormat |
Gets or sets the source texture format.
|
A graphics screen represents a layer in a 3D application. Multiple screens might be stacked on one another, for example:
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.