Surface3D.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef SURFACE3D_H_INCLUDED
  2. #define SURFACE3D_H_INCLUDED
  3. // Includes OpenGL
  4. #ifdef WIN32
  5. #include <GL/glew.h>
  6. #else
  7. #define GL3_PROTOTYPES 1
  8. #include <GLES3/gl3.h>
  9. #endif
  10. // Includes GLM
  11. #include <glm/glm.hpp>
  12. #define GLM_ENABLE_EXPERIMENTAL
  13. #include <glm/gtx/transform.hpp>
  14. #include <glm/gtc/type_ptr.hpp>
  15. // Includes
  16. #include <iostream>
  17. #include "Shader.h"
  18. #include "Texture.h"
  19. #include "macro.h"
  20. class Surface3D
  21. {
  22. public:
  23. Surface3D(float tailleX, float tailleY, std::string const fichierImage, float multi=1); // Détruira la texture
  24. Surface3D(float tailleX, float tailleY, GLuint samplerID, float multi=1); // Ne détruira pas la texture
  25. ~Surface3D();
  26. void afficher(glm::mat4 pmv, Shader const &shad);
  27. void charger();
  28. private:
  29. Texture* m_texture;
  30. GLuint m_textID;
  31. float m_vertices[18];
  32. float m_coordTexture[12];
  33. GLuint m_vboID;
  34. int m_tailleVerticesBytes;
  35. int m_tailleCoordTextureBytes;
  36. GLuint m_vaoID;
  37. };
  38. #endif // SURFACE3D_H_INCLUDED