glfwGetWindowAttrib function

int glfwGetWindowAttrib(
  1. Pointer<GLFWwindow> window,
  2. int attrib
)

! @brief Returns an attribute of the specified window.

This function returns the value of an attribute of the specified window or its OpenGL or OpenGL ES context.

@paramin window The window to query. @paramin attrib The window attribute(@ref window_attribs) whose value to return. @return The value of the attribute, or zero if an error(@ref error_handling) occurred.

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

@remark Framebuffer related hints are not window attributes. See @ref window_attribs_fb for more information.

@remark Zero is a valid value for many window and context related attributes so you cannot use a return value of zero as an indication of errors. However, this function should not fail as long as it is passed valid arguments and the library has been initialized(@ref intro_init).

@remark @wayland The Wayland protocol provides no way to check whether a window is iconfied, so @ref GLFW_ICONIFIED always returns GLFW_FALSE.

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

@sa @ref window_attribs @sa @ref glfwSetWindowAttrib

@since Added in version 3.0. Replaces glfwGetWindowParam and glfwGetGLVersion.

@ingroup window

GLFWAPI int glfwGetWindowAttrib(GLFWwindow* window, int attrib)

Implementation

int glfwGetWindowAttrib(Pointer<GLFWwindow> window, int attrib) {
  final glfwGetWindowAttribLookupFunction = libglfw.lookupFunction<
      Int32 Function(Pointer<GLFWwindow> window, Int32 attrib),
      int Function(
          Pointer<GLFWwindow> window, int attrib)>('glfwGetWindowAttrib');
  return glfwGetWindowAttribLookupFunction(window, attrib);
}