38static void outputHandleGeometry(
void* data,
39 struct wl_output* output,
53 monitor->
widthMM = physicalWidth;
56 snprintf(monitor->
name,
sizeof(monitor->
name),
"%s %s", make, model);
59static void outputHandleMode(
void* data,
60 struct wl_output* output,
81 if (flags & WL_OUTPUT_MODE_CURRENT)
85static void outputHandleDone(
void* data,
struct wl_output* output)
100static void outputHandleScale(
void* data,
101 struct wl_output* output,
106 monitor->wl.scale = factor;
109static const struct wl_output_listener outputListener = {
110 outputHandleGeometry,
124 struct wl_output *output;
129 "Wayland: Unsupported output interface version");
136 output = wl_registry_bind(
_glfw.wl.registry,
138 &wl_output_interface,
146 monitor->wl.scale = 1;
147 monitor->wl.output = output;
148 monitor->wl.
name = name;
150 wl_output_add_listener(output, &outputListener, monitor);
160 if (monitor->wl.output)
161 wl_output_destroy(monitor->wl.output);
167 *xpos = monitor->wl.x;
169 *ypos = monitor->wl.y;
173 float* xscale,
float* yscale)
176 *xscale = (float) monitor->wl.scale;
178 *yscale = (float) monitor->wl.scale;
182 int* xpos,
int* ypos,
183 int* width,
int* height)
186 *xpos = monitor->wl.x;
188 *ypos = monitor->wl.y;
198 return monitor->
modes;
209 "Wayland: Gamma ramp access is not available");
217 "Wayland: Gamma ramp access is not available");
229 return monitor->wl.output;
#define GLFW_FEATURE_UNAVAILABLE
The requested feature is not provided by the platform.
#define GLFW_PLATFORM_ERROR
A platform-specific error occurred that does not match any of the more specific categories.
struct GLFWmonitor GLFWmonitor
Opaque monitor object.
void _glfwInputError(int code, const char *format,...)
void _glfwInputMonitor(_GLFWmonitor *monitor, int action, int placement)
void _glfwFreeMonitor(_GLFWmonitor *monitor)
#define _GLFW_REQUIRE_INIT_OR_RETURN(x)
_GLFWmonitor * _glfwAllocMonitor(const char *name, int widthMM, int heightMM)
#define _GLFW_INSERT_LAST
void _glfwPlatformFreeMonitor(_GLFWmonitor *monitor)
void _glfwAddOutputWayland(uint32_t name, uint32_t version)
GLFWAPI struct wl_output * glfwGetWaylandMonitor(GLFWmonitor *handle)
GLFWvidmode * _glfwPlatformGetVideoModes(_GLFWmonitor *monitor, int *found)
void _glfwPlatformGetVideoMode(_GLFWmonitor *monitor, GLFWvidmode *mode)
void _glfwPlatformSetGammaRamp(_GLFWmonitor *monitor, const GLFWgammaramp *ramp)
void _glfwPlatformGetMonitorPos(_GLFWmonitor *monitor, int *xpos, int *ypos)
GLFWbool _glfwPlatformGetGammaRamp(_GLFWmonitor *monitor, GLFWgammaramp *ramp)
void _glfwPlatformGetMonitorContentScale(_GLFWmonitor *monitor, float *xscale, float *yscale)
void _glfwPlatformGetMonitorWorkarea(_GLFWmonitor *monitor, int *xpos, int *ypos, int *width, int *height)