X-Git-Url: https://eleni.mutantstargoat.com/git/?p=winnie;a=blobdiff_plain;f=src%2Fevent.h;h=e4ac2869d8290da7bf11796b9c3ae3d5c6eb3446;hp=0c2ccd24984c4a77290e298522ee3cd8cca95fd1;hb=fb1f0ff6ab479c68cbac5c2d55de5c2beb229efd;hpb=0860ce537422597075fbc63ddcc9a73303362a93 diff --git a/src/event.h b/src/event.h index 0c2ccd2..e4ac286 100644 --- a/src/event.h +++ b/src/event.h @@ -1,19 +1,20 @@ #ifndef EVENT_H_ #define EVENT_H_ -typedef void (*DisplayFuncType)(); -typedef void (*KeyboardFuncType)(int key, bool pressed); -typedef void (*MouseButtonFuncType)(int bn, bool pressed); -typedef void (*MouseMotionFuncType)(int x, int y); +class Window; -void set_display_callback(DisplayFuncType display); -void set_keyboard_callback(KeyboardFuncType keyboard); -void set_mouse_button_callback(MouseButtonFuncType mouse_button); -void set_mouse_motion_callback(MouseMotionFuncType mouse_motion); +typedef void (*DisplayFuncType)(Window* win); +typedef void (*KeyboardFuncType)(Window* win, int key, bool pressed); +typedef void (*MouseButtonFuncType)(Window *win, int bn, bool pressed); +typedef void (*MouseMotionFuncType)(Window *win, int x, int y); -DisplayFuncType get_display_callback(); -KeyboardFuncType get_keyboard_callback(); -MouseButtonFuncType get_mouse_button_callback(); -MouseMotionFuncType get_mouse_motion_callback(); +struct Callbacks { + DisplayFuncType display; + KeyboardFuncType keyboard; + MouseButtonFuncType button; + MouseMotionFuncType motion; +}; + +void process_events(); #endif