Move all input handling into input module
This commit is contained in:
15
input.h
15
input.h
@@ -1,15 +1,20 @@
|
||||
#ifndef INPUT_H
|
||||
#define INPUT_H
|
||||
|
||||
typedef void (*input_callback_t)(int key);
|
||||
typedef void (*input_callback_t)();
|
||||
|
||||
typedef struct {
|
||||
int spin;
|
||||
int thrust;
|
||||
bool quit;
|
||||
} input_state_t;
|
||||
|
||||
extern input_state_t input;
|
||||
|
||||
int input_init();
|
||||
void input_cleanup();
|
||||
|
||||
void input_on_press(input_callback_t cb);
|
||||
void input_on_release(input_callback_t cb);
|
||||
void input_on_repeat(input_callback_t cb);
|
||||
|
||||
void input_on_shoot(input_callback_t cb);
|
||||
void input_handle();
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user