142typedef void* (*bj_app_setup_fn)(
struct bj_app* app,
void* init_data);
General-purpose definitions for Banjo API.
static void step(struct bj_app *app, struct bj_tick_info tick, void *user_data)
static void teardown(struct bj_app *app, void *user_data)
static void * setup(struct bj_app *app, void *init_data)
void(* bj_app_teardown_fn)(struct bj_app *app, void *user_data)
Application teardown callback.
int bj_app_frame_rate(const struct bj_app *app)
Return the configured frame-rate cap (in Hz) for app.
int bj_run_app(bj_app_setup_fn setup, bj_app_step_fn step, bj_app_fixed_step_fn fixed_step, bj_app_teardown_fn teardown, void *init_data)
Drive the application lifecycle.
void bj_set_fixed_step_rate(struct bj_app *app, int hz)
Configure the fixed-step rate (in Hz) for app.
void(* bj_app_step_fn)(struct bj_app *app, struct bj_tick_info tick, void *user_data)
Application per-iteration callback.
void *(* bj_app_setup_fn)(struct bj_app *app, void *init_data)
Application setup callback.
void bj_set_frame_rate(struct bj_app *app, int hz)
Cap the run loop to at most hz iterations per second.
void(* bj_app_fixed_step_fn)(struct bj_app *app, struct bj_tick_info tick, void *user_data)
Application fixed-rate step callback.
void bj_quit_app(struct bj_app *app, int exit_code)
Signal the given application to exit on the next iteration.
int bj_app_fixed_step_rate(const struct bj_app *app)
Return the configured fixed-step rate (in Hz) for app.
Timing snapshot handed to the step and fixed-step callbacks.
float bj_real
Selected real type for float configuration.
static void fixed_step(struct bj_app *app, struct bj_tick_info tick, void *ud)
C99 math shim with bj_real precision type and scalar utilities.