feature/imgui-sdl
|
Last change
on this file since aa7707d was b8d4456, checked in by Dmitry Portnoy <dmitry.portnoy@…>, 6 years ago |
|
Add x and y coordinates to mouse events
|
-
Property mode
set to
100644
|
|
File size:
981 bytes
|
| Line | |
|---|
| 1 | #ifndef _GAME_GUI_SDL_H
|
|---|
| 2 | #define _GAME_GUI_SDL_H
|
|---|
| 3 |
|
|---|
| 4 | #include "game-gui.hpp"
|
|---|
| 5 |
|
|---|
| 6 | #include <SDL2/SDL.h>
|
|---|
| 7 | #include <SDL2/SDL_ttf.h>
|
|---|
| 8 |
|
|---|
| 9 | #ifdef GAMEGUI_INCLUDE_VULKAN
|
|---|
| 10 | #include <SDL2/SDL_vulkan.h>
|
|---|
| 11 | #endif
|
|---|
| 12 |
|
|---|
| 13 | class GameGui_SDL : public GameGui {
|
|---|
| 14 | public:
|
|---|
| 15 | GameGui_SDL();
|
|---|
| 16 |
|
|---|
| 17 | string& getError();
|
|---|
| 18 |
|
|---|
| 19 | bool init();
|
|---|
| 20 | void shutdown();
|
|---|
| 21 |
|
|---|
| 22 | void* createWindow(const string& title, int width, int height, bool fullscreen);
|
|---|
| 23 | void destroyWindow();
|
|---|
| 24 |
|
|---|
| 25 | void processEvents();
|
|---|
| 26 | int pollEvent(UIEvent* event);
|
|---|
| 27 | bool keyPressed(unsigned int key);
|
|---|
| 28 |
|
|---|
| 29 | void refreshWindowSize();
|
|---|
| 30 | int getWindowWidth();
|
|---|
| 31 | int getWindowHeight();
|
|---|
| 32 |
|
|---|
| 33 | #ifdef GAMEGUI_INCLUDE_VULKAN
|
|---|
| 34 | bool createVulkanSurface(VkInstance instance, VkSurfaceKHR* surface);
|
|---|
| 35 | vector<const char*> getRequiredExtensions();
|
|---|
| 36 | #endif
|
|---|
| 37 |
|
|---|
| 38 | private:
|
|---|
| 39 | SDL_Window* window;
|
|---|
| 40 | int windowWidth, windowHeight;
|
|---|
| 41 | const Uint8* keyState;
|
|---|
| 42 |
|
|---|
| 43 | static string s_errorMessage;
|
|---|
| 44 | };
|
|---|
| 45 |
|
|---|
| 46 | #endif // _GAME_GUI_SDL_H
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.