CG-Project2
Loading...
Searching...
No Matches
ElementBuffer.hpp
1#pragma once
2
3#include "Buffer.hpp"
4#include <cstddef>
5
6namespace ogl {
7class ElementBuffer : public Buffer {
8 public:
9 template <typename T> inline void setup(const T *indices, const size_t &size, const unsigned int &usage) const {
10 this->bind();
11 glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(T) * size, indices, usage);
12 }
13
14 virtual void onAttach() override;
15 virtual void onDetach() override;
16
17 virtual void bind() const override;
18 virtual void unbind() const override;
19
20 ElementBuffer() = default;
21 ~ElementBuffer() override;
22};
23} // namespace ogl