Exemplo n.º 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;
 }
Exemplo n.º 2
0
        internal static bool __Init()
        {
            bool b = Glue.__InitGlfw();

            GLFWMonitor.Init();
            IsInitialized = true;
            return(b);
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 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;
Exemplo n.º 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);
Exemplo n.º 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;
 }
Exemplo n.º 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);
Exemplo n.º 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;
 }
Exemplo n.º 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);
Exemplo n.º 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;
Exemplo n.º 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);
Exemplo n.º 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;
Exemplo n.º 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;
Exemplo n.º 14
0
 /// <summary>
 /// Returns the currently connected monitors.
 /// </summary>
 /// <param name="count"></param>
 /// <returns></returns>
 public static GLFWMonitor[] GetMonitors() => GLFWMonitor.GetMonitors();
Exemplo n.º 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);
Exemplo n.º 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;
Exemplo n.º 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;
 }