Cube.h 871 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef DEF_CUBE
  2. #define DEF_CUBE
  3. // Include Windows
  4. #ifdef WIN32
  5. #include <GL/glew.h>
  6. // Include Mac
  7. #elif __APPLE__
  8. #define GL3_PROTOTYPES 1
  9. #include <OpenGL/gl3.h>
  10. // Include UNIX/Linux
  11. #else
  12. #define GL3_PROTOTYPES 1
  13. #include <GLES3/gl3.h>
  14. #endif
  15. // Includes GLM
  16. #include <glm/glm.hpp>
  17. #define GLM_ENABLE_EXPERIMENTAL
  18. #include <glm/gtx/transform.hpp>
  19. #include <glm/gtc/type_ptr.hpp>
  20. // Includes
  21. #include "macro.h"
  22. #include "Shader.h"
  23. // Classe Cube
  24. class Cube
  25. {
  26. public:
  27. Cube(float taille);
  28. ~Cube();
  29. void charger();
  30. void afficher(glm::mat4 &projection, glm::mat4 &modelview);
  31. void updateVBO(void *donnees, int tailleBytes, int decalage);
  32. protected:
  33. float m_vertices[108];
  34. float m_couleurs[108];
  35. GLuint m_vboID;
  36. int m_tailleVerticesBytes;
  37. int m_tailleCouleursBytes;
  38. GLuint m_vaoID;
  39. };
  40. #endif