123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- #ifndef DEF_CUBE
- #define DEF_CUBE
- // Include Windows
- #ifdef WIN32
- #include <GL/glew.h>
- // Include Mac
- #elif __APPLE__
- #define GL3_PROTOTYPES 1
- #include <OpenGL/gl3.h>
- // Include UNIX/Linux
- #else
- #define GL3_PROTOTYPES 1
- #include <GLES3/gl3.h>
- #endif
- // Includes GLM
- #include <glm/glm.hpp>
- #define GLM_ENABLE_EXPERIMENTAL
- #include <glm/gtx/transform.hpp>
- #include <glm/gtc/type_ptr.hpp>
- // Includes
- #include "macro.h"
- #include "Shader.h"
- // Classe Cube
- class Cube
- {
- public:
- Cube(float taille);
- ~Cube();
- void charger();
- void afficher(glm::mat4 &projection, glm::mat4 &modelview);
- void updateVBO(void *donnees, int tailleBytes, int decalage);
- protected:
- float m_vertices[108];
- float m_couleurs[108];
- GLuint m_vboID;
- int m_tailleVerticesBytes;
- int m_tailleCouleursBytes;
- GLuint m_vaoID;
- };
- #endif
|