34 lines
624 B
C++
34 lines
624 B
C++
|
#pragma once
|
||
|
|
||
|
#include "Base/Base.hpp"
|
||
|
#include "Graphics/VertexLayout.hpp"
|
||
|
|
||
|
namespace Light {
|
||
|
|
||
|
class VertexBuffer;
|
||
|
|
||
|
struct glVertexElementDesc
|
||
|
{
|
||
|
unsigned int type;
|
||
|
unsigned int count;
|
||
|
unsigned int typeSize;
|
||
|
unsigned int offset;
|
||
|
};
|
||
|
|
||
|
class glVertexLayout: public VertexLayout
|
||
|
{
|
||
|
private:
|
||
|
unsigned int m_ArrayID;
|
||
|
|
||
|
public:
|
||
|
glVertexLayout(Ref<VertexBuffer> buffer, const std::vector<std::pair<std::string, VertexElementType>>& elements);
|
||
|
~glVertexLayout();
|
||
|
|
||
|
void Bind() override;
|
||
|
void UnBind() override;
|
||
|
|
||
|
private:
|
||
|
glVertexElementDesc GetElementDesc(VertexElementType type, unsigned int offset);
|
||
|
};
|
||
|
|
||
|
} // namespace Light
|