Пример #1
0
 protected virtual void Dispose(bool disposing)
 {
     if (!disposedValue)
     {
         if (disposing)
         {
         }
         Glfw.DestroyCursor(this);
         disposedValue = true;
     }
 }
Пример #2
0
 /// <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);
 }
Пример #3
0
 public void GetSize(ref int width, ref int height)
 {
     Glfw.GetWindowSize(this, ref width, ref height);
 }
Пример #4
0
 public void Hide()
 {
     Glfw.HideWindow(this);
 }
Пример #5
0
 public void Show()
 {
     Glfw.ShowWindow(this);
 }
Пример #6
0
 public bool ShouldClose()
 {
     return(System.Convert.ToBoolean(Glfw.WindowShouldClose(this)));
 }
Пример #7
0
 public void Close()
 {
     Glfw.DestroyWindow(this);
 }