Skip to main content
Version: 1.0.0-preview.47

Velaptor.UI.Window

Velaptor​

Velaptor.UI​

Window Class​

A system window where graphics can be rendered.

public abstract class Window : Velaptor.UI.IWindow, System.IDisposable

Inheritance System.Object → Window

Implements IWindow, System.IDisposable

Properties​

AutoClearBuffer​

Gets or sets a value indicating whether the buffers should be automatically cleared before rendering any textures.

public bool AutoClearBuffer { get; set; }

Implements AutoClearBuffer

Property Value​

System.Boolean

Remarks​

If this is set to true, it means you do not have to use or invoke the Clear()() method.

Set to the value of false if you want more control when the back buffers will be cleared.

WARNING!! - To prevent performance issues, do not manually clear the buffer with the Clear()() method and set this property to true. That would be a waste of resources.

AutoSceneLoading​

Gets or sets a value indicating whether the scenes should be automatically loaded.

public bool AutoSceneLoading { get; set; }

Implements AutoSceneLoading

Property Value​

System.Boolean

AutoSceneRendering​

Gets or sets a value indicating whether the scenes should be automatically rendered.

public bool AutoSceneRendering { get; set; }

Implements AutoSceneRendering

Property Value​

System.Boolean

AutoSceneUnloading​

Gets or sets a value indicating whether the scenes should be automatically unloaded.

public bool AutoSceneUnloading { get; set; }

Implements AutoSceneUnloading

Property Value​

System.Boolean

AutoSceneUpdating​

Gets or sets a value indicating whether the scenes should be automatically updated.

public bool AutoSceneUpdating { get; set; }

Implements AutoSceneUpdating

Property Value​

System.Boolean

Draw​

Gets or sets the System.Action delegate that is invoked per frame for rendering.

public System.Action<Velaptor.FrameTime>? Draw { get; set; }

Implements Draw

Property Value​

System.Action<FrameTime>

Fps​

Gets the frames per second that the main loop is running at.

public float Fps { get; }

Implements Fps

Property Value​

System.Single

Height​

Gets or sets the height of the window.

public uint Height { get; set; }

Implements Height

Property Value​

System.UInt32

Initialize​

Gets or sets the System.Action delegate to be invoked one time to initialize the window.

public System.Action? Initialize { get; set; }

Implements Initialize

Property Value​

System.Action

Initialized​

Gets a value indicating whether the window has been initialized.

public bool Initialized { get; }

Implements Initialized

Property Value​

System.Boolean

MouseCursorVisible​

Gets or sets a value indicating whether the mouse cursor is visible.

public bool MouseCursorVisible { get; set; }

Implements MouseCursorVisible

Property Value​

System.Boolean

Position​

Gets or sets the position of the window.

public System.Numerics.Vector2 Position { get; set; }

Implements Position

Property Value​

System.Numerics.Vector2

SceneManager​

Gets the scene manager.

public Velaptor.Scene.ISceneManager SceneManager { get; }

Implements SceneManager

Property Value​

ISceneManager

Title​

Gets or sets the title of the window.

public string Title { get; set; }

Implements Title

Property Value​

System.String

TypeOfBorder​

Gets or sets the type of border that the IWindow will have.

public Velaptor.WindowBorder TypeOfBorder { get; set; }

Implements TypeOfBorder

Property Value​

WindowBorder

Uninitialize​

Gets or sets the System.Action delegate to be invoked one time to uninitialize the window.

public System.Action? Uninitialize { get; set; }

Implements Uninitialize

Property Value​

System.Action

Update​

Gets or sets the System.Action delegate that is invoked per frame for updating.

public System.Action<Velaptor.FrameTime>? Update { get; set; }

Implements Update

Property Value​

System.Action<FrameTime>

UpdateFrequency​

Gets or sets the value of how often the update and render calls are invoked in the value of hertz.

public int UpdateFrequency { get; set; }

Implements UpdateFrequency

Property Value​

System.Int32

Width​

Gets or sets the width of the window.

public uint Width { get; set; }

Implements Width

Property Value​

System.UInt32

WindowState​

Gets or sets the state of the window.

public Velaptor.StateOfWindow WindowState { get; set; }

Implements WindowState

Property Value​

StateOfWindow

WinResize​

Gets or sets the System.Action delegate that is invoked every time the window is resized.

public System.Action<Velaptor.SizeU>? WinResize { get; set; }

Implements WinResize

Property Value​

System.Action<SizeU>

Methods​

Close()​

Closes the window.

public void Close();

Implements Close()

Dispose()​

<inheritdoc cref="M:System.IDisposable.Dispose" />

public void Dispose();

Implements Dispose()

Show()​

Shows the window.

public void Show();

Implements Show()

ShowAsync(Action, Action)​

Shows the window asynchronously.

public System.Threading.Tasks.Task ShowAsync(System.Action? afterStart=null, System.Action? afterUnload=null);

Parameters​

afterStart System.Action

Executed after the application starts asynchronously.

afterUnload System.Action

Executed after the window has been unloaded.

Implements ShowAsync(Action, Action)

Returns​

System.Threading.Tasks.Task
A System.Threading.Tasks.Task representing the result of the asynchronous operation.

Remarks​

This runs the window on another thread.