mach/platform: check for App functions in all platforms

This commit is contained in:
iddev5 2022-05-30 13:36:27 +05:30 committed by Stephen Gutekanst
parent 21c49ff9be
commit ff126c0054
3 changed files with 13 additions and 4 deletions

View file

@ -390,11 +390,9 @@ pub const GpuDriver = struct {
pub const BackingTimer = std.time.Timer;
// TODO: check signatures
const common = @import("common.zig");
comptime {
if (!@hasDecl(App, "init")) @compileError("App must export 'pub fn init(app: *App, engine: *mach.Engine) !void'");
if (!@hasDecl(App, "deinit")) @compileError("App must export 'pub fn deinit(app: *App, engine: *mach.Engine) void'");
if (!@hasDecl(App, "update")) @compileError("App must export 'pub fn update(app: *App, engine: *mach.Engine) !bool'");
common.checkApplication(App);
}
pub fn main() !void {