Add render resource handling for geometry

This commit is contained in:
Georg Hagen
2024-08-21 14:33:45 +02:00
parent b13c1c54ae
commit 2d08b3ab91
6 changed files with 59 additions and 68 deletions

View File

@@ -7,6 +7,7 @@
#pragma once
#include "Base/ICloseable.hpp"
#include "Base/Render/RenderResource.hpp"
#include "Math/AABB.hpp"
#include "Base/Utils.hpp"
#include <string>
@@ -24,7 +25,7 @@ namespace OpenVulkano
UINT16 = sizeof(uint16_t), UINT32 = sizeof(uint32_t)
};
class Geometry : public ICloseable
class Geometry : public RenderResourceHolder<Geometry>, public ICloseable
{
public:
uint32_t vertexCount = 0, indexCount = 0;
@@ -33,7 +34,6 @@ namespace OpenVulkano
VertexIndexType indexType = VertexIndexType::UINT16;
bool ownsMemory = true, freeAfterUpload = true;
Math::AABB aabb;
ICloseable* renderGeo = nullptr;
public:
Geometry() = default;
Geometry(const Geometry& other);