Class GraphicsWindow
Represents an OverlayWindow which is used to draw at any given frame rate.
Implements
Inherited Members
Namespace: GameOverlay.Windows
Assembly: GameOverlay.dll
Syntax
public class GraphicsWindow : OverlayWindow, IDisposable
Constructors
| Improve this Doc View SourceGraphicsWindow(Graphics)
Initializes a new GraphicsWindow.
Declaration
public GraphicsWindow(Graphics device = null)
Parameters
Type | Name | Description |
---|---|---|
Graphics | device | Optionally specify a Graphics device to use. |
GraphicsWindow(Int32, Int32, Int32, Int32, Graphics)
Initializes a new GraphicsWindow with the specified window position and size.
Declaration
public GraphicsWindow(int x, int y, int width, int height, Graphics device = null)
Parameters
Type | Name | Description |
---|---|---|
Int32 | x | The window position on the X-Axis. |
Int32 | y | The window position on the Y-Axis. |
Int32 | width | The width of the window. |
Int32 | height | The height of the window. |
Graphics | device | Optionally specify a Graphics device to use. |
Properties
| Improve this Doc View SourceFPS
Gets or sets the frames per second (frame rate) at which this instance invokes its DrawGraphics event.
Declaration
public int FPS { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Graphics
Gets or sets the used Graphics surface.
Declaration
public Graphics Graphics { get; }
Property Value
Type | Description |
---|---|
Graphics |
IsPaused
Gets or sets a Boolean which determines whether this instance is paused.
Declaration
public bool IsPaused { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
IsRunning
Gets or sets a Boolean which determines whether this instance is running.
Declaration
public bool IsRunning { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
| Improve this Doc View SourceCreate()
Setup and initializes the window.
Declaration
public override void Create()
Overrides
| Improve this Doc View SourceDispose(Boolean)
Releases all resources used by this GraphicsWindow.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
Boolean | disposing | A Boolean value indicating whether this is called from the destructor. |
Overrides
| Improve this Doc View SourceFinalize()
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
Declaration
protected void Finalize()
Join()
Waits until the Thread used by this instance has exited.
Declaration
public override void Join()
Overrides
| Improve this Doc View SourceOnDestroyGraphics(Graphics)
Gets called when the graphics thread destorys the Graphics surface.
Declaration
protected virtual void OnDestroyGraphics(Graphics graphics)
Parameters
Type | Name | Description |
---|---|---|
Graphics | graphics | A Graphics surface. |
OnDrawGraphics(Int32, Int64, Int64)
Gets called when the graphics thread needs to render a new Scene / frame.
Declaration
protected virtual void OnDrawGraphics(int frameCount, long frameTime, long deltaTime)
Parameters
Type | Name | Description |
---|---|---|
Int32 | frameCount | The number of the currently rendered frame. Starting at 1. |
Int64 | frameTime | The current time in milliseconds. |
Int64 | deltaTime | The elapsed time in milliseconds since the last frame. |
OnSetupGraphics(Graphics)
Gets called when the graphics thread setups the Graphics surface.
Declaration
protected virtual void OnSetupGraphics(Graphics graphics)
Parameters
Type | Name | Description |
---|---|---|
Graphics | graphics | A Graphics surface. |
OnSizeChanged(Int32, Int32)
Gets called whenever the size of the window changes.
Declaration
protected override void OnSizeChanged(int width, int height)
Parameters
Type | Name | Description |
---|---|---|
Int32 | width | The new width of the window. |
Int32 | height | The new height of the window. |
Overrides
| Improve this Doc View SourceOnVisibilityChanged(Boolean)
Gets called whenever the visibility of the window changes.
Declaration
protected override void OnVisibilityChanged(bool isVisible)
Parameters
Type | Name | Description |
---|---|---|
Boolean | isVisible | A Boolean indicating the new visibility of the window. |
Overrides
| Improve this Doc View SourcePause()
Pauses the graphics thread.
Declaration
public void Pause()
Unpause()
Resumes the graphics thread.
Declaration
public void Unpause()
Events
| Improve this Doc View SourceDestroyGraphics
Fires when you should free any resources used for drawing with this instance.
Declaration
public event EventHandler<DestroyGraphicsEventArgs> DestroyGraphics
Event Type
Type | Description |
---|---|
EventHandler<DestroyGraphicsEventArgs> |
DrawGraphics
Fires when a new Scene / frame needs to be rendered.
Declaration
public event EventHandler<DrawGraphicsEventArgs> DrawGraphics
Event Type
Type | Description |
---|---|
EventHandler<DrawGraphicsEventArgs> |
SetupGraphics
Fires when you should allocate any resources you use to draw using this instance.
Declaration
public event EventHandler<SetupGraphicsEventArgs> SetupGraphics
Event Type
Type | Description |
---|---|
EventHandler<SetupGraphicsEventArgs> |