glfwSetWindowMonitor function

void glfwSetWindowMonitor(
  1. Pointer<GLFWwindow> window,
  2. Pointer<GLFWmonitor> monitor,
  3. int xpos,
  4. int ypos,
  5. int width,
  6. int height,
  7. int refreshRate,
)

! @brief Sets the mode, monitor, video mode and placement of a window.

This function sets the monitor that the window uses for full screen mode or, if the monitor is NULL, makes it windowed mode.

When setting a monitor, this function updates the width, height and refresh rate of the desired video mode and switches to the video mode closest to it. The window position is ignored when setting a monitor.

When the monitor is NULL, the position, width and height are used to place the window content area. The refresh rate is ignored when no monitor is specified.

If you only wish to update the resolution of a full screen window or the size of a windowed mode window, see @ref glfwSetWindowSize.

When a window transitions from full screen to windowed mode, this function restores any previous window settings such as whether it is decorated, floating, resizable, has size or aspect ratio limits, etc.

@paramin window The window whose monitor, size or video mode to set. @paramin monitor The desired monitor, or NULL to set windowed mode. @paramin xpos The desired x-coordinate of the upper-left corner of the content area. @paramin ypos The desired y-coordinate of the upper-left corner of the content area. @paramin width The desired with, in screen coordinates, of the content area or video mode. @paramin height The desired height, in screen coordinates, of the content area or video mode. @paramin refreshRate The desired refresh rate, in Hz, of the video mode, or GLFW_DONT_CARE.

@errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref GLFW_PLATFORM_ERROR.

@remark The OpenGL or OpenGL ES context will not be destroyed or otherwise affected by any resizing or mode switching, although you may need to update your viewport if the framebuffer size has changed.

@remark @wayland The desired window position is ignored, as there is no way for an application to set this property.

@remark @wayland Setting the window to full screen will not attempt to change the mode, no matter what the requested size or refresh rate.

@thread_safety This function must only be called from the main thread.

@sa @ref window_monitor @sa @ref window_full_screen @sa @ref glfwGetWindowMonitor @sa @ref glfwSetWindowSize

@since Added in version 3.2.

@ingroup window

GLFWAPI void glfwSetWindowMonitor(GLFWwindow* window, GLFWmonitor* monitor, int xpos, int ypos, int width, int height, int refreshRate)

Implementation

void glfwSetWindowMonitor(
    Pointer<GLFWwindow> window,
    Pointer<GLFWmonitor> monitor,
    int xpos,
    int ypos,
    int width,
    int height,
    int refreshRate) {
  final glfwSetWindowMonitorLookupFunction = libglfw.lookupFunction<
      Void Function(Pointer<GLFWwindow> window, Pointer<GLFWmonitor> monitor,
          Int32 xpos, Int32 ypos, Int32 width, Int32 height, Int32 refreshRate),
      void Function(
          Pointer<GLFWwindow> window,
          Pointer<GLFWmonitor> monitor,
          int xpos,
          int ypos,
          int width,
          int height,
          int refreshRate)>('glfwSetWindowMonitor');
  return glfwSetWindowMonitorLookupFunction(
      window, monitor, xpos, ypos, width, height, refreshRate);
}