From 6be3193593d6fe6dc36e584a44ec629a44fc394b Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 25 Apr 2025 21:19:44 +0200 Subject: First Commit --- include/glamac_events.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 include/glamac_events.h (limited to 'include/glamac_events.h') diff --git a/include/glamac_events.h b/include/glamac_events.h new file mode 100644 index 0000000..47ecb74 --- /dev/null +++ b/include/glamac_events.h @@ -0,0 +1,36 @@ +/** + * glamac_events.h - header file from glamac_events.c. + * + * Copyright (C) 2025 https://optics-design.com + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * See the COPYING file for the full license text. + */ +#ifndef GLAMAC_EVENTS_H +#define GLAMAC_EVENTS_H + +#include +#include "glamacdef.h" +#include "glamac_view.h" + +// Process key event +b32 process_key_event(SDL_KeyboardEvent *key, ViewState *view, SDL_Window *window, b32 *quit); + +// Process mouse button event +b32 process_mouse_button(SDL_MouseButtonEvent *button, ViewState *view, i32 *lastMouseX, i32 *lastMouseY, b32 *dragging); + +// Process mouse motion event +b32 process_mouse_motion(SDL_MouseMotionEvent *motion, ViewState *view, i32 *lastMouseX, i32 *lastMouseY, b32 dragging); + +// Process window event +b32 process_window_event(SDL_WindowEvent *window_event, ViewState *view); + +// Process all events on queue +b32 process_events(SDL_Event *event, ViewState *view, SDL_Window *window, + i32 *lastMouseX, i32 *lastMouseY, b32 *dragging, b32 *quit); + +#endif /* GLAMAC_EVENTS_H */ -- cgit v1.2.3