source: opengl-game/game-gui-glfw.hpp@ 7bf5433

feature/imgui-sdl points-test
Last change on this file since 7bf5433 was 7bf5433, checked in by Dmitry Portnoy <dmp1488@…>, 5 years ago

Create a new OpenGLGame project for a refactor of the original OpenGL game to make copying its logic over to the Vulkan implementation easier

  • Property mode set to 100644
File size: 1.5 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
12class GameGui_GLFW : public GameGui {
13 public:
14 static string s_errorMessage; // Has to be public so that glfw_error_callback can access it
15
16 // Both have to be public so that glfw_key_callback can access them
17 // TODO: Implement a more generic public api over this to get the key state
18 static int s_keyState[GLFW_KEY_LAST];
19 static bool s_keyDown[GLFW_KEY_LAST];
20
21 string& getError();
22
23 bool init();
24 void shutdown();
25
26 void* createWindow(const string& title, int width, int height, bool fullscreen);
27 void destroyWindow();
28
29 /*
30 void processEvents();
31
32 unsigned char getKeyEvent(unsigned int key);
33 bool isKeyPressed(unsigned int key);
34
35 int pollMouseEvent(MouseEvent* event);
36 */
37
38#ifdef GAMEGUI_INCLUDE_VULKAN
39 bool createVulkanSurface(VkInstance instance, VkSurfaceKHR* surface);
40#endif
41
42 vector<const char*> getRequiredExtensions();
43 void getWindowSize(int* width, int* height);
44
45 private:
46 GLFWwindow* window;
47
48 int windowWidth, windowHeight;
49};
50
51void glfw_error_callback(int error, const char* description);
52void glfw_mouse_button_callback(GLFWwindow* window, int button, int action, int mods);
53void glfw_key_callback(GLFWwindow* window, int key, int scancode, int action, int mods);
54
55#endif // _GAME_GUI_GLFW_H
Note: See TracBrowser for help on using the repository browser.