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

            CheckError();
            return(result);
        }
예제 #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();
 }
예제 #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);
        }
예제 #4
0
 public static GammaRamp GetGammaRamp(MonitorPtr monitor)
 {
     unsafe
     {
         NativeGammaRamp ngr = *glfwGetGammaRamp(monitor);
         CheckError();
         return(new GammaRamp(ngr));
     }
 }
예제 #5
0
 public static VideoMode GetVideoMode(MonitorPtr monitor)
 {
     unsafe
     {
         VideoMode result = *glfwGetVideoMode(monitor);
         CheckError();
         return(result);
     }
 }
예제 #6
0
 public static string GetMonitorName(MonitorPtr monitor)
 {
     unsafe
     {
         var s = glfwGetMonitorName(monitor);
         CheckError();
         string result = Interop.GetString(s);
         return(result);
     }
 }
예제 #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();
                }
            }
        }
예제 #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);
            }
        }
예제 #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);
            }
        }
예제 #10
0
 public static void SetGamma(MonitorPtr monitor, float gamma)
 {
     glfwSetGamma(monitor, gamma);
 }
예제 #11
0
 public static void GetMonitorPhysicalSize(MonitorPtr monitor, out int width, out int height)
 {
     glfwGetMonitorPhysicalSize(monitor, out width, out height);
     CheckError();
 }
예제 #12
0
 public static void GetMonitorPos(MonitorPtr monitor, out int x, out int y)
 {
     glfwGetMonitorPos(monitor, out x, out y);
     CheckError();
 }