mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-09 04:51:49 +00:00
remove Mesh constructor 'attrs' argument & format Mesh.hpp
This commit is contained in:
parent
47b7472231
commit
e357a4eb9f
13 changed files with 46 additions and 42 deletions
|
|
@ -8,35 +8,40 @@ struct MeshStats {
|
|||
static int drawCalls;
|
||||
};
|
||||
|
||||
|
||||
template<typename VertexStructure>
|
||||
template <typename VertexStructure>
|
||||
class Mesh {
|
||||
unsigned int vao;
|
||||
unsigned int vbo;
|
||||
unsigned int ibo;
|
||||
size_t vertexCount;
|
||||
size_t indexCount;
|
||||
size_t vertexSize;
|
||||
|
||||
public:
|
||||
explicit Mesh(const MeshData<VertexStructure> &data);
|
||||
explicit Mesh(const MeshData<VertexStructure>& data);
|
||||
|
||||
Mesh(const VertexStructure *vertexBuffer, size_t vertices, const uint32_t *indexBuffer, size_t indices,
|
||||
const VertexAttribute *attrs);
|
||||
Mesh(
|
||||
const VertexStructure* vertexBuffer,
|
||||
size_t vertices,
|
||||
const uint32_t* indexBuffer,
|
||||
size_t indices
|
||||
);
|
||||
|
||||
Mesh(const VertexStructure *vertexBuffer, size_t vertices, const VertexAttribute *attrs) : Mesh<VertexStructure>(
|
||||
vertexBuffer, vertices, nullptr, 0, attrs) {
|
||||
};
|
||||
Mesh(const VertexStructure* vertexBuffer, size_t vertices)
|
||||
: Mesh<VertexStructure>(vertexBuffer, vertices, nullptr, 0) {};
|
||||
|
||||
~Mesh();
|
||||
|
||||
/// @brief Update GL vertex and index buffers data without changing VAO attributes
|
||||
/// @brief Update GL vertex and index buffers data without changing VAO
|
||||
/// attributes
|
||||
/// @param vertexBuffer vertex data buffer
|
||||
/// @param vertexCount number of vertices in new buffer
|
||||
/// @param indexBuffer indices buffer
|
||||
/// @param indexCount number of values in indices buffer
|
||||
void reload(const VertexStructure *vertexBuffer, size_t vertexCount, const uint32_t *indexBuffer = nullptr,
|
||||
size_t indexCount = 0);
|
||||
void reload(
|
||||
const VertexStructure* vertexBuffer,
|
||||
size_t vertexCount,
|
||||
const uint32_t* indexBuffer = nullptr,
|
||||
size_t indexCount = 0
|
||||
);
|
||||
|
||||
/// @brief Draw mesh with specified primitives type
|
||||
/// @param primitive primitives type
|
||||
|
|
@ -44,8 +49,6 @@ public:
|
|||
|
||||
/// @brief Draw mesh as triangles
|
||||
void draw() const;
|
||||
|
||||
/// @brief Total numbers of alive mesh objects
|
||||
};
|
||||
|
||||
#include "graphics/core/Mesh.inl"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue