Exemplo n.º 1
0
 /// <summary>
 /// Set current mouse cursor in the GLFW window.
 /// </summary>
 /// <param name="cursor">New mouse cursor to set.</param>
 public void SetCursor(CursorShape cursor)
 {
     if (currentCursor != IntPtr.Zero)
     {
         Glfw3.DestroyCursor(currentCursor);
     }
     currentCursor = Glfw3.CreateStandardCursor(cursor);
     Glfw3.SetCursor(hWin, currentCursor);
 }
Exemplo n.º 2
0
        protected virtual void Dispose(bool disposing)
        {
            if (!isDisposed)
            {
                dev.WaitIdle();

                for (int i = 0; i < swapChain.ImageCount; i++)
                {
                    dev.DestroySemaphore(drawComplete[i]);
                    cmds[i].Free();
                }
                drawFence.Dispose();
                swapChain.Dispose();

                vkDestroySurfaceKHR(instance.Handle, hSurf, IntPtr.Zero);

                if (disposing)
                {
                    cmdPool.Dispose();
                    dev.Dispose();
                    instance.Dispose();
                }
                else
                {
                    Debug.WriteLine("a VkWindow has not been correctly disposed");
                }

                if (currentCursor != IntPtr.Zero)
                {
                    Glfw3.DestroyCursor(currentCursor);
                }

                Glfw3.DestroyWindow(hWin);
                Glfw3.Terminate();


                isDisposed = true;
            }
        }