diff options
author | tylermurphy534 <tylermurphy534@gmail.com> | 2022-09-20 22:02:58 -0400 |
---|---|---|
committer | tylermurphy534 <tylermurphy534@gmail.com> | 2022-09-20 22:02:58 -0400 |
commit | 249f6c9fa384e9e3265cafb1357e502ea7db72f7 (patch) | |
tree | 0c80d9a375453e9178dd5d45807302b00f57bd59 /engine/xe_image.hpp | |
parent | destroy pipline layout (diff) | |
download | minecraftvulkan-249f6c9fa384e9e3265cafb1357e502ea7db72f7.tar.gz minecraftvulkan-249f6c9fa384e9e3265cafb1357e502ea7db72f7.tar.bz2 minecraftvulkan-249f6c9fa384e9e3265cafb1357e502ea7db72f7.zip |
texture loading
Diffstat (limited to 'engine/xe_image.hpp')
-rw-r--r-- | engine/xe_image.hpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/engine/xe_image.hpp b/engine/xe_image.hpp new file mode 100644 index 0000000..c3ffe4f --- /dev/null +++ b/engine/xe_image.hpp @@ -0,0 +1,35 @@ +#pragma once + +#include "xe_device.hpp" + +#include <string> + +namespace xe { + +class XeImage { + + public: + + XeImage(XeDevice &xeDevice, const std::string &filename); + ~XeImage(); + + XeImage(const XeImage&) = delete; + XeImage operator=(const XeImage&) = delete; + + private: + + void createTextureImage(const std::string &filename); + void createImage(uint32_t width, uint32_t height, VkFormat format, VkImageTiling tiling, VkImageUsageFlags usage, VkMemoryPropertyFlags properties, VkImage& image, VkDeviceMemory& imageMemory); + void transitionImageLayout(VkImage image, VkFormat format, VkImageLayout oldLayout, VkImageLayout newLayout); + void copyBufferToImage(VkBuffer buffer, VkImage image, uint32_t width, uint32_t height); + + XeDevice &xeDevice; + + VkImage textureImage; + VkDeviceMemory textureImageMemory; + + friend class XeRenderSystem; + +}; + +} |