Table of Contents

Class Window

Namespace
Stride.Graphics.SDL
Assembly
Stride.Graphics.dll
public class Window : IDisposable
Inheritance
Window
Implements
Derived
Extension Methods

Constructors

Window(string)

Initializes a new instance of the Window class with title as the title of the Window.

public Window(string title)

Parameters

title string

Title of the window, see Text property.

Window(string, nint)

Initializes a new instance of the Window class with title as the title of the Window.

public Window(string title, nint parent)

Parameters

title string

Title of the window, see Text property.

parent nint

Parent window handle

Fields

SDL

public static Sdl SDL

Field Value

Sdl

Properties

ClientRectangle

Size of client area expressed as a rectangle.

public Rectangle ClientRectangle { get; set; }

Property Value

Rectangle

ClientSize

Size of the client area of a window.

public Size2 ClientSize { get; set; }

Property Value

Size2

Display

Display of current Window (valid only for Unix for X11).

public nint Display { get; }

Property Value

nint

Exists

Is the Window still alive?

public bool Exists { get; }

Property Value

bool

Focused

Is current window focused?

public bool Focused { get; }

Property Value

bool

FormBorderStyle

Style of border. Currently can only be Sizable or FixedSingle.

public FormBorderStyle FormBorderStyle { get; set; }

Property Value

FormBorderStyle

FullscreenIsBorderlessWindow

Gets or sets a value indicating whether fullscreen mode should be a borderless window matching the desktop size. Decides whether to set the SDL_WINDOW_FULLSCREEN_DESKTOP (fake fullscreen) or SDL_WINDOW_FULLSCREEN (real fullscreen) flag.

public bool FullscreenIsBorderlessWindow { get; set; }

Property Value

bool

Handle

Platform specific handle for Window.

public nint Handle { get; }

Property Value

nint

Remarks

  • On Windows: the HWND of the window
  • On Unix: the Window ID (XID). Note that on Unix, the value is 32-bit (See X11/X.h for the typedef of XID).

IsDisposed

Have we already disposed of the current object?

public bool IsDisposed { get; }

Property Value

bool

IsFullScreen

Are we showing the window in full screen mode?

public bool IsFullScreen { get; set; }

Property Value

bool

Location

Coordinates of the top-left corner of the window in screen coordinate.

public Point Location { get; set; }

Property Value

Point

MaximizeBox

Does current window offer a maximize button?

public bool MaximizeBox { get; set; }

Property Value

bool

Remarks

Setter is not implemented on SDL, since we do have callers, for the time being, the code does nothing instead of throwing an exception.

MinimizeOnFocusLoss

Minimize the window when focus is lost in fullscreen, default is false.

public bool MinimizeOnFocusLoss { get; set; }

Property Value

bool

MousePosition

Get the mouse position on screen.

public static Point MousePosition { get; }

Property Value

Point

RelativeCursorPosition

Get the coordinate of the mouse in Window coordinates

public Point RelativeCursorPosition { get; set; }

Property Value

Point

SdlHandle

The SDL window handle.

public nint SdlHandle { get; }

Property Value

nint

Size

Size of window.

public Size2 Size { get; set; }

Property Value

Size2

Surface

Surface of current Window (valid only for Android).

public nint Surface { get; }

Property Value

nint

Text

Text of the title of the Window.

public string Text { get; set; }

Property Value

string

TopMost

Make the window topmost

public bool TopMost { get; set; }

Property Value

bool

Visible

Is current window visible?

public bool Visible { get; set; }

Property Value

bool

WindowState

State of the window which can be either of Normal, Maximized or Minimized.

public FormWindowState WindowState { get; set; }

Property Value

FormWindowState

Methods

BringToFront()

Move window to front.

public virtual void BringToFront()

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Dispose(bool)

Dispose of current Window.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

If false we are being called from the Finalizer.

~Window()

protected ~Window()

ProcessEvent(Event)

Process events for the current window

public virtual void ProcessEvent(Event e)

Parameters

e Event

SendToBack()

Move window to back.

public virtual void SendToBack()

SetRelativeMouseMode(bool)

public void SetRelativeMouseMode(bool enabled)

Parameters

enabled bool

Show()

Show window. The first time a window is shown we execute any actions from 'HandleCreated' />.

public void Show()

Events

ActivateActions

public event Window.WindowEventDelegate ActivateActions

Event Type

Window.WindowEventDelegate

CloseActions

public event Window.NotificationDelegate CloseActions

Event Type

Window.NotificationDelegate

DeActivateActions

public event Window.WindowEventDelegate DeActivateActions

Event Type

Window.WindowEventDelegate

Disposed

Actions to be called when we dispose of current.

public event EventHandler Disposed

Event Type

EventHandler

DropFileActions

public event Window.DropEventDelegate DropFileActions

Event Type

Window.DropEventDelegate

FingerMoveActions

public event Window.TouchFingerDelegate FingerMoveActions

Event Type

Window.TouchFingerDelegate

FingerPressActions

public event Window.TouchFingerDelegate FingerPressActions

Event Type

Window.TouchFingerDelegate

FingerReleaseActions

public event Window.TouchFingerDelegate FingerReleaseActions

Event Type

Window.TouchFingerDelegate

FocusGainedActions

public event Window.WindowEventDelegate FocusGainedActions

Event Type

Window.WindowEventDelegate

FocusLostActions

public event Window.WindowEventDelegate FocusLostActions

Event Type

Window.WindowEventDelegate

JoystickDeviceAdded

public event Window.JoystickDeviceChangedDelegate JoystickDeviceAdded

Event Type

Window.JoystickDeviceChangedDelegate

JoystickDeviceRemoved

public event Window.JoystickDeviceChangedDelegate JoystickDeviceRemoved

Event Type

Window.JoystickDeviceChangedDelegate

KeyDownActions

public event Window.KeyDelegate KeyDownActions

Event Type

Window.KeyDelegate

KeyUpActions

public event Window.KeyDelegate KeyUpActions

Event Type

Window.KeyDelegate

MaximizedActions

public event Window.WindowEventDelegate MaximizedActions

Event Type

Window.WindowEventDelegate

MinimizedActions

public event Window.WindowEventDelegate MinimizedActions

Event Type

Window.WindowEventDelegate

MouseEnterActions

public event Window.WindowEventDelegate MouseEnterActions

Event Type

Window.WindowEventDelegate

MouseLeaveActions

public event Window.WindowEventDelegate MouseLeaveActions

Event Type

Window.WindowEventDelegate

MouseMoveActions

public event Window.MouseMoveDelegate MouseMoveActions

Event Type

Window.MouseMoveDelegate

MouseWheelActions

public event Window.MouseWheelDelegate MouseWheelActions

Event Type

Window.MouseWheelDelegate

PointerButtonPressActions

public event Window.MouseButtonDelegate PointerButtonPressActions

Event Type

Window.MouseButtonDelegate

PointerButtonReleaseActions

public event Window.MouseButtonDelegate PointerButtonReleaseActions

Event Type

Window.MouseButtonDelegate

ResizeBeginActions

public event Window.WindowEventDelegate ResizeBeginActions

Event Type

Window.WindowEventDelegate

ResizeEndActions

public event Window.WindowEventDelegate ResizeEndActions

Event Type

Window.WindowEventDelegate

RestoredActions

public event Window.WindowEventDelegate RestoredActions

Event Type

Window.WindowEventDelegate

TextEditingActions

public event Window.TextEditingDelegate TextEditingActions

Event Type

Window.TextEditingDelegate

TextInputActions

public event Window.TextInputDelegate TextInputActions

Event Type

Window.TextInputDelegate