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

core: win32: various improvements #1255

Merged
merged 2 commits into from
Aug 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions src/Core.zig
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ pub const InitOptions = struct {
};

fn update(core: *Mod, entities: *mach.Entities.Mod) !void {
_ = core; // autofix
_ = entities; // autofix
_ = core;
_ = entities;
}

fn init(core: *Mod, entities: *mach.Entities.Mod) !void {
Expand Down Expand Up @@ -517,6 +517,7 @@ pub const Key = enum {
kp_8,
kp_9,
kp_decimal,
kp_comma,
kp_equal,
kp_enter,

Expand Down Expand Up @@ -561,6 +562,9 @@ pub const Key = enum {
slash,
grave,

iso_backslash,
international1,

unknown,

pub const max = Key.unknown;
Expand Down Expand Up @@ -968,17 +972,14 @@ pub fn printTitle(
comptime fmt: []const u8,
args: anytype,
) !void {
_ = core;
_ = window_id;
_ = fmt;
_ = args;
// TODO: NO OP
// // Free any previous window title slice
// if (core.get(window_id, .title)) |slice| core.state().allocator.free(slice);

// // Allocate and assign a new window title slice.
// const slice = try std.fmt.allocPrintZ(core.state().allocator, fmt, args);
// try core.set(window_id, .title, slice);
// Allocate and assign a new window title slice.
const slice = try std.fmt.allocPrintZ(core.allocator, fmt, args);
defer core.allocator.free(slice);
core.setTitle(slice);

// TODO: This function does not have access to *core.Mod to update
// try core.Mod.set(window_id, .title, slice);
}

fn exit(core: *Mod) void {
Expand Down Expand Up @@ -1054,6 +1055,7 @@ pub fn deinitLinuxGamemode() void {
comptime {
// Core
assertHasField(Platform, "surface_descriptor");
assertHasField(Platform, "refresh_rate");

assertHasDecl(Platform, "init");
assertHasDecl(Platform, "deinit");
Expand Down
Loading
Loading