glfwSetWindowSizeLimits

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.

extern (C) @nogc nothrow __gshared
void
glfwSetWindowSizeLimits

Parameters

window GLFWwindow*

The window to set limits for.

minwidth int

The minimum width, in screen coordinates, of the content area, or GLFW_DONT_CARE.

minheight int

The minimum height, in screen coordinates, of the content area, or GLFW_DONT_CARE.

maxwidth int

The maximum width, in screen coordinates, of the content area, or GLFW_DONT_CARE.

maxheight int

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

Meta

Since

Added in version 3.2.

Ingroup: window