remove GLEW from MeshData.hpp & format Mesh.inl

This commit is contained in:
MihailRis
2025-04-27 00:35:54 +03:00
parent ec0dbae3f7
commit 47b7472231
10 changed files with 125 additions and 70 deletions
+21
View File
@@ -2,6 +2,7 @@
#include "commons.hpp"
#include "ImageData.hpp"
#include "MeshData.hpp"
#include <GL/glew.h>
@@ -23,4 +24,24 @@ namespace gl {
};
return primitives[static_cast<int>(primitive)];
}
inline GLenum to_glenum(VertexAttribute::Type type) {
using Type = VertexAttribute::Type;
switch (type) {
case Type::FLOAT:
return GL_FLOAT;
case Type::UNSIGNED_INT:
return GL_UNSIGNED_INT;
case Type::INT:
return GL_INT;
case Type::UNSIGNED_SHORT:
return GL_UNSIGNED_SHORT;
case Type::SHORT:
return GL_SHORT;
case Type::UNSIGNED_BYTE:
return GL_UNSIGNED_BYTE;
case Type::BYTE:
return GL_BYTE;
}
}
}