core: clarify allocator is internal state

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2024-08-25 19:24:35 -07:00
parent f548918e13
commit 9a940f2879

View file

@ -120,19 +120,20 @@ on_tick: ?mach.AnySystem = null,
/// Callback system invoked when application is exiting /// Callback system invoked when application is exiting
on_exit: ?mach.AnySystem = null, on_exit: ?mach.AnySystem = null,
allocator: std.mem.Allocator, /// Main window of the application
main_window: mach.EntityID, main_window: mach.EntityID,
platform: Platform,
title: [256:0]u8 = undefined, /// Current state of the application
state: enum { state: enum {
running, running,
exiting, exiting,
deinitializing, deinitializing,
exited, exited,
} = .running, } = .running,
frame: mach.time.Frequency,
// Might be accessed by Platform backend // TODO: handle window titles better
title: [256:0]u8 = undefined,
frame: mach.time.Frequency,
input: mach.time.Frequency, input: mach.time.Frequency,
swap_chain_update: std.Thread.ResetEvent = .{}, swap_chain_update: std.Thread.ResetEvent = .{},
@ -145,7 +146,9 @@ surface: *gpu.Surface,
swap_chain: *gpu.SwapChain, swap_chain: *gpu.SwapChain,
descriptor: gpu.SwapChain.Descriptor, descriptor: gpu.SwapChain.Descriptor,
// Internal state // Internal module state
allocator: std.mem.Allocator,
platform: Platform,
events: EventQueue, events: EventQueue,
input_state: InputState, input_state: InputState,
oom: std.Thread.ResetEvent = .{}, oom: std.Thread.ResetEvent = .{},