diff --git a/src/zglfw.zig b/src/zglfw.zig index d48ae9d..b75f7fd 100644 --- a/src/zglfw.zig +++ b/src/zglfw.zig @@ -545,6 +545,7 @@ pub const Monitor = opaque { pub const getName = zglfw.getMonitorName; pub const getVideoMode = zglfw.getVideoMode; pub const getVideoModes = zglfw.getVideoModes; + pub const getPhysicalSize = zglfw.getMonitorPhysicalSize; pub fn getPos(self: *Monitor) [2]c_int { var xpos: c_int = 0; @@ -566,6 +567,15 @@ pub fn getMonitors() []*Monitor { } extern fn glfwGetMonitors(count: *c_int) ?[*]*Monitor; +pub fn getMonitorPhysicalSize(monitor: *Monitor) Error![2]i32 { + var width_mm: c_int = undefined; + var height_mm: c_int = undefined; + glfwGetMonitorPhysicalSize(monitor, &width_mm, &height_mm); + try maybeError(); + return .{ width_mm, height_mm }; +} +extern fn glfwGetMonitorPhysicalSize(*Monitor, width_mm: ?*c_int, height_mm: ?*c_int) void; + pub const getMonitorPos = glfwGetMonitorPos; extern fn glfwGetMonitorPos(*Monitor, xpos: ?*c_int, ypos: ?*c_int) void; @@ -691,6 +701,7 @@ pub const Window = opaque { pub const setScrollCallback = zglfw.setScrollCallback; pub const setCursorPosCallback = zglfw.setCursorPosCallback; pub const setCursorEnterCallback = zglfw.setCursorEnterCallback; + pub const getMonitor = zglfw.getWindowMonitor; pub const setMonitor = zglfw.setWindowMonitor; pub const show = zglfw.showWindow; pub const focus = zglfw.focusWindow; @@ -853,6 +864,9 @@ pub const MouseButtonFn = *const fn ( mods: Mods, ) callconv(.C) void; +pub const getWindowMonitor = glfwGetWindowMonitor; +extern fn glfwGetWindowMonitor(window: *Window) ?*Monitor; + pub const setCursorPosCallback = glfwSetCursorPosCallback; extern fn glfwSetCursorPosCallback(window: *Window, callback: ?CursorPosFn) ?CursorPosFn; pub const CursorPosFn = *const fn (