glfwGetVideoModes function

Pointer<GLFWvidmode> glfwGetVideoModes(
  1. Pointer<GLFWmonitor> monitor,
  2. Pointer<Int32> count
)

! @brief Returns the available video modes for the specified monitor.

This function returns an array of all video modes supported by the specified monitor. The returned array is sorted in ascending order, first by color bit depth (the sum of all channel depths), then by resolution area (the product of width and height), then resolution width and finally by refresh rate.

@paramin monitor The monitor to query. @paramout count Where to store the number of video modes in the returned array. This is set to zero if an error occurred. @return An array of video modes, or NULL if an error(@ref error_handling) occurred.

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

@pointer_lifetime The returned array is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified monitor is disconnected, this function is called again for that monitor or the library is terminated.

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

@sa @ref monitor_modes @sa @ref glfwGetVideoMode

@since Added in version 1.0. @glfw3 Changed to return an array of modes for a specific monitor.

@ingroup monitor

GLFWAPI const GLFWvidmode* glfwGetVideoModes(GLFWmonitor* monitor, int* count)

Implementation

Pointer<GLFWvidmode> glfwGetVideoModes(
    Pointer<GLFWmonitor> monitor, Pointer<Int32> count) {
  final glfwGetVideoModesLookupFunction = libglfw.lookupFunction<
      Pointer<GLFWvidmode> Function(
          Pointer<GLFWmonitor> monitor, Pointer<Int32> count),
      Pointer<GLFWvidmode> Function(Pointer<GLFWmonitor> monitor,
          Pointer<Int32> count)>('glfwGetVideoModes');
  return glfwGetVideoModesLookupFunction(monitor, count);
}