deallocate pipeline in renderer on pipeline destroy

This commit is contained in:
h4570
2022-07-30 18:17:48 +02:00
parent 1bdb33e1a6
commit 927c10e82a
6 changed files with 20 additions and 3 deletions
@@ -16,12 +16,13 @@ namespace Tyra {
class Renderer3DPipeline {
public:
Renderer3DPipeline() {}
Renderer3DPipeline() { onDestroy = nullptr; }
~Renderer3DPipeline() {}
virtual void setRenderer(RendererCore* core) = 0;
virtual void onUse() = 0;
virtual void onUseEnd() = 0;
std::function<void(Renderer3DPipeline*)> onDestroy;
};
} // namespace Tyra
+2
View File
@@ -19,10 +19,12 @@ class Renderer3D {
Renderer3D();
~Renderer3D();
/** Deinitialize previous pipeline and initialize new pipeline */
void usePipeline(Renderer3DPipeline* pipeline);
private:
Renderer3DPipeline* currentPipeline;
void onDestroy(Renderer3DPipeline* pipeline);
};
} // namespace Tyra