Advertisement
Geklmin

Mesh.h for benny's opengl thingamajig

Jan 8th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. //Mesh.h, by Geklmin and Bennybox
  2.  
  3. #ifndef MESH_H
  4. #define MESH_H
  5. //#include "vgl.h"
  6. #include <GL3/gl3w.h>
  7. #include <GL3/gl3.h>
  8. #include <glm/glm.hpp>
  9. #include <cstdlib>
  10. #include <vector>
  11.  
  12. #include <GLFW/glfw3.h>
  13.  
  14. #include "LoadShaders.h"
  15. class Vertex
  16. {
  17. public:
  18. Vertex(const glm::vec3& pos){
  19. this->pos = pos;
  20. }
  21. glm::vec3 pos;
  22.  
  23. glm::vec3* getPos(){
  24. return &pos;
  25. }
  26.  
  27. virtual ~Vertex() {}
  28.  
  29. protected:
  30. private:
  31. };
  32.  
  33. class Mesh
  34. {
  35. public:
  36. Mesh(Vertex* vertices, unsigned int numVertices);
  37.  
  38. void Draw();
  39.  
  40. virtual ~Mesh();
  41.  
  42. protected:
  43. private:
  44.  
  45. enum {
  46. POSITION_VB,
  47. NUM_BUFFERS
  48. };
  49. GLuint m_vertexArrayObject;
  50. GLuint m_vertexArrayBuffers[NUM_BUFFERS];
  51. unsigned int m_drawCount;
  52. };
  53.  
  54. #endif // Mesh_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement