OpenRaider  0.1.4-dev
Open Source Tomb Raider Game Engine implementation
WindowGLFW.h
Go to the documentation of this file.
1 
8 #ifndef _WINDOW_GLFW_H_
9 #define _WINDOW_GLFW_H_
10 
11 #include <glm/gtc/type_precision.hpp>
12 
13 #include <GLFW/glfw3.h>
14 
15 class WindowGLFW {
16  public:
17  static int initialize();
18  static void eventHandling();
19  static void swapBuffers();
20  static void shutdown();
21 
22  static void setSize(glm::i32vec2 s);
23  static glm::i32vec2 getSize() { return size; }
24 
25  static void setFullscreen(bool f);
26  static bool getFullscreen() { return fullscreen; }
27 
28  static void setMousegrab(bool g);
29  static bool getMousegrab() { return mousegrab; }
30 
31  static void setTextInput(bool t);
32  static bool getTextInput() { return textinput; }
33 
34  static void setClipboard(const char* s);
35  static const char* getClipboard();
36 
37  static void inputPositionCallback(int x, int y);
38 
39  private:
40  static void errorCallback(int error, const char* desc);
41  static void sizeCallback(GLFWwindow* w, int width, int height);
42  static void cursorCallback(GLFWwindow* w, double xpos, double ypos);
43  static void keyCallback(GLFWwindow* w, int key, int scancode, int action, int mods);
44  static void buttonCallback(GLFWwindow* w, int button, int action, int mods);
45  static void scrollCallback(GLFWwindow* w, double xoffset, double yoffset);
46 
47  static KeyboardButton convertAsciiButton(int key);
48 
49  static glm::i32vec2 size;
50  static bool fullscreen;
51  static bool mousegrab;
52  static bool textinput;
53  static GLFWwindow* window;
54  static int lastMouseX;
55  static int lastMouseY;
56  static bool modShift;
57  static bool modControl;
58  static bool modAlt;
59  static bool modSuper;
60 };
61 
62 #endif
63 
static void swapBuffers()
Definition: WindowGLFW.cpp:72
static GLFWwindow * window
Definition: WindowGLFW.h:53
static void setFullscreen(bool f)
Definition: WindowGLFW.cpp:94
static void eventHandling()
Definition: WindowGLFW.cpp:62
static void cursorCallback(GLFWwindow *w, double xpos, double ypos)
Definition: WindowGLFW.cpp:139
static bool getFullscreen()
Definition: WindowGLFW.h:26
static glm::i32vec2 size
Definition: WindowGLFW.h:49
static bool modAlt
Definition: WindowGLFW.h:58
static bool fullscreen
Definition: WindowGLFW.h:50
static void setClipboard(const char *s)
Definition: WindowGLFW.cpp:114
static bool modControl
Definition: WindowGLFW.h:57
KeyboardButton
Definition: global.h:34
static bool textinput
Definition: WindowGLFW.h:52
static int lastMouseX
Definition: WindowGLFW.h:54
static bool mousegrab
Definition: WindowGLFW.h:51
static void setMousegrab(bool g)
Definition: WindowGLFW.cpp:99
static void scrollCallback(GLFWwindow *w, double xoffset, double yoffset)
Definition: WindowGLFW.cpp:228
static void error(char *msg)
Definition: commander.c:19
static KeyboardButton convertAsciiButton(int key)
Definition: WindowGLFW.cpp:232
static int initialize()
Definition: WindowGLFW.cpp:27
static int lastMouseY
Definition: WindowGLFW.h:55
static void buttonCallback(GLFWwindow *w, int button, int action, int mods)
Definition: WindowGLFW.cpp:185
static bool modShift
Definition: WindowGLFW.h:56
static void errorCallback(int error, const char *desc)
Definition: WindowGLFW.cpp:130
static bool modSuper
Definition: WindowGLFW.h:59
static bool getTextInput()
Definition: WindowGLFW.h:32
static const char * getClipboard()
Definition: WindowGLFW.cpp:119
static bool getMousegrab()
Definition: WindowGLFW.h:29
static void sizeCallback(GLFWwindow *w, int width, int height)
Definition: WindowGLFW.cpp:134
static void setTextInput(bool t)
Definition: WindowGLFW.cpp:110
static void inputPositionCallback(int x, int y)
Definition: WindowGLFW.cpp:126
static void keyCallback(GLFWwindow *w, int key, int scancode, int action, int mods)
Definition: WindowGLFW.cpp:147
static glm::i32vec2 getSize()
Definition: WindowGLFW.h:23
static void shutdown()
Definition: WindowGLFW.cpp:76
static void setSize(glm::i32vec2 s)
Definition: WindowGLFW.cpp:84