#ifndef _GAME_GUI_H #define _GAME_GUI_H #include #include #ifdef GAMEGUI_INCLUDE_VULKAN #include #endif using namespace std; enum EventType { UI_EVENT_QUIT, UI_EVENT_WINDOW, UI_EVENT_WINDOWRESIZE, UI_EVENT_KEY, UI_EVENT_MOUSEBUTTONDOWN, UI_EVENT_MOUSEBUTTONUP, UI_EVENT_MOUSEMOTION, UI_EVENT_UNKNOWN }; struct WindowEvent { EventType type; }; struct KeyEvent { EventType type; unsigned int keycode; }; struct MouseEvent { EventType type; /* int button; int action; int x; int y; */ }; struct WindowResizeEvent { EventType type; int width; int height; }; struct UnknownEvent { EventType type; unsigned int eventType; }; union UIEvent { EventType type; WindowEvent window; KeyEvent key; MouseEvent mouse; WindowResizeEvent windowResize; UnknownEvent unknown; }; class GameGui { public: virtual ~GameGui() {}; virtual string& getError() = 0; virtual bool init() = 0; virtual void shutdown() = 0; virtual void* createWindow(const string& title, int width, int height, bool fullscreen) = 0; virtual void destroyWindow() = 0; virtual void processEvents() = 0; virtual int pollEvent(UIEvent* event) = 0; virtual void refreshWindowSize() = 0; virtual int getWindowWidth() = 0; virtual int getWindowHeight() = 0; #ifdef GAMEGUI_INCLUDE_VULKAN virtual bool createVulkanSurface(VkInstance instance, VkSurfaceKHR* surface) = 0; virtual vector getRequiredExtensions() = 0; #endif }; #endif // _GAME_GUI_H