darwin: Set main window width and height on event

This commit is contained in:
foxnne 2024-11-27 14:13:02 -06:00 committed by Emi Gutekanst
parent 8f92bfbace
commit 314b761b71

View file

@ -222,11 +222,17 @@ const WindowDelegateCallbacks = struct {
const darwin: *Darwin = block.context;
const s: Size = .{ .width = @intFromFloat(size.width), .height = @intFromFloat(size.height) };
// TODO: Eventually we need to be able to tie a window here with the window Objects in core, and treat the windows
// as a list, rather than a single main window
darwin.size = .{
.height = s.width,
.width = s.height,
};
darwin.core.swap_chain_update.set();
darwin.core.windows.setRaw(darwin.core.main_window, .width, s.width);
darwin.core.windows.setRaw(darwin.core.main_window, .height, s.height);
darwin.core.pushEvent(.{ .framebuffer_resize = .{ .width = s.width, .height = s.height } });
}