Exemple #1
0
        private IntPtr GetCursor(Cursors fosterCursor)
        {
            if (!cursors.TryGetValue(fosterCursor, out var ptr))
            {
                GLFW_Enum cursor;
                switch (fosterCursor)
                {
                default:
                case Cursors.Default:
                    cursor = GLFW_Enum.ARROW_CURSOR;
                    break;

                case Cursors.IBeam:
                    cursor = GLFW_Enum.IBEAM_CURSOR;
                    break;

                case Cursors.Crosshair:
                    cursor = GLFW_Enum.CROSSHAIR_CURSOR;
                    break;

                case Cursors.Hand:
                    cursor = GLFW_Enum.HAND_CURSOR;
                    break;

                case Cursors.HorizontalResize:
                    cursor = GLFW_Enum.HRESIZE_CURSOR;
                    break;

                case Cursors.VerticalResize:
                    cursor = GLFW_Enum.VRESIZE_CURSOR;
                    break;
                }

                cursors.Add(fosterCursor, ptr = GLFW.CreateStandardCursor((int)cursor));
            }

            return(ptr);
        }