#ifndef __MICRO_CONTEXT_H__ #define __MICRO_CONTEXT_H__ #include #include "common.h" #include "renderer.h" struct ctx_hints { int win_width; int win_height; const char *win_title; int ticrate; }; struct ctx { struct ctx_hints creation_hints; GLFWwindow *win; double ticrate; double prev_tic_ts; struct renderer renderer; }; void init_ctx(struct ctx *ctx, struct ctx_hints creation_hints); void deinit_ctx(struct ctx *ctx); // Whether or not the main loop should continue executing. bool is_game_running(struct ctx *ctx); // Handle events, tick game logic, etc. Returns the amount of times you should // tic. int game_tick(struct ctx *ctx); // Draw stuff at an interpolated state. void game_draw(struct ctx *ctx); #endif // __MICRO_CONTEXT_H__