Table of Contents

Class Window

Namespace
LibGFX.Core
Assembly
LibGFX.dll

Represents a window for rendering graphics.

public class Window
Inheritance
Window
Inherited Members

Constructors

Window(string, Viewport, WindowState)

Creates a new window with the specified title, viewport, and window state.

public Window(string title, Viewport viewport, Window.WindowState windowState = WindowState.Normal)

Parameters

title string
viewport Viewport
windowState Window.WindowState

Methods

Close()

Closes the window.

public void Close()

GetContext()

Gets the window _context.

public IGLFWGraphicsContext GetContext()

Returns

IGLFWGraphicsContext

GetMousePosition()

Gets the current mouse position in the window.

public Vector2 GetMousePosition()

Returns

Vector2

GetViewport()

Gets the current window size.

public Viewport GetViewport()

Returns

Viewport

HideCursor()

Hides the mouse cursor.

public void HideCursor()

IsFocused()

Checks if the window is focused.

public bool IsFocused()

Returns

bool

IsKeyDown(Keys)

Checks if the specified key is down.

public bool IsKeyDown(Keys key)

Parameters

key Keys

Returns

bool

IsKeyPressed(Keys)

Checks if the specified key is pressed.

public bool IsKeyPressed(Keys key)

Parameters

key Keys

Returns

bool

IsMouseDown(MouseButton)

Checks if the specified mouse button is down.

public bool IsMouseDown(MouseButton button)

Parameters

button MouseButton

Returns

bool

IsMousePressed(MouseButton)

Checks if the specified mouse button is pressed.

public bool IsMousePressed(MouseButton button)

Parameters

button MouseButton

Returns

bool

IsMouseReleased(MouseButton)

Checks if the specified mouse button is released.

public bool IsMouseReleased(MouseButton button)

Parameters

button MouseButton

Returns

bool

ProcessEvents()

Processes the window events.

public void ProcessEvents()

RequestClose()

Requests to close the window.

public bool RequestClose()

Returns

bool

SetMousePosition(Vector2)

Sets the mouse position to the specified coordinates.

public void SetMousePosition(Vector2 position)

Parameters

position Vector2

SetMousePosition(float, float)

Sets the mouse position to the specified coordinates.

public void SetMousePosition(float x, float y)

Parameters

x float
y float

ShowCursor()

Shows the mouse cursor.

public void ShowCursor()