mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 04:21:50 +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
|
|
@ -18,7 +18,7 @@ struct VertexAttribute {
|
|||
bool normalized = false;
|
||||
ubyte count = 0;
|
||||
|
||||
[[nodiscard]] uint32_t size() const {
|
||||
[[nodiscard]] constexpr uint32_t size() const {
|
||||
switch (type) {
|
||||
case Type::FLOAT:
|
||||
return count * sizeof(float);
|
||||
|
|
@ -31,9 +31,8 @@ struct VertexAttribute {
|
|||
case Type::UNSIGNED_BYTE:
|
||||
case Type::BYTE:
|
||||
return count * sizeof(int8_t);
|
||||
default:
|
||||
throw std::runtime_error("VertexAttribute type is not supported");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue