Class GameWindow
An abstract window.
public abstract class GameWindow : ComponentBase, IDisposable, IComponent, IReferencable, ICollectorHolder
- Inheritance
-
GameWindow
- Implements
- Derived
- Inherited Members
- Extension Methods
Fields
IsActivated
Indicate if the window is currently activated.
public bool IsActivated
Field Value
Properties
AllowUserResizing
Gets or sets, user possibility to resize this window.
public abstract bool AllowUserResizing { get; set; }
Property Value
ClientBounds
Gets the client bounds.
public abstract Rectangle ClientBounds { get; }
Property Value
- Rectangle
The client bounds.
CurrentOrientation
Gets the current orientation.
public abstract DisplayOrientation CurrentOrientation { get; }
Property Value
- DisplayOrientation
The current orientation.
Focused
Gets a value indicating whether this instance is in focus.
public abstract bool Focused { get; }
Property Value
- bool
true
if this instance is in focus; otherwise,false
.
FullscreenIsBorderlessWindow
Whether the fullscreen mode should be a borderless window matching the desktop size.
public bool FullscreenIsBorderlessWindow { get; set; }
Property Value
Remarks
This flag is currently ignored on all game platforms other than SDL.
IsBorderLess
Gets or sets a value indicating whether this window has a border
public abstract bool IsBorderLess { get; set; }
Property Value
- bool
true
if this window has a border; otherwise,false
.
IsFullscreen
Switches between fullscreen and windowed mode.
public bool IsFullscreen { get; set; }
Property Value
IsMinimized
Gets a value indicating whether this instance is minimized.
public abstract bool IsMinimized { get; }
Property Value
- bool
true
if this instance is minimized; otherwise,false
.
IsMouseVisible
Gets or sets a value indicating whether the mouse pointer is visible over this window.
public abstract bool IsMouseVisible { get; set; }
Property Value
- bool
true
if this instance is mouse visible; otherwise,false
.
NativeWindow
Gets the native window.
public abstract WindowHandle NativeWindow { get; }
Property Value
- WindowHandle
The native window.
Position
Gets or sets the position of the window on the screen.
public virtual Int2 Position { get; set; }
Property Value
PreferredFullscreenSize
The size the window should have when switching from windowed to fullscreen mode. To get the current actual size use ClientBounds.
public Int2 PreferredFullscreenSize { get; set; }
Property Value
PreferredWindowedSize
The size the window should have when switching from fullscreen to windowed mode. To get the current actual size use ClientBounds. This gets overwritten when the user resizes the window.
public Int2 PreferredWindowedSize { get; set; }
Property Value
Title
Gets or sets the title of the window.
public string Title { get; set; }
Property Value
Visible
Gets or sets a value indicating whether this GameWindow is visible.
public abstract bool Visible { get; set; }
Property Value
- bool
true
if visible; otherwise,false
.
Methods
BeginScreenDeviceChange(bool)
public abstract void BeginScreenDeviceChange(bool willBeFullScreen)
Parameters
willBeFullScreen
bool
CreateUserManagedMessageLoop()
public virtual IMessageLoop CreateUserManagedMessageLoop()
Returns
EndScreenDeviceChange()
public void EndScreenDeviceChange()
EndScreenDeviceChange(int, int)
public abstract void EndScreenDeviceChange(int clientWidth, int clientHeight)
Parameters
Initialize(GameContext)
protected abstract void Initialize(GameContext gameContext)
Parameters
gameContext
GameContext
OnActivated(object, EventArgs)
protected void OnActivated(object source, EventArgs e)
Parameters
OnClientSizeChanged(object, EventArgs)
protected void OnClientSizeChanged(object source, EventArgs e)
Parameters
OnClosing(object, EventArgs)
protected void OnClosing(object source, EventArgs e)
Parameters
OnDeactivated(object, EventArgs)
protected void OnDeactivated(object source, EventArgs e)
Parameters
OnDisableFullScreen(object, EventArgs)
protected void OnDisableFullScreen(object source, EventArgs e)
Parameters
OnFullscreenToggle(object, EventArgs)
protected void OnFullscreenToggle(object source, EventArgs e)
Parameters
OnOrientationChanged(object, EventArgs)
protected void OnOrientationChanged(object source, EventArgs e)
Parameters
SetSize(Int2)
Sets the size of the client area and triggers the ClientSizeChanged event. This will trigger a backbuffer resize too.
public void SetSize(Int2 size)
Parameters
size
Int2
SetSupportedOrientations(DisplayOrientation)
protected abstract void SetSupportedOrientations(DisplayOrientation orientations)
Parameters
orientations
DisplayOrientation
SetTitle(string)
protected abstract void SetTitle(string title)
Parameters
title
string
Events
Activated
Occurs when this window is activated.
public event EventHandler<EventArgs> Activated
Event Type
ClientSizeChanged
Occurs when device client size is changed.
public event EventHandler<EventArgs> ClientSizeChanged
Event Type
Closing
Occurs before the window gets destroyed.
public event EventHandler<EventArgs> Closing
Event Type
Deactivated
Occurs when this window is deactivated.
public event EventHandler<EventArgs> Deactivated
Event Type
FullscreenChanged
Occurs when device fullscreen mode is changed.
public event EventHandler<EventArgs> FullscreenChanged
Event Type
OrientationChanged
Occurs when device orientation is changed.
public event EventHandler<EventArgs> OrientationChanged