twn_input: singleton rework, twn_control.h and fixes

This commit is contained in:
2024-10-08 10:12:30 +03:00
parent aef3f6444e
commit 0ede612bec
17 changed files with 677 additions and 647 deletions

View File

@ -4,6 +4,7 @@
#include "twn_context.h"
#include "twn_textures_c.h"
#include "twn_audio_c.h"
#include "twn_input_c.h"
#include "twn_engine_api.h"
#include "rendering/twn_draw_c.h"
@ -18,6 +19,8 @@ typedef struct EngineContext {
/* user code facing context */
Context game;
InputState input;
/* the program's actual argc and argv */
int argc;
char **argv;
@ -64,6 +67,7 @@ typedef struct EngineContext {
bool was_successful;
} EngineContext;
/* TODO: does it need to be marked with TWN_API? */
TWN_API extern EngineContext ctx;
#endif