source: opengl-game/game-gui-glfw.hpp@ a6f6833

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

Remove getWindowSize() from game-gui and instead add getWindowWidth(), getWindowHeight(), and refreshWindowSize() (which updates the internal variables returned by the first two functions)

  • Property mode set to 100644
File size: 1.3 KB
Line 
1#ifndef _GAME_GUI_GLFW_H
2#define _GAME_GUI_GLFW_H
3
4#include <queue>
5
6#include "game-gui.hpp"
7
8#ifdef GAMEGUI_INCLUDE_VULKAN
9 #define GLFW_INCLUDE_VULKAN
10#else
11 #include <GL/glew.h>
12#endif
13
14#include <GLFW/glfw3.h>
15
16class GameGui_GLFW : public GameGui {
17 public:
18 static string s_errorMessage; // Has to be public so that glfw_error_callback can access it
19
20 // Has to be public so that glfw_key_callback can access it
21 static queue<UIEvent> s_events;
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 void processEvents();
32 int pollEvent(UIEvent* event);
33
34 void refreshWindowSize();
35 int getWindowWidth();
36 int getWindowHeight();
37
38#ifdef GAMEGUI_INCLUDE_VULKAN
39 bool createVulkanSurface(VkInstance instance, VkSurfaceKHR* surface);
40 vector<const char*> getRequiredExtensions();
41#endif
42
43 private:
44 GLFWwindow* window;
45 int windowWidth, windowHeight;
46};
47
48void glfw_error_callback(int error, const char* description);
49void glfw_mouse_button_callback(GLFWwindow* window, int button, int action, int mods);
50void glfw_key_callback(GLFWwindow* window, int key, int scancode, int action, int mods);
51
52#endif // _GAME_GUI_GLFW_H
Note: See TracBrowser for help on using the repository browser.