Exemplo n.º 1
0
        internal static unsafe GLFWVideoMode[] __LoadVideoModes(GLFWMonitor monitor, out GLFWVideoMode activeMode)
        {
            IntPtr *nptrArr = Glfw_HelperFunctions.__GetVideoModes(monitor.Handle, out int count);
            IntPtr  active  = Glfw.__GetVideoMode(monitor.Handle);

            GLFWVideoMode[] modeArr = new GLFWVideoMode[count];
            activeMode = null;

            for (int i = 0; i < count; i++)
            {
                modeArr[i] = new GLFWVideoMode(nptrArr[i]);
                if (nptrArr[i].Equals(active))
                {
                    activeMode = modeArr[i];
                }
            }

            //Cleanup the array we created to store the pointers to the videomodes.
            Glfw_HelperFunctions.__DeleteVideoModeArr(nptrArr);

            return(modeArr);
        }