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