feature/imgui-sdl
points-test
Last change
on this file since 0fe8433 was cd1cb0f, checked in by Dmitry Portnoy <dmitry.portnoy@…>, 5 years ago |
In VulkanGame, make the ship move when the player holds down the right or left arrow keys
|
-
Property mode
set to
100644
|
File size:
1009 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_image.h>
|
---|
8 | #include <SDL2/SDL_ttf.h>
|
---|
9 |
|
---|
10 | #ifdef GAMEGUI_INCLUDE_VULKAN
|
---|
11 | #include <SDL2/SDL_vulkan.h>
|
---|
12 | #endif
|
---|
13 |
|
---|
14 | class GameGui_SDL : public GameGui {
|
---|
15 | public:
|
---|
16 | GameGui_SDL();
|
---|
17 |
|
---|
18 | string& getError();
|
---|
19 |
|
---|
20 | bool init();
|
---|
21 | void shutdown();
|
---|
22 |
|
---|
23 | void* createWindow(const string& title, int width, int height, bool fullscreen);
|
---|
24 | void destroyWindow();
|
---|
25 |
|
---|
26 | void processEvents();
|
---|
27 | int pollEvent(UIEvent* event);
|
---|
28 | bool keyPressed(unsigned int key);
|
---|
29 |
|
---|
30 | void refreshWindowSize();
|
---|
31 | int getWindowWidth();
|
---|
32 | int getWindowHeight();
|
---|
33 |
|
---|
34 | #ifdef GAMEGUI_INCLUDE_VULKAN
|
---|
35 | bool createVulkanSurface(VkInstance instance, VkSurfaceKHR* surface);
|
---|
36 | vector<const char*> getRequiredExtensions();
|
---|
37 | #endif
|
---|
38 |
|
---|
39 | private:
|
---|
40 | SDL_Window* window;
|
---|
41 | int windowWidth, windowHeight;
|
---|
42 | const Uint8* keyState;
|
---|
43 |
|
---|
44 | static string s_errorMessage;
|
---|
45 | };
|
---|
46 |
|
---|
47 | #endif // _GAME_GUI_SDL_H
|
---|
Note:
See
TracBrowser
for help on using the repository browser.