コード例 #1
0
 /// <summary>
 /// Retrives the work area of the monitor.
 /// </summary>
 /// <param name="monitor"></param>
 /// <param name="xpos"></param>
 /// <param name="ypos"></param>
 /// <param name="width"></param>
 /// <param name="height"></param>
 public static void GetMonitorWorkarea(GLFWMonitor monitor, out int xpos, out int ypos, out int width, out int height)
 {
     xpos   = monitor.WorkArea.x;
     ypos   = monitor.WorkArea.y;
     width  = monitor.WorkArea.Width;
     height = monitor.WorkArea.Height;
 }
コード例 #2
0
ファイル: Glfw.cs プロジェクト: Kakaff/Glue.Net
        internal static bool __Init()
        {
            bool b = Glue.__InitGlfw();

            GLFWMonitor.Init();
            IsInitialized = true;
            return(b);
        }
コード例 #3
0
ファイル: GLFWVideoMode.cs プロジェクト: Kakaff/Glue.Net
        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);
        }
コード例 #4
0
 /// <summary>
 /// Returns the available video modes for the specified monitor.
 /// </summary>
 /// <param name="monitor"></param>
 /// <param name="count"></param>
 /// <returns></returns>
 public static GLFWVideoMode[] GetVideoModes(GLFWMonitor monitor) =>
 monitor.SupportedVideoModes;
コード例 #5
0
 /// <summary>
 /// Creates a window and its associated context.
 /// </summary>
 /// <param name="width"></param>
 /// <param name="height"></param>
 /// <param name="title"></param>
 /// <param name="monitor"></param>
 /// <param name="share"></param>
 /// <returns></returns>
 public static GLFW_Window CreateWindow(int width, int height, string title, GLFWMonitor monitor, GLFW_Window share) =>
 new GLFW_Window(width, height, title, monitor, share);
コード例 #6
0
 /// <summary>
 /// Returns the physical size of the monitor.
 /// </summary>
 /// <param name="monitor"></param>
 /// <param name="widthMM"></param>
 /// <param name="heightMM"></param>
 public static void GetMonitorPhysicalSize(GLFWMonitor monitor, out int widthMM, out int heightMM)
 {
     widthMM  = monitor.PhysicalSize.Width;
     heightMM = monitor.PhysicalSize.Height;
 }
コード例 #7
0
 /// <summary>
 /// Sets the current gamma ramp for the specified monitor.
 /// </summary>
 /// <param name="monitor"></param>
 /// <param name="ramp"></param>
 public static void SetGammaRamp(GLFWMonitor monitor, GLFWgammaramp ramp) =>
 monitor.SetGammaRamp(ramp);
コード例 #8
0
 /// <summary>
 /// Returns the position of the monitor's viewport on the virtual screen.
 /// </summary>
 /// <param name="monitor"></param>
 /// <param name="xpos"></param>
 /// <param name="ypos"></param>
 public static void GetMonitorPos(GLFWMonitor monitor, out int xPos, out int yPos)
 {
     xPos = monitor.Position.x;
     yPos = monitor.Position.y;
 }
コード例 #9
0
 /// <summary>
 /// Generates a gamma ramp and sets it for the specified monitor.
 /// </summary>
 /// <param name="monitor"></param>
 /// <param name="gamma"></param>
 public static GLFWgammaramp SetGamma(GLFWMonitor monitor, float gamma) =>
 monitor.SetGamma(gamma);
コード例 #10
0
 /// <summary>
 /// Returns the current gamma ramp for the specified monitor.
 /// </summary>
 /// <param name="monitor"></param>
 /// <returns></returns>
 public static GLFWgammaramp GetGammaRamp(GLFWMonitor monitor) =>
 monitor.GammaRamp;
コード例 #11
0
 /// <summary>
 /// Sets the mode, monitor, video mode and placement of a window.
 /// </summary>
 /// <param name="window"></param>
 /// <param name="monitor"></param>
 /// <param name="xpos"></param>
 /// <param name="ypos"></param>
 /// <param name="width"></param>
 /// <param name="height"></param>
 /// <param name="refreshRate"></param>
 public static void SetWindowMonitor(GLFW_Window window, GLFWMonitor monitor, int xpos, int ypos, int width, int height, int refreshRate) =>
 window.SetMonitor(monitor, xpos, ypos, width, height, refreshRate);
コード例 #12
0
 /// <summary>
 /// Returns the current mode of the specified monitor.
 /// </summary>
 /// <param name="monitor"></param>
 /// <returns></returns>
 public static GLFWVideoMode GetVideoMode(GLFWMonitor monitor) =>
 monitor.VideoMode;
コード例 #13
0
 /// <summary>
 /// Returns the user pointer of the specified monitor.
 /// </summary>
 /// <param name="monitor"></param>
 /// <returns></returns>
 public static object GetMonitorUserPointer(GLFWMonitor monitor) => monitor.UserPointer;
コード例 #14
0
 /// <summary>
 /// Returns the currently connected monitors.
 /// </summary>
 /// <param name="count"></param>
 /// <returns></returns>
 public static GLFWMonitor[] GetMonitors() => GLFWMonitor.GetMonitors();
コード例 #15
0
 /// <summary>
 /// Sets the user pointer of the specified monitor.
 /// </summary>
 /// <param name="monitor"></param>
 /// <param name="pointer"></param>
 public static void SetMonitorUserPointer(GLFWMonitor monitor, object pointer) => monitor.SetUserPointer(pointer);
コード例 #16
0
 /// <summary>
 /// Returns the name of the specified monitor.
 /// </summary>
 /// <param name="monitor"></param>
 /// <returns></returns>
 public static string GetMonitorName(GLFWMonitor monitor) =>
 monitor.Name;
コード例 #17
0
 /// <summary>
 /// Retrieves the content scale for the specified monitor.
 /// </summary>
 /// <param name="monitor"></param>
 /// <param name="xscale"></param>
 /// <param name="yscale"></param>
 public static void GetMonitorContentScale(GLFWMonitor monitor, out float xscale, out float yscale)
 {
     xscale = monitor.ContentScale.x;
     yscale = monitor.ContentScale.y;
 }