Class Window
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
titlestringviewportViewportwindowStateWindow.WindowState
Methods
Close()
Closes the window.
public void Close()
GetContext()
Gets the window _context.
public IGLFWGraphicsContext GetContext()
Returns
GetMousePosition()
Gets the current mouse position in the window.
public Vector2 GetMousePosition()
Returns
GetViewport()
Gets the current window size.
public Viewport GetViewport()
Returns
HideCursor()
Hides the mouse cursor.
public void HideCursor()
IsFocused()
Checks if the window is focused.
public bool IsFocused()
Returns
IsKeyDown(Keys)
Checks if the specified key is down.
public bool IsKeyDown(Keys key)
Parameters
keyKeys
Returns
IsKeyPressed(Keys)
Checks if the specified key is pressed.
public bool IsKeyPressed(Keys key)
Parameters
keyKeys
Returns
IsMouseDown(MouseButton)
Checks if the specified mouse button is down.
public bool IsMouseDown(MouseButton button)
Parameters
buttonMouseButton
Returns
IsMousePressed(MouseButton)
Checks if the specified mouse button is pressed.
public bool IsMousePressed(MouseButton button)
Parameters
buttonMouseButton
Returns
IsMouseReleased(MouseButton)
Checks if the specified mouse button is released.
public bool IsMouseReleased(MouseButton button)
Parameters
buttonMouseButton
Returns
ProcessEvents()
Processes the window events.
public void ProcessEvents()
RequestClose()
Requests to close the window.
public bool RequestClose()
Returns
SetMousePosition(Vector2)
Sets the mouse position to the specified coordinates.
public void SetMousePosition(Vector2 position)
Parameters
positionVector2
SetMousePosition(float, float)
Sets the mouse position to the specified coordinates.
public void SetMousePosition(float x, float y)
Parameters
ShowCursor()
Shows the mouse cursor.
public void ShowCursor()