[go: up one dir, main page]

glfwGetMonitorContentScale

Function glfwGetMonitorContentScale 

Source
pub unsafe extern "C" fn glfwGetMonitorContentScale(
    monitor: *mut GLFWmonitor,
    xscale: *mut f32,
    yscale: *mut f32,
)
Expand description

@brief Retrieves the content scale for the specified monitor.

This function retrieves the content scale for the specified monitor. The content scale is the ratio between the current DPI and the platform’s default DPI. This is especially important for text and any UI elements. If the pixel dimensions of your UI scaled by this look appropriate on your machine then it should appear at a reasonable size on other machines regardless of their DPI and scaling settings. This relies on the system DPI and scaling settings being somewhat correct.

The content scale may depend on both the monitor resolution and pixel density and on user settings. It may be very different from the raw DPI calculated from the physical size and current resolution.

@param[in] monitor The monitor to query. @param[out] xscale Where to store the x-axis content scale, or NULL. @param[out] yscale Where to store the y-axis content scale, or NULL.

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

@remark @wayland Fractional scaling information is not yet available for monitors, so this function only returns integer content scales.

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

@sa @ref monitor_scale @sa @ref glfwGetWindowContentScale

@since Added in version 3.3.

@ingroup monitor