/// <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; }
internal static bool __Init() { bool b = Glue.__InitGlfw(); GLFWMonitor.Init(); IsInitialized = true; return(b); }
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); }
/// <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;
/// <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);
/// <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; }
/// <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);
/// <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; }
/// <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);
/// <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;
/// <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);
/// <summary> /// Returns the current mode of the specified monitor. /// </summary> /// <param name="monitor"></param> /// <returns></returns> public static GLFWVideoMode GetVideoMode(GLFWMonitor monitor) => monitor.VideoMode;
/// <summary> /// Returns the user pointer of the specified monitor. /// </summary> /// <param name="monitor"></param> /// <returns></returns> public static object GetMonitorUserPointer(GLFWMonitor monitor) => monitor.UserPointer;
/// <summary> /// Returns the currently connected monitors. /// </summary> /// <param name="count"></param> /// <returns></returns> public static GLFWMonitor[] GetMonitors() => GLFWMonitor.GetMonitors();
/// <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);
/// <summary> /// Returns the name of the specified monitor. /// </summary> /// <param name="monitor"></param> /// <returns></returns> public static string GetMonitorName(GLFWMonitor monitor) => monitor.Name;
/// <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; }