Experimento con emscripten y SDL
#ifndef INPUT_PROCESSOR_H1#define INPUT_PROCESSOR_H23#include <SDL2/SDL.h>4#include <SDL2/SDL_opengl.h>5#include <SDL2/SDL_image.h>6#include <stdbool.h>78typedef enum game_state9{10GS_ONE,11GS_TWO,12GS_N,13GS_E,14GS_S,15GS_W,16GS_QUIT,17GS_NUM_STATES18} game_state;1920typedef enum binding_type21{22BINDING_ATOMIC, // press button to turn state on,23// press again to switch off2425BINDING_CONTINUOUS, // press button and state turns on,26// release and state turns off2728BINDING_ONE_TIME // press button and state turns on,29// state must then be turned off30// manually31} binding_type;3233typedef struct key_state_binding key_state_binding;34struct key_state_binding35{36SDL_Keycode k;37game_state s;38binding_type t;39};404142enum43{44MAX_BINDINGS = 10045};4647void input_processor_init();48bool add_binding(key_state_binding *binding);49bool rm_binding(key_state_binding *binding);50void process_input();51void activate_state(game_state state);52void deactivate_state(game_state state);53bool is_state_active(game_state state);5455bool test_input_processor();5657#endif585960