VertexBuffer.h 722 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef VERTEXBUFFER_H
  2. #define VERTEXBUFFER_H
  3. #include <GL/glew.h>
  4. #include "utils/Types.h"
  5. class VertexBuffer final {
  6. public:
  7. VertexBuffer();
  8. ~VertexBuffer();
  9. VertexBuffer(const VertexBuffer& other) = delete;
  10. VertexBuffer(VertexBuffer&& other) = delete;
  11. VertexBuffer& operator=(const VertexBuffer& other) = delete;
  12. VertexBuffer& operator=(VertexBuffer&& other) = delete;
  13. void setFloatAttribute(uint index, uint length, uint offset, uint step);
  14. void setData(u64 size, const void* data);
  15. void bindArray() const;
  16. void bindBuffer() const;
  17. void bind() const;
  18. void draw(uint vertices) const;
  19. private:
  20. GLuint vertexArray;
  21. GLuint vertexBuffer;
  22. };
  23. #endif