Open Source Tomb Raider Engine
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

WindowGLFW.h 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*!
  2. * \file include/system/WindowGLFW.h
  3. * \brief GLFW windowing implementation
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _WINDOW_GLFW_H_
  8. #define _WINDOW_GLFW_H_
  9. #include <GLFW/glfw3.h>
  10. class WindowGLFW {
  11. public:
  12. static int initialize();
  13. static void eventHandling();
  14. static void swapBuffers();
  15. static void shutdown();
  16. static void setSize(glm::vec2 s);
  17. static glm::vec2 getSize() { return size; }
  18. static void setFullscreen(bool f);
  19. static bool getFullscreen() { return fullscreen; }
  20. static void setMousegrab(bool g);
  21. static bool getMousegrab() { return mousegrab; }
  22. static void setTextInput(bool t);
  23. static bool getTextInput() { return textinput; }
  24. private:
  25. static void errorCallback(int error, const char* desc);
  26. static void sizeCallback(GLFWwindow* w, int width, int height);
  27. static void cursorCallback(GLFWwindow* w, double xpos, double ypos);
  28. static void keyCallback(GLFWwindow* w, int key, int scancode, int action, int mods);
  29. static void buttonCallback(GLFWwindow* w, int button, int action, int mods);
  30. static void scrollCallback(GLFWwindow* w, double xoffset, double yoffset);
  31. static KeyboardButton convertAsciiButton(int key);
  32. static glm::vec2 size;
  33. static bool fullscreen;
  34. static bool mousegrab;
  35. static bool textinput;
  36. static GLFWwindow* window;
  37. static int lastMouseX;
  38. static int lastMouseY;
  39. static bool modShift;
  40. static bool modControl;
  41. static bool modAlt;
  42. static bool modSuper;
  43. };
  44. #endif