win32_app
This commit is contained in:
@@ -5,32 +5,33 @@
|
||||
#include "gfx2d/gfx2d.c"
|
||||
// #include "ui.c"
|
||||
|
||||
gfx2d_t *gfx2d = NULL;
|
||||
gfx_t *gfx = NULL;
|
||||
|
||||
void app_init(void) {
|
||||
tcx.temp = ma_push_arena(&tcx.perm, mib(1));
|
||||
gfx2d = ma_push_type(&tcx.perm, gfx2d_t);
|
||||
ma_arena_t *perm = &tcx._perm;
|
||||
tcx.temp = ma_push_arena(perm, mib(1));
|
||||
gfx = ma_push_type(perm, gfx_t);
|
||||
}
|
||||
|
||||
void app_update(app_event_t *events, i32 events_len) {
|
||||
void app_update(void) {
|
||||
ma_set0(tcx.temp);
|
||||
|
||||
for (app_event_t *ev = events; ev < (events + events_len); ev += 1) {
|
||||
// update(ev)
|
||||
for (app_event_t *ev = app_iterate_events(); app_is_event_valid(ev); app_next_event(&ev)) {
|
||||
// update
|
||||
}
|
||||
|
||||
// These steps should be totally optional!!
|
||||
{
|
||||
app_event_t *ev = events + events_len - 1;
|
||||
app_event_t *ev = app_get_last_event();
|
||||
f64 delta = app_get_anim_delta_time();
|
||||
f64 time = app_get_anim_time();
|
||||
|
||||
// animate
|
||||
// render
|
||||
gfx2d_begin(gfx2d, ev);
|
||||
gfx2d_clear(gfx2d, white_color_global);
|
||||
gfx2d_textf(gfx2d, (v2f64_t){0,0}, black_color_global, "delta: %f, time: %f", delta, time);
|
||||
gfx2d_end(gfx2d);
|
||||
gfx_begin(gfx, ev);
|
||||
gfx_clear(gfx, white_color_global);
|
||||
gfx_textf(gfx, (v2f64_t){0,0}, black_color_global, "delta: %f, time: %f", delta, time);
|
||||
gfx_end(gfx);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user