feature/imgui-sdl
points-test
|
Last change
on this file since f6521fb was f6521fb, checked in by Dmitry Portnoy <dmitry.portnoy@…>, 6 years ago |
|
Add processEvents() and pollEvent() to GameGui, implement them for GameGui_SDL, and add a union for different event types, similar to the SDL_Event union
|
-
Property mode
set to
100644
|
|
File size:
1.0 KB
|
| 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_image.h>
|
|---|
| 8 | #include <SDL2/SDL_ttf.h>
|
|---|
| 9 | #include <SDL2/SDL_vulkan.h>
|
|---|
| 10 |
|
|---|
| 11 | class GameGui_SDL : public GameGui {
|
|---|
| 12 | public:
|
|---|
| 13 | string& getError();
|
|---|
| 14 |
|
|---|
| 15 | bool init();
|
|---|
| 16 | void shutdown();
|
|---|
| 17 |
|
|---|
| 18 | void* createWindow(const string& title, int width, int height, bool fullscreen);
|
|---|
| 19 | void destroyWindow();
|
|---|
| 20 |
|
|---|
| 21 | void processEvents();
|
|---|
| 22 | int pollEvent(UIEvent* event);
|
|---|
| 23 |
|
|---|
| 24 | // temporary
|
|---|
| 25 | //int pollEvent(SDL_Event* event);
|
|---|
| 26 |
|
|---|
| 27 | /*
|
|---|
| 28 | void processEvents();
|
|---|
| 29 |
|
|---|
| 30 | unsigned char getKeyEvent(unsigned int key);
|
|---|
| 31 | bool isKeyPressed(unsigned int key);
|
|---|
| 32 |
|
|---|
| 33 | int pollMouseEvent(MouseEvent* event);
|
|---|
| 34 | */
|
|---|
| 35 |
|
|---|
| 36 | #ifdef GAMEGUI_INCLUDE_VULKAN
|
|---|
| 37 | bool createVulkanSurface(VkInstance instance, VkSurfaceKHR* surface);
|
|---|
| 38 | #endif
|
|---|
| 39 |
|
|---|
| 40 | vector<const char*> getRequiredExtensions();
|
|---|
| 41 | void getWindowSize(int* width, int* height);
|
|---|
| 42 |
|
|---|
| 43 | private:
|
|---|
| 44 | SDL_Window* window;
|
|---|
| 45 |
|
|---|
| 46 | static string s_errorMessage;
|
|---|
| 47 | };
|
|---|
| 48 |
|
|---|
| 49 | #endif // _GAME_GUI_SDL_H
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.