Open Source Tomb Raider Engine
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

WindowGLFW.h 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 <glm/vec2.hpp>
  10. #include <glm/gtc/type_precision.hpp>
  11. #include <GLFW/glfw3.h>
  12. class WindowGLFW {
  13. public:
  14. static int initialize();
  15. static void eventHandling();
  16. static void swapBuffers();
  17. static void shutdown();
  18. static void setSize(glm::i32vec2 s);
  19. static glm::i32vec2 getSize() { return size; }
  20. static void setFullscreen(bool f);
  21. static bool getFullscreen() { return fullscreen; }
  22. static void setMousegrab(bool g);
  23. static bool getMousegrab() { return mousegrab; }
  24. static void setTextInput(bool t);
  25. static bool getTextInput() { return textinput; }
  26. private:
  27. static void errorCallback(int error, const char* desc);
  28. static void sizeCallback(GLFWwindow* w, int width, int height);
  29. static void cursorCallback(GLFWwindow* w, double xpos, double ypos);
  30. static void keyCallback(GLFWwindow* w, int key, int scancode, int action, int mods);
  31. static void buttonCallback(GLFWwindow* w, int button, int action, int mods);
  32. static void scrollCallback(GLFWwindow* w, double xoffset, double yoffset);
  33. static KeyboardButton convertAsciiButton(int key);
  34. static glm::i32vec2 size;
  35. static bool fullscreen;
  36. static bool mousegrab;
  37. static bool textinput;
  38. static GLFWwindow* window;
  39. static int lastMouseX;
  40. static int lastMouseY;
  41. static bool modShift;
  42. static bool modControl;
  43. static bool modAlt;
  44. static bool modSuper;
  45. };
  46. #endif