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.

Window.h 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*!
  2. * \file include/system/Window.h
  3. * \brief Windowing interface
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _WINDOW_H_
  8. #define _WINDOW_H_
  9. #include <vector>
  10. #include <glm/mat4x4.hpp>
  11. #include <glm/vec2.hpp>
  12. #include <glm/vec3.hpp>
  13. #include <glm/vec4.hpp>
  14. #include "Shader.h"
  15. class Window {
  16. public:
  17. static int initialize();
  18. static void eventHandling();
  19. static void swapBuffers();
  20. static void shutdown();
  21. static void setSize(glm::vec2 s);
  22. static glm::vec2 getSize();
  23. static void setFullscreen(bool f);
  24. static bool getFullscreen();
  25. static void setMousegrab(bool g);
  26. static bool getMousegrab();
  27. static void setTextInput(bool t);
  28. static bool getTextInput();
  29. static void drawTextGL(std::vector<glm::vec2>& vertices, std::vector<glm::vec2>& uvs,
  30. glm::vec4 color, unsigned int texture);
  31. static void drawGL(std::vector<glm::vec3>& vertices, std::vector<glm::vec2>& uvs,
  32. std::vector<unsigned short>& indices, glm::mat4 MVP, unsigned int texture);
  33. static void drawGL(std::vector<glm::vec3>& vertices, std::vector<glm::vec3>& colors,
  34. std::vector<unsigned short>& indices, glm::mat4 MVP, int mode = GL_TRIANGLES);
  35. private:
  36. static int initializeGL();
  37. static void shutdownGL();
  38. static Shader textShader;
  39. static const char* textShaderVertex;
  40. static const char* textShaderFragment;
  41. static Shader imguiShader;
  42. static const char* imguiShaderVertex;
  43. static const char* imguiShaderFragment;
  44. friend class UI;
  45. static Shader textureShader;
  46. static const char* textureShaderVertex;
  47. static const char* textureShaderFragment;
  48. static Shader colorShader;
  49. static const char* colorShaderVertex;
  50. static const char* colorShaderFragment;
  51. static unsigned int vertexArrayID;
  52. };
  53. #endif