Initial commit

This commit is contained in:
Thomas
2026-02-28 18:00:58 +00:00
commit c66c12ae68
587 changed files with 239570 additions and 0 deletions

30
src/engine/input.h Normal file
View File

@@ -0,0 +1,30 @@
#ifndef JNR_INPUT_H
#define JNR_INPUT_H
#include <stdbool.h>
#include <SDL2/SDL.h>
typedef enum Action {
ACTION_LEFT,
ACTION_RIGHT,
ACTION_UP,
ACTION_DOWN,
ACTION_JUMP,
ACTION_SHOOT,
ACTION_DASH,
ACTION_PAUSE,
ACTION_COUNT
} Action;
void input_init(void);
void input_poll(void); /* call once per frame before updates */
void input_consume(void); /* call after each fixed update tick */
bool input_pressed(Action a); /* pressed since last consume */
bool input_held(Action a); /* currently held down */
bool input_released(Action a); /* released since last consume */
void input_shutdown(void);
/* Returns true if SDL_QUIT was received */
bool input_quit_requested(void);
#endif /* JNR_INPUT_H */