From 4151c3429a95991717c7141f441a77217fd61d7e Mon Sep 17 00:00:00 2001 From: Sara Date: Fri, 20 Sep 2024 12:35:45 +0200 Subject: [PATCH] feat: created skeleton input module --- src/core/input.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/core/input.h diff --git a/src/core/input.h b/src/core/input.h new file mode 100644 index 0000000..61d505d --- /dev/null +++ b/src/core/input.h @@ -0,0 +1,32 @@ +#ifndef INPUT_H +#define INPUT_H + +#include "stdbool.h" + +typedef enum InputListenerType { + INPUT_LISTENER_INT, + INPUT_LISTENER_BOOL, + INPUT_LISTENER_FLOAT, +} InputListenerType; + +typedef void(*IntListener)(int); +typedef void(*BoolListener)(bool); +typedef void(*FloatListener)(float); + +typedef struct InputListener { + void *object; + InputListenerType type; + union { + IntListener int_listener; + BoolListener bool_listener; + FloatListener float_listener; + }; +} InputListener; + +void InitInputSubmodule(); +void CleanInputSubmodule(); + +void AddListener(); +void RemoveListener(); + +#endif // !INPUT_H