source:
opengl-game/game-gui-sdl.hpp@
4e2c709
| Last change on this file since 4e2c709 was d8cf709, checked in by , 5 years ago | |
|---|---|
|
|
| File size: 950 bytes | |
| Rev | Line | |
|---|---|---|
| [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> |
| [a6f6833] | 7 | |
| 8 | #ifdef GAMEGUI_INCLUDE_VULKAN | |
| 9 | #include <SDL2/SDL_vulkan.h> | |
| 10 | #endif | |
| [0e6ecf3] | 11 | |
| [98f3232] | 12 | class GameGui_SDL : public GameGui { |
| [f898c5f] | 13 | public: |
| [cd1cb0f] | 14 | GameGui_SDL(); |
| 15 | ||
| [7fc5e27] | 16 | string& getError(); |
| [d5f2b42] | 17 | |
| [7fc5e27] | 18 | bool init(); |
| 19 | void shutdown(); | |
| [0e6ecf3] | 20 | |
| [7fc5e27] | 21 | void* createWindow(const string& title, int width, int height, bool fullscreen); |
| 22 | void destroyWindow(); | |
| [0e6ecf3] | 23 | |
| [f6521fb] | 24 | void processEvents(); |
| [d8cf709] | 25 | int pollEvent(UIEvent* uiEvent); |
| [cd1cb0f] | 26 | bool keyPressed(unsigned int key); |
| [f6521fb] | 27 | |
| [a6f6833] | 28 | void refreshWindowSize(); |
| 29 | int getWindowWidth(); | |
| 30 | int getWindowHeight(); | |
| 31 | ||
| [4eb4d0a] | 32 | #ifdef GAMEGUI_INCLUDE_VULKAN |
| [7fc5e27] | 33 | bool createVulkanSurface(VkInstance instance, VkSurfaceKHR* surface); |
| 34 | vector<const char*> getRequiredExtensions(); | |
| [a6f6833] | 35 | #endif |
| [0e6ecf3] | 36 | |
| 37 | private: | |
| 38 | SDL_Window* window; | |
| [a6f6833] | 39 | int windowWidth, windowHeight; |
| [cd1cb0f] | 40 | const Uint8* keyState; |
| [d5f2b42] | 41 | |
| [c324d6a] | 42 | string s_errorMessage; |
| [0e6ecf3] | 43 | }; |
| 44 | ||
| 45 | #endif // _GAME_GUI_SDL_H |
Note:
See TracBrowser
for help on using the repository browser.
![(please configure the [header_logo] section in trac.ini)](/medieval/chrome/site/your_project_logo.png)