Vulkan Schnee 0.0.1
High-performance rendering engine
Loading...
Searching...
No Matches
CubemapTexture.h
Go to the documentation of this file.
1#pragma once
2
3#include <array>
4#include <cstdint>
5#include <filesystem>
6#include <string>
7#include <vector>
8
9#include <vulkan/vulkan_core.h>
10
11namespace Engine::Core
12{
14}
15
16namespace Engine::Assets
17{
19 {
20 uint32_t width = 0;
21 uint32_t height = 0;
22 std::array<std::vector<uint8_t>, 6> faces;
23 std::string uri;
24 };
25
27 {
28 public:
29 CubemapTextureData loadFromDirectory( const std::filesystem::path & directory ) const;
30 };
31
33 {
34 public:
35 CubemapTexture() = default;
38
39 CubemapTexture( const CubemapTexture & ) = delete;
41 CubemapTexture( CubemapTexture && other ) noexcept;
42 CubemapTexture & operator=( CubemapTexture && other ) noexcept;
43
44 void createResourcesAndUpload( VkCommandPool commandPool, VkQueue queue );
45 void cleanup();
46
47 [[nodiscard]] VkDescriptorImageInfo getDescriptorInfo() const;
48 [[nodiscard]] bool isValid() const { return imageView_ != VK_NULL_HANDLE && sampler_ != VK_NULL_HANDLE; }
49
50 private:
53 VkImage image_ = VK_NULL_HANDLE;
54 VkDeviceMemory memory_ = VK_NULL_HANDLE;
55 VkImageView imageView_ = VK_NULL_HANDLE;
56 VkSampler sampler_ = VK_NULL_HANDLE;
57
59 };
60}
CubemapTextureData loadFromDirectory(const std::filesystem::path &directory) const
CubemapTexture(CubemapTexture &&other) noexcept
CubemapTexture & operator=(CubemapTexture &&other) noexcept
Core::ApplicationContext * context_
void createResourcesAndUpload(VkCommandPool commandPool, VkQueue queue)
CubemapTexture & operator=(const CubemapTexture &)=delete
CubemapTexture(CubemapTextureData data, Core::ApplicationContext *context)
VkDescriptorImageInfo getDescriptorInfo() const
CubemapTexture(const CubemapTexture &)=delete
The application context is the core class which stores the basic openxr and vulkan objects.
Core audio subsystem owning the miniaudio engine and managing playback.
Definition AudioConfig.h:9
std::array< std::vector< uint8_t >, 6 > faces