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

@ -34,10 +34,20 @@ pub const Core = struct {
core.internal.setShouldClose(value);
}
// Returns the framebuffer size, in subpixel units.
//
// e.g. returns 1280x960 on macOS for a window that is 640x480
pub fn getFramebufferSize(core: *Core) !structs.Size {
return core.internal.getFramebufferSize();
}
// Returns the widow size, in pixel units.
//
// e.g. returns 1280x960 on macOS for a window that is 640x480
pub fn getWindowSize(core: *Core) !structs.Size {
return core.internal.getWindowSize();
}
pub fn setSizeLimits(core: *Core, min: structs.SizeOptional, max: structs.SizeOptional) !void {
return core.internal.setSizeLimits(min, max);
}