mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 12:31:51 +00:00
add MeshData
This commit is contained in:
parent
d41ec3a019
commit
5c6b73ee2b
3 changed files with 45 additions and 4 deletions
29
src/graphics/core/MeshData.hpp
Normal file
29
src/graphics/core/MeshData.hpp
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "typedefs.hpp"
|
||||
#include "util/Buffer.hpp"
|
||||
|
||||
/// @brief Vertex attribute info
|
||||
struct vattr {
|
||||
ubyte size;
|
||||
};
|
||||
|
||||
/// @brief Raw mesh data structure
|
||||
struct MeshData {
|
||||
util::Buffer<float> vertices;
|
||||
util::Buffer<int> indices;
|
||||
util::Buffer<vattr> attrs;
|
||||
|
||||
/// @param vertices vertex data buffer
|
||||
/// @param indices nullable indices buffer
|
||||
/// @param attrs vertex attribute sizes (must be null-terminated)
|
||||
MeshData(
|
||||
util::Buffer<float> vertices,
|
||||
util::Buffer<int> indices,
|
||||
util::Buffer<vattr> attrs
|
||||
) : vertices(std::move(vertices)),
|
||||
indices(std::move(indices)),
|
||||
attrs(std::move(attrs)) {}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue