vOOlkan
An object oriented approach to Vulkan
TextureImage.h
Go to the documentation of this file.
1#ifndef VULKAN_TEXTUREIMAGE
2#define VULKAN_TEXTUREIMAGE
3
4#include <vulkan/vulkan.h>
5#include <string>
6#include <utility>
7
8#include "TextureSampler.h"
9#include "Image.h"
10
11
12namespace Vulkan {
13 class TextureImage; class LogicalDevice; class PhysicalDevice; class CommandBufferPool; class TextureSampler;
14 namespace Buffers { class StagingBuffer; }
15}
16
17
19public:
20 TextureImage(const LogicalDevice& virtualGpu, const PhysicalDevice& realGpu, const CommandBufferPool& commandBufferPool, std::pair<unsigned int, unsigned int> resolution, std::string pathToTexture);
21
22 TextureImage(const TextureImage&) = delete;
25 TextureImage& operator=(TextureImage&& movedFrom) = default;
26
27 ~TextureImage() = default;
28
29
30
37 void transitionLayout(VkImageLayout newLayout, const CommandBufferPool& commandBufferPool);
38
39
46 void fillImage(const Buffers::StagingBuffer& imageData, const CommandBufferPool& commandBufferPool);
47
48
49 const TextureSampler& getSampler() const;
50
51private:
52 TextureSampler textureSampler; //how the image is filtered before accessing (e.g. anisotropic)
53
54};
55
56
57
58#endif
Definition: StagingBuffer.h:14
A CommandBufferPool is an object which is used to allocate CommandBuffers.
Definition: CommandBufferPool.h:14
An Image is an object representing what can be passed to the swapchain: the content of the image is w...
Definition: Image.h:19
std::pair< unsigned int, unsigned int > resolution
Definition: Image.h:126
LogicalDevice const * virtualGpu
Definition: Image.h:129
A logical device is an abstraction of the physical GPU which we can mainly use to send commands.
Definition: LogicalDevice.h:15
Represents the GPU (or any other device) that will be used with Vulkan to perform computer graphics.
Definition: PhysicalDevice.h:17
Definition: TextureImage.h:18
void transitionLayout(VkImageLayout newLayout, const CommandBufferPool &commandBufferPool)
Changes the layout of the image.
Definition: TextureImage.cpp:51
TextureImage(const LogicalDevice &virtualGpu, const PhysicalDevice &realGpu, const CommandBufferPool &commandBufferPool, std::pair< unsigned int, unsigned int > resolution, std::string pathToTexture)
Definition: TextureImage.cpp:16
void fillImage(const Buffers::StagingBuffer &imageData, const CommandBufferPool &commandBufferPool)
Fills the image with the data stored in the buffer.
Definition: TextureImage.cpp:66
TextureImage(TextureImage &&)=default
const TextureSampler & getSampler() const
Definition: TextureImage.cpp:87
TextureImage & operator=(const TextureImage &)=delete
TextureImage & operator=(TextureImage &&movedFrom)=default
TextureImage(const TextureImage &)=delete
A TextureSampler is an object which is used to apply filters (anisotropic, interpolation,...
Definition: TextureSampler.h:16
Types of queue families.
Definition: Animations.h:17