source: opengl-game/game-gui-sdl.hpp@ 78c3045

feature/imgui-sdl
Last change on this file since 78c3045 was b8d4456, checked in by Dmitry Portnoy <dmitry.portnoy@…>, 4 years ago

Add x and y coordinates to mouse events

  • Property mode set to 100644
File size: 981 bytes
RevLine 
[0e6ecf3]1#ifndef _GAME_GUI_SDL_H
2#define _GAME_GUI_SDL_H
3
[98f3232]4#include "game-gui.hpp"
[f898c5f]5
[0e6ecf3]6#include <SDL2/SDL.h>
[5f3dba8]7#include <SDL2/SDL_ttf.h>
[a6f6833]8
9#ifdef GAMEGUI_INCLUDE_VULKAN
10 #include <SDL2/SDL_vulkan.h>
11#endif
[0e6ecf3]12
[98f3232]13class GameGui_SDL : public GameGui {
[f898c5f]14 public:
[cd1cb0f]15 GameGui_SDL();
16
[7fc5e27]17 string& getError();
[d5f2b42]18
[7fc5e27]19 bool init();
20 void shutdown();
[0e6ecf3]21
[7fc5e27]22 void* createWindow(const string& title, int width, int height, bool fullscreen);
23 void destroyWindow();
[0e6ecf3]24
[f6521fb]25 void processEvents();
26 int pollEvent(UIEvent* event);
[cd1cb0f]27 bool keyPressed(unsigned int key);
[f6521fb]28
[a6f6833]29 void refreshWindowSize();
30 int getWindowWidth();
31 int getWindowHeight();
32
[4eb4d0a]33#ifdef GAMEGUI_INCLUDE_VULKAN
[7fc5e27]34 bool createVulkanSurface(VkInstance instance, VkSurfaceKHR* surface);
35 vector<const char*> getRequiredExtensions();
[a6f6833]36#endif
[0e6ecf3]37
38 private:
39 SDL_Window* window;
[a6f6833]40 int windowWidth, windowHeight;
[cd1cb0f]41 const Uint8* keyState;
[d5f2b42]42
43 static string s_errorMessage;
[0e6ecf3]44};
45
46#endif // _GAME_GUI_SDL_H
Note: See TracBrowser for help on using the repository browser.