Open a window and run build for every frame until the window closes. app is passed to build
each frame. Returns false when the window or the GPU could not be set up.
- options: window title, size, theme, fonts and an optional frame limit.
- app: your app state, passed to
buildeach frame. - build: declares the widgets for a frame.
#import "Basic";
#import "Extensions/UI";
Counter :: struct {
count: int;
}
main :: () {
app: Counter;
run_app(.{title = "Counter", width = 320, height = 200}, *app, build);
}
build :: (app: *Counter) {
if button(tprint("Clicked % times", app.count)) app.count += 1;
}This one is only checked to compile, not run.
run_app :: (options: App_Options, app: *$T, build: (app: *T)) -> bool
Open a window and run build for every frame until the window closes. app is passed to build
each frame. Returns false when the window or the GPU could not be set up.
Parameters
- options: App_Options
- window title, size, theme, fonts and an optional frame limit.
- app: *$T
- your app state, passed to
buildeach frame. - build: (app: *T)
- declares the widgets for a frame.
Returns
- bool
#import "Basic";
#import "Extensions/UI";
Counter :: struct {
count: int;
}
main :: () {
app: Counter;
run_app(.{title = "Counter", width = 320, height = 200}, *app, build);
}
build :: (app: *Counter) {
if button(tprint("Clicked % times", app.count)) app.count += 1;
}This one is only checked to compile, not run.