X-Git-Url: http://git.mutantstargoat.com?a=blobdiff_plain;f=src%2Fevent.h;h=a51113f94937572c5e65e61d0d56e11400883491;hb=f634e2d68f3f5b4ba5645891b2c8110f48e80129;hp=0c2ccd24984c4a77290e298522ee3cd8cca95fd1;hpb=0860ce537422597075fbc63ddcc9a73303362a93;p=winnie diff --git a/src/event.h b/src/event.h index 0c2ccd2..a51113f 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, int x, int y); +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