Refactor mesh handling to use templated vertex structures for improved type safety and flexibility
This commit is contained in:
@@ -6,17 +6,23 @@
|
||||
#include <glm/glm.hpp>
|
||||
#include "typedefs.hpp"
|
||||
#include "maths/fastmaths.hpp"
|
||||
#include "graphics/core/MeshData.hpp"
|
||||
|
||||
class Mesh;
|
||||
template<typename VertexStructure> class Mesh;
|
||||
class Shader;
|
||||
class Assets;
|
||||
class Camera;
|
||||
class Batch3D;
|
||||
class Shader;
|
||||
class Cubemap;
|
||||
class Framebuffer;
|
||||
class DrawContext;
|
||||
|
||||
struct SkyboxVertex {
|
||||
glm::vec2 position;
|
||||
|
||||
static constexpr VertexAttribute ATTRIBUTES[] {{GL_FLOAT,false,2}, {0}};
|
||||
};
|
||||
|
||||
struct skysprite {
|
||||
std::string texture;
|
||||
float phase;
|
||||
@@ -32,7 +38,7 @@ class Skybox {
|
||||
FastRandom random;
|
||||
glm::vec3 lightDir;
|
||||
|
||||
std::unique_ptr<Mesh> mesh;
|
||||
std::unique_ptr<Mesh<SkyboxVertex>> mesh;
|
||||
std::unique_ptr<Batch3D> batch3d;
|
||||
std::vector<skysprite> sprites;
|
||||
int frameid = 0;
|
||||
|
||||
Reference in New Issue
Block a user