feature/imgui-sdl
points-test
Last change
on this file since ed7c953 was 7fc5e27, checked in by Dmitry Portnoy <dmitry.portnoy@…>, 5 years ago |
Change all game-gui function names to lower camel case
|
-
Property mode
set to
100644
|
File size:
1.2 KB
|
Rev | Line | |
---|
[0e6ecf3] | 1 | #ifndef _GAME_GUI_GLFW_H
|
---|
| 2 | #define _GAME_GUI_GLFW_H
|
---|
| 3 |
|
---|
| 4 | #include "game-gui.hpp"
|
---|
| 5 |
|
---|
[4eb4d0a] | 6 | #ifdef GAMEGUI_INCLUDE_VULKAN
|
---|
| 7 | #define GLFW_INCLUDE_VULKAN
|
---|
| 8 | #endif
|
---|
| 9 |
|
---|
[0e6ecf3] | 10 | #include <GLFW/glfw3.h>
|
---|
| 11 |
|
---|
[1ce9afe] | 12 | #define NUM_KEYS (512)
|
---|
| 13 |
|
---|
[0e6ecf3] | 14 | class GameGui_GLFW : public GameGui {
|
---|
| 15 | public:
|
---|
[d8cb15e] | 16 | static string s_errorMessage; // Has to be public so that glfw_error_callback can access it
|
---|
| 17 |
|
---|
[1ce9afe] | 18 | // Both have to be public so that glfw_key_callback can access them
|
---|
| 19 | // TODO: Implement a more generic public api over this to get the key state
|
---|
| 20 | static int s_keyState[NUM_KEYS];
|
---|
| 21 | static bool s_keyDown[NUM_KEYS];
|
---|
| 22 |
|
---|
[7fc5e27] | 23 | string& getError();
|
---|
[1ce9afe] | 24 |
|
---|
[7fc5e27] | 25 | bool init();
|
---|
| 26 | void shutdown();
|
---|
[0e6ecf3] | 27 |
|
---|
[7fc5e27] | 28 | void* createWindow(const string& title, int width, int height, bool fullscreen);
|
---|
| 29 | void destroyWindow();
|
---|
[0e6ecf3] | 30 |
|
---|
[4eb4d0a] | 31 | #ifdef GAMEGUI_INCLUDE_VULKAN
|
---|
[7fc5e27] | 32 | bool createVulkanSurface(VkInstance instance, VkSurfaceKHR* surface);
|
---|
[4eb4d0a] | 33 | #endif
|
---|
| 34 |
|
---|
[7fc5e27] | 35 | vector<const char*> getRequiredExtensions();
|
---|
| 36 | void getWindowSize(int* width, int* height);
|
---|
[0e6ecf3] | 37 |
|
---|
| 38 | private:
|
---|
| 39 | GLFWwindow* window;
|
---|
[7fc5e27] | 40 |
|
---|
| 41 | int windowWidth, windowHeight;
|
---|
[0e6ecf3] | 42 | };
|
---|
| 43 |
|
---|
[d8cb15e] | 44 | void glfw_error_callback(int error, const char* description);
|
---|
[1ce9afe] | 45 | void glfw_key_callback(GLFWwindow* window, int key, int scancode, int action, int mods);
|
---|
[d8cb15e] | 46 |
|
---|
[0e6ecf3] | 47 | #endif // _GAME_GUI_GLFW_H |
---|
Note:
See
TracBrowser
for help on using the repository browser.