light/modules/renderer/public/vertex_layout.hpp

54 lines
732 B
C++
Raw Normal View History

2022-03-08 21:19:19 +03:30
#pragma once
2025-07-20 04:46:15 +03:30
#include <lt_debug/assertions.hpp>
2022-03-08 21:19:19 +03:30
2025-07-11 00:05:48 +03:30
namespace lt {
2022-03-08 21:19:19 +03:30
class VertexBuffer;
class Shader;
class SharedContext;
enum class VertexElementType
{
Byte1,
Byte2,
Byte4,
UByte1,
UByte2,
UByte4,
Int1,
Int2,
Int3,
Int4,
UInt1,
UInt2,
UInt3,
UInt4,
Float1,
Float2,
Float3,
Float4,
};
class VertexLayout
{
public:
2025-07-06 14:02:50 +03:30
static auto create(
const Ref<VertexBuffer> &vertexBuffer,
const Ref<Shader> &shader,
2025-07-05 13:28:41 +03:30
const std::vector<std::pair<std::string, VertexElementType>> &elements,
const Ref<SharedContext> &sharedContext
2025-07-06 14:02:50 +03:30
) -> Ref<VertexLayout>;
2022-03-08 21:19:19 +03:30
virtual ~VertexLayout() = default;
virtual void bind() = 0;
2025-07-05 16:07:51 +03:30
virtual void un_bind() = 0;
2022-03-08 21:19:19 +03:30
protected:
VertexLayout() = default;
};
2025-07-11 00:05:48 +03:30
} // namespace lt