Пример #1
0
        public static GLFWgammaramp getGammaRamp(GLFWmonitor monitor)
        {
            IntPtr        a    = Glfwint.getGammaRamp(monitor.handle);
            GLFWgammaramp ramp = (GLFWgammaramp)Marshal.PtrToStructure(a, typeof(GLFWgammaramp));

            return(ramp);
        }
Пример #2
0
        public static GLFWmonitor getPrimaryMonitor()
        {
            GLFWmonitor newMonitor = new GLFWmonitor();

            newMonitor.handle = Glfwint.getPrimaryMonitor();
            return(newMonitor);
        }
Пример #3
0
        public static GLFWmonitor getWindowMonitor(GLFWwindow window)
        {
            GLFWmonitor mon = new GLFWmonitor();

            mon.handle = Glfwint.getWindowMonitor(window.handle);
            return(mon);
        }
Пример #4
0
        public static void setGammaRamp(GLFWmonitor monitor, GLFWgammaramp ramp)
        {
            IntPtr ptr = new IntPtr();

            Marshal.StructureToPtr(ramp, ptr, false);
            Glfwint.setGammaRamp(monitor.handle, ptr);
        }
Пример #5
0
        public static GLFWwindow createWindow(int width, int height, string title, GLFWmonitor monitor, GLFWwindow share)
        {
            GLFWwindow win = new GLFWwindow();
            IntPtr     tmp = Glfwint.createWindow(width, height, Marshal.StringToHGlobalAuto(title), monitor.handle, share.handle);

            win.handle = tmp;
            return(win);
        }
Пример #6
0
        public static List <GLFWmonitor> getMonitors()
        {
            int    count       = 0;
            IntPtr monitorList = Glfwint.getMonitors(ref count);

            List <GLFWmonitor> monitors = new List <GLFWmonitor> ();

            for (int i = 0; i < count; i++)
            {
                GLFWmonitor newMonitor = new GLFWmonitor();

                newMonitor.handle = (IntPtr)Marshal.PtrToStructure(monitorList, typeof(IntPtr));
                monitorList      += Marshal.SizeOf(typeof(IntPtr));
                monitors.Add(newMonitor);
            }

            return(monitors);
        }
Пример #7
0
        public static List <GLFWvidmode> getVideoModes(GLFWmonitor monitor)
        {
            int    count    = 0;
            IntPtr modeList = Glfwint.getVideoModes(monitor.handle, ref count);

            List <GLFWvidmode> modes = new List <GLFWvidmode> ();

            for (int i = 0; i < count; i++)
            {
                GLFWvidmode newMode = new GLFWvidmode();

                newMode   = (GLFWvidmode)Marshal.PtrToStructure(modeList, typeof(GLFWvidmode));
                modeList += Marshal.SizeOf(typeof(GLFWvidmode));
                modes.Add(newMode);
            }

            return(modes);
        }
Пример #8
0
 public static void getMonitorPos(GLFWmonitor monitor, ref int x, ref int y)
 {
     x = 0;
     y = 0;
     Glfwint.getMonitorPos(monitor.handle, ref x, ref y);
 }
Пример #9
0
 // I don't know, I want to name it getPhysicalMonitorSize, but I'll keep it getMonitorPhysicalSize for the sake of compatibility
 public static void getMonitorPhysicalSize(GLFWmonitor monitor, ref int width, ref int height)
 {
     width  = 0;
     height = 0;
     Glfwint.getMonitorPhysicalSize(monitor.handle, ref width, ref height);
 }
Пример #10
0
        public static string getMonitorName(GLFWmonitor monitor)
        {
            IntPtr name = Glfwint.getMonitorName(monitor.handle);

            return(Marshal.PtrToStringAuto(name));
        }
Пример #11
0
 public static void setGamma(GLFWmonitor monitor, float gamma)
 {
     Glfwint.setGamma(monitor.handle, gamma);
 }
Пример #12
0
 public static GLFWvidmode getVideoMode(GLFWmonitor monitor)
 {
     return((GLFWvidmode)Marshal.PtrToStructure(Glfwint.getVideoMode(monitor.handle), typeof(GLFWvidmode)));
 }
Пример #13
0
 public static void setWindowMonitor(GLFWwindow window, GLFWmonitor monitor, int x, int y, int width, int height, int refreshRate)
 {
     Glfwint.setWindowMonitor(window.handle, monitor.handle, x, y, width, height, refreshRate);
 }