#import "modules/std.sx"; #import "modules/ui/types.sx"; #import "modules/ui/events.sx"; #import "modules/platform/types.sx"; Platform :: protocol { init :: (self: *Self, title: [:0]u8, w: i32, h: i32) -> bool; run_frame_loop :: (self: *Self, frame_fn: Closure()); poll_events :: (self: *Self) -> []Event; begin_frame :: (self: *Self) -> FrameContext; end_frame :: (self: *Self); safe_insets :: (self: *Self) -> EdgeInsets; keyboard :: (self: *Self) -> KeyboardState; show_keyboard :: (self: *Self); hide_keyboard :: (self: *Self); // Request the run loop to stop. On iOS/Android this is a no-op // (mobile apps don't quit on user request); on SDL it tears down the // `while !quit` loop. stop :: (self: *Self); shutdown :: (self: *Self); }