12345678910111213141516171819202122232425262728293031 |
- #ifndef VERTEXBUFFER_H
- #define VERTEXBUFFER_H
- #include <GL/glew.h>
- #include "utils/Types.h"
- class VertexBuffer final {
- public:
- VertexBuffer();
- ~VertexBuffer();
- VertexBuffer(const VertexBuffer& other) = delete;
- VertexBuffer(VertexBuffer&& other) = delete;
- VertexBuffer& operator=(const VertexBuffer& other) = delete;
- VertexBuffer& operator=(VertexBuffer&& other) = delete;
-
- void setFloatAttribute(uint index, uint length, uint offset, uint step);
- void setData(u64 size, const void* data);
-
- void bindArray() const;
- void bindBuffer() const;
- void bind() const;
-
- void draw(uint vertices) const;
- private:
- GLuint vertexArray;
- GLuint vertexBuffer;
- };
- #endif
|