Refactor mesh handling to use templated vertex structures for improved type safety and flexibility
This commit is contained in:
@@ -2,14 +2,25 @@
|
||||
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <glm/glm.hpp>
|
||||
#include "MeshData.hpp"
|
||||
|
||||
class Mesh;
|
||||
template<typename VertexStructure> class Mesh;
|
||||
class Assets;
|
||||
class Framebuffer;
|
||||
class DrawContext;
|
||||
class ImageData;
|
||||
class PostEffect;
|
||||
|
||||
struct PostProcessingVertex {
|
||||
glm::vec2 position;
|
||||
|
||||
static constexpr VertexAttribute ATTRIBUTES[] {
|
||||
{GL_FLOAT,false,2},
|
||||
{0}
|
||||
};
|
||||
};
|
||||
|
||||
/// @brief Framebuffer with blitting with shaders.
|
||||
/// @attention Current implementation does not support multiple render passes
|
||||
/// for multiple effects. Will be implemented in v0.21
|
||||
@@ -18,7 +29,7 @@ class PostProcessing {
|
||||
std::unique_ptr<Framebuffer> fbo;
|
||||
std::unique_ptr<Framebuffer> fboSecond;
|
||||
/// @brief Fullscreen quad mesh as the post-processing canvas
|
||||
std::unique_ptr<Mesh> quadMesh;
|
||||
std::unique_ptr<Mesh<PostProcessingVertex>> quadMesh;
|
||||
std::vector<std::shared_ptr<PostEffect>> effectSlots;
|
||||
public:
|
||||
PostProcessing(size_t effectSlotsCount);
|
||||
|
||||
Reference in New Issue
Block a user