public InputAction GetMouseButtonState(MouseButton mouseButton) { try { ErrorUtility.Bind(); InputAction result = Glfw3.GetMouseButton(this.handle, mouseButton); ErrorUtility.ThrowOnError(); return(result); } finally { ErrorUtility.Unbind(); } }
public InputAction GetKeyState(Key key) { try { ErrorUtility.Bind(); InputAction result = Glfw3.GetKey(this.handle, key); ErrorUtility.ThrowOnError(); return(result); } finally { ErrorUtility.Unbind(); } }
/// <summary> /// Closes the window. /// </summary> public void Close() { if (!this.isDisposed) { try { ErrorUtility.Bind(); Glfw3.DestroyWindow(this.handle); this.isDisposed = true; ErrorUtility.ThrowOnError(); } finally { ErrorUtility.Unbind(); } } }
internal Window(int width, int height, string title, MonitorHandle monitor, Dictionary <WindowAttribute, int> windowHints) { try { ErrorUtility.Bind(); if (windowHints != null) { foreach (var hintPair in windowHints) { Glfw3.WindowHint(hintPair.Key, hintPair.Value); } } this.handle = Glfw3.CreateWindow(width, height, title, monitor, WindowHandle.Zero); ErrorUtility.ThrowOnError(); } finally { ErrorUtility.Unbind(); } }