Refactor mesh handling to use templated vertex structures for improved type safety and flexibility

This commit is contained in:
REDxEYE
2025-04-13 17:14:28 +03:00
parent bba647db5c
commit 1ffbeb8148
28 changed files with 591 additions and 521 deletions
+9 -5
View File
@@ -12,12 +12,16 @@
PostProcessing::PostProcessing(size_t effectSlotsCount)
: effectSlots(effectSlotsCount) {
// Fullscreen quad mesh bulding
float vertices[] {
-1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f,
-1.0f, -1.0f, 1.0f, 1.0f, 1.0f, -1.0f
PostProcessingVertex meshData[]{
{{-1.0f, -1.0f}},
{{-1.0f, 1.0f}},
{{1.0f, 1.0f}},
{{-1.0f, -1.0f}},
{{1.0f, 1.0f}},
{{1.0f, -1.0f}},
};
VertexAttribute attrs[] {{2}, {0}};
quadMesh = std::make_unique<Mesh>(vertices, 6, attrs);
quadMesh = std::make_unique<Mesh<PostProcessingVertex>>(meshData, 6, PostProcessingVertex::ATTRIBUTES);
}
PostProcessing::~PostProcessing() = default;