Example #1
0
        public static MonitorPtr GetPrimaryMonitor()
        {
            MonitorPtr result = glfwGetPrimaryMonitor();

            CheckError();
            return(result);
        }
Example #2
0
 public static void SetWindowMonitor(WindowPtr window, MonitorPtr monitor,
                                     int x, int y,
                                     int width, int height,
                                     int refreshRate)
 {
     glfwSetWindowMonitor(window, monitor, x, y, width, height, refreshRate);
     CheckError();
 }
Example #3
0
        public static WindowPtr CreateWindow(int width, int height, string title, MonitorPtr monitor, WindowPtr share)
        {
            var result = glfwCreateWindow(width, height, title, monitor, share);

            CheckError();

            GetCallbacks(result);
            return(result);
        }
Example #4
0
 public static GammaRamp GetGammaRamp(MonitorPtr monitor)
 {
     unsafe
     {
         NativeGammaRamp ngr = *glfwGetGammaRamp(monitor);
         CheckError();
         return(new GammaRamp(ngr));
     }
 }
Example #5
0
 public static VideoMode GetVideoMode(MonitorPtr monitor)
 {
     unsafe
     {
         VideoMode result = *glfwGetVideoMode(monitor);
         CheckError();
         return(result);
     }
 }
Example #6
0
 public static string GetMonitorName(MonitorPtr monitor)
 {
     unsafe
     {
         var s = glfwGetMonitorName(monitor);
         CheckError();
         string result = Interop.GetString(s);
         return(result);
     }
 }
Example #7
0
        public static void SetGammaRamp(MonitorPtr monitor, GammaRamp ramp)
        {
            unsafe
            {
                fixed(ushort *r = &ramp.red[0])
                fixed(ushort *g = &ramp.green[0])
                fixed(ushort *b = &ramp.blue[0])
                {
                    NativeGammaRamp  ngr = new NativeGammaRamp(r, g, b, ramp.size);
                    NativeGammaRamp *ptr = &ngr;

                    glfwSetGammaRamp(monitor, ptr);
                    CheckError();
                }
            }
        }
Example #8
0
        public static MonitorPtr[] GetMonitors()
        {
            unsafe
            {
                int         count;
                MonitorPtr *ptr = glfwGetMonitors(out count);
                CheckError();
                MonitorPtr[] result = new MonitorPtr[count];

                for (int i = 0; i < count; i++)
                {
                    result[i] = ptr[i];
                }

                return(result);
            }
        }
Example #9
0
        public static VideoMode[] GetVideoModes(MonitorPtr monitor)
        {
            unsafe
            {
                int        count;
                VideoMode *ptr = glfwGetVideoModes(monitor, out count);
                CheckError();
                VideoMode[] result = new VideoMode[count];

                for (int i = 0; i < count; i++)
                {
                    result[i] = ptr[i];
                }

                return(result);
            }
        }
Example #10
0
 public static void SetGamma(MonitorPtr monitor, float gamma)
 {
     glfwSetGamma(monitor, gamma);
 }
Example #11
0
 public static void GetMonitorPhysicalSize(MonitorPtr monitor, out int width, out int height)
 {
     glfwGetMonitorPhysicalSize(monitor, out width, out height);
     CheckError();
 }
Example #12
0
 public static void GetMonitorPos(MonitorPtr monitor, out int x, out int y)
 {
     glfwGetMonitorPos(monitor, out x, out y);
     CheckError();
 }