From 9d0262e8a2cbc722e0ff01058994c4ead1dbe0e5 Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Wed, 28 Sep 2022 09:38:25 -0400 Subject: better model and texture cleanup --- engine/xe_image.hpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'engine/xe_image.hpp') diff --git a/engine/xe_image.hpp b/engine/xe_image.hpp index bc1dad2..7884dd6 100644 --- a/engine/xe_image.hpp +++ b/engine/xe_image.hpp @@ -3,6 +3,7 @@ #include "xe_device.hpp" #include +#include namespace xe { @@ -10,7 +11,9 @@ class Image { public: - Image(const std::string &filename, bool anisotropic); + static Image* createImage(const std::string &filename, bool anisotropic); + static void deleteImage(Image* image); + ~Image(); Image(const Image&) = delete; @@ -18,6 +21,10 @@ class Image { private: + static void submitDeleteQueue(bool purge); + + Image(const std::string &filename, bool anisotropic); + void createTextureImage(const std::string &filename); void transitionImageLayout(VkImage image, VkFormat format, VkImageLayout oldLayout, VkImageLayout newLayout); void generateMipmaps(VkImage image, VkFormat imageFormat, int32_t texWidth, int32_t texHeight, uint32_t mipLevels); @@ -38,6 +45,7 @@ class Image { friend class RenderSystem; friend class SwapChain; + friend class Engine; }; -- cgit v1.2.3-freya