protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { } Glfw.DestroyCursor(this); disposedValue = true; } }
/// <summary> /// Init this instance. /// Callbacks are here initialized for the events. /// </summary> private void Init() { SizeChangedCallback = (IntPtr _handle, int width, int height) => { SizeChanged.Invoke(this, new SizeChangedEventArgs { source = this, width = width, height = height }); }; Glfw.SetWindowSizeCallback(this, SizeChangedCallback); KeyPressedCallback = (IntPtr _handle, int key, int scancode, int action, int mods) => { var args = new KeyEventArgs { source = this, key = (Key)System.Enum.Parse(typeof(Key), key.ToString()), action = (State)System.Enum.Parse(typeof(State), action.ToString()), scancode = scancode, mods = mods }; KeyChanged.Invoke(this, args); }; Glfw.SetKeyCallback(this, KeyPressedCallback); }
public void GetSize(ref int width, ref int height) { Glfw.GetWindowSize(this, ref width, ref height); }
public void Hide() { Glfw.HideWindow(this); }
public void Show() { Glfw.ShowWindow(this); }
public bool ShouldClose() { return(System.Convert.ToBoolean(Glfw.WindowShouldClose(this))); }
public void Close() { Glfw.DestroyWindow(this); }