source: opengl-game/game-gui-sdl.hpp@ 0ecab17

feature/imgui-sdl points-test
Last change on this file since 0ecab17 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
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_image.h>
8#include <SDL2/SDL_ttf.h>
[a6f6833]9
10#ifdef GAMEGUI_INCLUDE_VULKAN
11 #include <SDL2/SDL_vulkan.h>
12#endif
[0e6ecf3]13
[98f3232]14class GameGui_SDL : public GameGui {
[f898c5f]15 public:
[cd1cb0f]16 GameGui_SDL();
17
[7fc5e27]18 string& getError();
[d5f2b42]19
[7fc5e27]20 bool init();
21 void shutdown();
[0e6ecf3]22
[7fc5e27]23 void* createWindow(const string& title, int width, int height, bool fullscreen);
24 void destroyWindow();
[0e6ecf3]25
[f6521fb]26 void processEvents();
27 int pollEvent(UIEvent* event);
[cd1cb0f]28 bool keyPressed(unsigned int key);
[f6521fb]29
[a6f6833]30 void refreshWindowSize();
31 int getWindowWidth();
32 int getWindowHeight();
33
[4eb4d0a]34#ifdef GAMEGUI_INCLUDE_VULKAN
[7fc5e27]35 bool createVulkanSurface(VkInstance instance, VkSurfaceKHR* surface);
36 vector<const char*> getRequiredExtensions();
[a6f6833]37#endif
[0e6ecf3]38
39 private:
40 SDL_Window* window;
[a6f6833]41 int windowWidth, windowHeight;
[cd1cb0f]42 const Uint8* keyState;
[d5f2b42]43
44 static string s_errorMessage;
[0e6ecf3]45};
46
47#endif // _GAME_GUI_SDL_H
Note: See TracBrowser for help on using the repository browser.