glfwSetWindowSizeLimits function

void glfwSetWindowSizeLimits(
  1. Pointer<GLFWwindow> window,
  2. int minwidth,
  3. int minheight,
  4. int maxwidth,
  5. int maxheight,
)

! @brief Sets the size limits of the specified window.

This function sets the size limits of the content area of the specified window. If the window is full screen, the size limits only take effect once it is made windowed. If the window is not resizable, this function does nothing.

The size limits are applied immediately to a windowed mode window and may cause it to be resized.

The maximum dimensions must be greater than or equal to the minimum dimensions and all must be greater than or equal to zero.

@paramin window The window to set limits for. @paramin minwidth The minimum width, in screen coordinates, of the content area, or GLFW_DONT_CARE. @paramin minheight The minimum height, in screen coordinates, of the content area, or GLFW_DONT_CARE. @paramin maxwidth The maximum width, in screen coordinates, of the content area, or GLFW_DONT_CARE. @paramin maxheight The maximum height, in screen coordinates, of the content area, or GLFW_DONT_CARE.

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

@remark If you set size limits and an aspect ratio that conflict, the results are undefined.

@remark @wayland The size limits will not be applied until the window is actually resized, either by the user or by the compositor.

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

@sa @ref window_sizelimits @sa @ref glfwSetWindowAspectRatio

@since Added in version 3.2.

@ingroup window

GLFWAPI void glfwSetWindowSizeLimits(GLFWwindow* window, int minwidth, int minheight, int maxwidth, int maxheight)

Implementation

void glfwSetWindowSizeLimits(Pointer<GLFWwindow> window, int minwidth,
    int minheight, int maxwidth, int maxheight) {
  final glfwSetWindowSizeLimitsLookupFunction = libglfw.lookupFunction<
      Void Function(Pointer<GLFWwindow> window, Int32 minwidth, Int32 minheight,
          Int32 maxwidth, Int32 maxheight),
      void Function(Pointer<GLFWwindow> window, int minwidth, int minheight,
          int maxwidth, int maxheight)>('glfwSetWindowSizeLimits');
  return glfwSetWindowSizeLimitsLookupFunction(
      window, minwidth, minheight, maxwidth, maxheight);
}