mach: expose window size (pixel units, vs. framebuffer subpixel units)

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-05-22 08:53:38 -07:00
parent 1e8ad533e2
commit a7e7dc800d
2 changed files with 15 additions and 0 deletions

View file

@ -93,6 +93,11 @@ pub const CoreGlfw = struct {
return @bitCast(structs.Size, size);
}
pub fn getWindowSize(self: *CoreGlfw) !structs.Size {
const size = try self.window.getSize();
return @bitCast(structs.Size, size);
}
pub fn setSizeLimits(self: *CoreGlfw, min: structs.SizeOptional, max: structs.SizeOptional) !void {
try self.window.setSizeLimits(
@bitCast(glfw.Window.SizeOptional, min),