Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a win32 platform for new mach Core #1224

Merged
merged 10 commits into from
Jul 13, 2024
1 change: 1 addition & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ pub const Platform = enum {
x11,
wayland,
web,
win32,

pub fn fromTarget(target: std.Target) Platform {
if (target.cpu.arch == .wasm32) return .web;
Expand Down
5 changes: 4 additions & 1 deletion src/Core.zig
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const Platform = switch (build_options.core_platform) {
.x11 => @import("core/X11.zig"),
.wayland => @import("core/Wayland.zig"),
.web => @panic("TODO: revive wasm backend"),
.win32 => @import("core/win32.zig"),
};

// TODO(important): mach.core has a lot of standard Zig APIs, and some global variables, which are
Expand Down Expand Up @@ -242,8 +243,10 @@ pub inline fn deinit(entities: *mach.Entities.Mod, core: *Mod) !void {
if (builtin.os.tag == .linux and
state.linux_gamemode != null and
state.linux_gamemode.?)
{
deinitLinuxGamemode();

}

state.platform.deinit();
state.swap_chain.release();
state.queue.release();
Expand Down
Loading
Loading