mach: wasm: implement getWindowSize

This commit is contained in:
iddev5 2022-05-22 23:21:48 +05:30 committed by Stephen Gutekanst
parent f7301cc242
commit 281b1e75c0

View file

@ -40,7 +40,11 @@ pub const CoreWasm = struct {
pub fn setShouldClose(_: *CoreWasm, _: bool) void {} pub fn setShouldClose(_: *CoreWasm, _: bool) void {}
pub fn getFramebufferSize(core: *CoreWasm) !structs.Size { pub fn getFramebufferSize(_: *CoreWasm) !structs.Size {
return structs.Size{ .width = 0, .height = 0 };
}
pub fn getWindowSize(core: *CoreWasm) !structs.Size {
return structs.Size{ return structs.Size{
.width = js.machCanvasGetWidth(core.id), .width = js.machCanvasGetWidth(core.id),
.height = js.machCanvasGetHeight(core.id), .height = js.machCanvasGetHeight(core.id),