Modele3D.h 913 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef MODELE3D_H
  2. #define MODELE3D_H
  3. // Macro utile au VBO
  4. #ifndef BUFFER_OFFSET
  5. #define BUFFER_OFFSET(offset) ((char*)NULL + (offset))
  6. #endif
  7. #include <iostream>
  8. #include <vector>
  9. #include <fstream>
  10. #include "../Shader.h"
  11. #include "../Texture.h"
  12. // Includes GLM
  13. #include <glm/glm.hpp>
  14. #define GLM_ENABLE_EXPERIMENTAL
  15. #include <glm/gtx/transform.hpp>
  16. #include <glm/gtc/type_ptr.hpp>
  17. class Modele3D
  18. {
  19. public:
  20. Modele3D();
  21. virtual ~Modele3D();
  22. void afficher(glm::mat4 pmv, glm::mat4 m, Shader* const shad);
  23. protected:
  24. GLuint m_textID;
  25. GLuint m_nbVec;
  26. float *m_vertices; // Tableau
  27. float *m_coordTexture; // Tableau
  28. float *m_normales; // Tableau
  29. GLuint m_vboID;
  30. int m_tailleVerticesBytes;
  31. int m_tailleCoordTextureBytes;
  32. int m_tailleNormalesBytes;
  33. GLuint m_vaoID;
  34. };
  35. #endif // MODELE3D_H