apprt/glfw: launch window on startup

This commit is contained in:
Mitchell Hashimoto
2023-08-07 19:28:48 -07:00
parent 60a36ca5cc
commit 2e98d43a58
2 changed files with 9 additions and 1 deletions

View File

@ -65,6 +65,14 @@ pub const App = struct {
// up when we take a pass at cleaning up the dev mode.
if (DevMode.enabled) DevMode.instance.config = config;
// Queue a single new window that starts on launch
_ = core_app.mailbox.push(.{
.new_window = .{},
}, .{ .forever = {} });
// We want the event loop to wake up instantly so we can process our tick.
glfw.postEmptyEvent();
return .{
.app = core_app,
.config = config,

View File

@ -283,7 +283,7 @@ pub const App = struct {
// Queue a new window
_ = core_app.mailbox.push(.{
.new_window = .{},
}, .{ .instant = {} });
}, .{ .forever = {} });
}
};