glfwGetMonitorName function

String glfwGetMonitorName(
  1. Pointer<GLFWmonitor> monitor
)

! @brief Returns the name of the specified monitor.

This function returns a human-readable name, encoded as UTF-8, of the specified monitor. The name typically reflects the make and model of the monitor and is not guaranteed to be unique among the connected monitors.

@paramin monitor The monitor to query. @return The UTF-8 encoded name of the monitor, or NULL if an error(@ref error_handling) occurred.

@errors Possible errors include @ref GLFW_NOT_INITIALIZED.

@pointer_lifetime The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified monitor is disconnected or the library is terminated.

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

@sa @ref monitor_properties

@since Added in version 3.0.

@ingroup monitor

GLFWAPI const char* glfwGetMonitorName(GLFWmonitor* monitor)

Implementation

String glfwGetMonitorName(Pointer<GLFWmonitor> monitor) {
  final glfwGetMonitorNameLookupFunction = libglfw.lookupFunction<
      Pointer<Utf8> Function(Pointer<GLFWmonitor> monitor),
      Pointer<Utf8> Function(
          Pointer<GLFWmonitor> monitor)>('glfwGetMonitorName');
  return glfwGetMonitorNameLookupFunction(monitor).toDartString();
}