Refactor mesh handling to use templated vertex structures for improved type safety and flexibility
This commit is contained in:
@@ -5,12 +5,21 @@
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
#include "commons.hpp"
|
||||
#include "MeshData.hpp"
|
||||
|
||||
template<typename VertexStructure>
|
||||
class Mesh;
|
||||
|
||||
struct LineVertex {
|
||||
glm::vec3 position;
|
||||
glm::vec4 color;
|
||||
|
||||
static constexpr VertexAttribute ATTRIBUTES[] { {GL_FLOAT,false,3},{GL_FLOAT,false,4}, {0} };
|
||||
};
|
||||
|
||||
class LineBatch : public Flushable {
|
||||
std::unique_ptr<Mesh> mesh;
|
||||
std::unique_ptr<float[]> buffer;
|
||||
std::unique_ptr<Mesh<LineVertex>> mesh;
|
||||
std::unique_ptr<LineVertex[]> buffer;
|
||||
size_t index;
|
||||
size_t capacity;
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user