Class GraphicsPresenter
Application graphics presenter.
Inheritance
Implements
Inherited Members
Namespace: Evergine.Framework.Services
Assembly: Evergine.Framework.dll
Syntax
public sealed class GraphicsPresenter : UpdatableService, IDependencyObject
Constructors
GraphicsPresenter()
Initializes a new instance of the GraphicsPresenter class.
Declaration
public GraphicsPresenter()
Fields
Displays
Gets the display settings of the application.
Declaration
public Dictionary<int, Display> Displays
Field Value
Type | Description |
---|---|
Dictionary<int, Display> |
Properties
CopyCommandQueue
Gets the Copy Command Queue.
Declaration
public CommandQueue CopyCommandQueue { get; }
Property Value
Type | Description |
---|---|
CommandQueue |
FocusedDisplay
Gets or sets the currently focused display.
Declaration
public Display FocusedDisplay { get; set; }
Property Value
Type | Description |
---|---|
Display |
GraphicsCommandQueue
Gets the graphics command queue.
Declaration
public CommandQueue GraphicsCommandQueue { get; }
Property Value
Type | Description |
---|---|
CommandQueue |
Methods
AddDisplay(string, Display)
Adds a new display.
Declaration
public int AddDisplay(string tag, Display display)
Parameters
Type | Name | Description |
---|---|---|
string | tag | The tag to reference the display. |
Display | display | The new display. |
Returns
Type | Description |
---|---|
int | Returns the display ID assigned to this display. |
InitFrame()
Initializes the frame to render on all displays.
Declaration
public void InitFrame()
OnAttached()
Invoked when the object is attached to the system.
Declaration
protected override bool OnAttached()
Returns
Type | Description |
---|---|
bool | True if everything is OK. |
Overrides
OnDetach()
Invoked when the object is detached.
Declaration
protected override void OnDetach()
Overrides
Prepare()
Prepares all displays to be drawn.
Declaration
public void Prepare()
Present()
Displays all active displays in the application.
Declaration
public void Present()
RemoveDisplay(int)
Removes display by id.
Declaration
public Display RemoveDisplay(int id)
Parameters
Type | Name | Description |
---|---|---|
int | id | Display ID. |
Returns
Type | Description |
---|---|
Display | The removed Display instance. Null if there is no Display with the given ID. |
RemoveDisplay(string)
Removes a display by tag.
Declaration
public Display RemoveDisplay(string tag)
Parameters
Type | Name | Description |
---|---|---|
string | tag | The display tag. |
Returns
Type | Description |
---|---|
Display | The removed Display instance. Null if there is no Display with the given tag. |
TryGetDisplay(int, out Display)
Gets the Display associated with the specified display index.
Declaration
public bool TryGetDisplay(int displayId, out Display display)
Parameters
Type | Name | Description |
---|---|---|
int | displayId | Display ID. |
Display | display | The display to return. |
Returns
Type | Description |
---|---|
bool | True if the display exists; otherwise, false. |
TryGetDisplay(string, out Display)
Gets the Display associated with the specified display index.
Declaration
public bool TryGetDisplay(string displayTag, out Display display)
Parameters
Type | Name | Description |
---|---|---|
string | displayTag | Display tag. |
Display | display | Returned Display. |
Returns
Type | Description |
---|---|
bool | True if the display exists; otherwise, false. |
TryGetDisplayId(string, out int)
Gets the display ID by its tag.
Declaration
public bool TryGetDisplayId(string displayTag, out int displayId)
Parameters
Type | Name | Description |
---|---|---|
string | displayTag | The display tag. |
int | displayId | The display ID. |
Returns
Type | Description |
---|---|
bool | True if a display with this tag exists. |
Update(TimeSpan)
Updates this instance.
Declaration
public override void Update(TimeSpan gameTime)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | gameTime | The elapsed game time since the last update. |
Overrides
Events
OnPresented
Event fired when all displays have been presented.
Declaration
public event EventHandler OnPresented
Event Type
Type | Description |
---|---|
EventHandler |