i forgot
This commit is contained in:
parent
5811d3676a
commit
988a429f16
|
@ -7,7 +7,7 @@ namespace lol
|
|||
class ElementBuffer : public Buffer
|
||||
{
|
||||
public:
|
||||
ElementBuffer(size_t count, unsigned int* elements, Usage usage = Usage::StaticDraw);
|
||||
ElementBuffer(size_t count, const std::vector<unsigned int>& elements, Usage usage = Usage::StaticDraw);
|
||||
|
||||
inline size_t GetCount() const { return count; }
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace lol
|
|||
class VertexBuffer : public Buffer
|
||||
{
|
||||
public:
|
||||
VertexBuffer(size_t size, float* data, Usage usage = Usage::StaticDraw);
|
||||
VertexBuffer(size_t size, const std::vector<float>& data, Usage usage = Usage::StaticDraw);
|
||||
|
||||
inline void SetLayout(const BufferLayout& layout) { this->layout = layout; };
|
||||
inline const BufferLayout& GetLayout() { return layout; }
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
namespace lol
|
||||
{
|
||||
ElementBuffer::ElementBuffer(size_t count, unsigned int* elements, Usage usage) :
|
||||
ElementBuffer::ElementBuffer(size_t count, const std::vector<unsigned int>& elements, Usage usage) :
|
||||
Buffer(BufferType::ElementArray), count(count)
|
||||
{
|
||||
glBufferData(NATIVE(type), count * sizeof(unsigned int), elements, NATIVE(usage));
|
||||
glBufferData(NATIVE(type), count * sizeof(unsigned int), elements.data(), NATIVE(usage));
|
||||
}
|
||||
}
|
|
@ -15,9 +15,9 @@ namespace lol
|
|||
}
|
||||
|
||||
|
||||
VertexBuffer::VertexBuffer(size_t size, float* data, Usage usage) :
|
||||
VertexBuffer::VertexBuffer(size_t size, const std::vector<float>& data, Usage usage) :
|
||||
Buffer(BufferType::Array), layout{}
|
||||
{
|
||||
glBufferData(NATIVE(type), size * sizeof(float), (void*)data, NATIVE(usage));
|
||||
glBufferData(NATIVE(type), size * sizeof(float), data.data(), NATIVE(usage));
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue