feature/imgui-sdl
points-test
Last change
on this file since 27c40ce 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
|
Line | |
---|
1 | #ifndef _GAME_GUI_GLFW_H
|
---|
2 | #define _GAME_GUI_GLFW_H
|
---|
3 |
|
---|
4 | #include "game-gui.hpp"
|
---|
5 |
|
---|
6 | #ifdef GAMEGUI_INCLUDE_VULKAN
|
---|
7 | #define GLFW_INCLUDE_VULKAN
|
---|
8 | #endif
|
---|
9 |
|
---|
10 | #include <GLFW/glfw3.h>
|
---|
11 |
|
---|
12 | #define NUM_KEYS (512)
|
---|
13 |
|
---|
14 | class GameGui_GLFW : public GameGui {
|
---|
15 | public:
|
---|
16 | static string s_errorMessage; // Has to be public so that glfw_error_callback can access it
|
---|
17 |
|
---|
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 |
|
---|
23 | string& getError();
|
---|
24 |
|
---|
25 | bool init();
|
---|
26 | void shutdown();
|
---|
27 |
|
---|
28 | void* createWindow(const string& title, int width, int height, bool fullscreen);
|
---|
29 | void destroyWindow();
|
---|
30 |
|
---|
31 | #ifdef GAMEGUI_INCLUDE_VULKAN
|
---|
32 | bool createVulkanSurface(VkInstance instance, VkSurfaceKHR* surface);
|
---|
33 | #endif
|
---|
34 |
|
---|
35 | vector<const char*> getRequiredExtensions();
|
---|
36 | void getWindowSize(int* width, int* height);
|
---|
37 |
|
---|
38 | private:
|
---|
39 | GLFWwindow* window;
|
---|
40 |
|
---|
41 | int windowWidth, windowHeight;
|
---|
42 | };
|
---|
43 |
|
---|
44 | void glfw_error_callback(int error, const char* description);
|
---|
45 | void glfw_key_callback(GLFWwindow* window, int key, int scancode, int action, int mods);
|
---|
46 |
|
---|
47 | #endif // _GAME_GUI_GLFW_H
|
---|
Note:
See
TracBrowser
for help on using the repository browser.