vOOlkan
An object oriented approach to Vulkan
Vulkan::TextureImage Class Reference

#include <TextureImage.h>

Inheritance diagram for Vulkan::TextureImage:
Vulkan::Image

Public Member Functions

 TextureImage (const LogicalDevice &virtualGpu, const PhysicalDevice &realGpu, const CommandBufferPool &commandBufferPool, std::pair< unsigned int, unsigned int > resolution, std::string pathToTexture)
 
 TextureImage (const TextureImage &)=delete
 
TextureImageoperator= (const TextureImage &)=delete
 
 TextureImage (TextureImage &&)=default
 
TextureImageoperator= (TextureImage &&movedFrom)=default
 
 ~TextureImage ()=default
 
void transitionLayout (VkImageLayout newLayout, const CommandBufferPool &commandBufferPool)
 Changes the layout of the image. More...
 
void fillImage (const Buffers::StagingBuffer &imageData, const CommandBufferPool &commandBufferPool)
 Fills the image with the data stored in the buffer. More...
 
const TextureSamplergetSampler () const
 
- Public Member Functions inherited from Vulkan::Image
 Image (const VkImage &image, const LogicalDevice &virtualGpu, VkFormat format, std::pair< unsigned int, unsigned int > resolution)
 
 Image (const Image &)=delete
 
Imageoperator= (const Image &)=delete
 
 Image (Image &&) noexcept
 
Imageoperator= (Image &&) noexcept
 
 ~Image ()
 
const VkImage & operator+ () const
 
VkFormat getFormat () const
 Returns the format of the image, which is the same format of all the images in the swapchain of this image. More...
 
const ImageViewgenerateImageView (std::string tag, const LogicalDevice &virtualGpu, VkImageAspectFlags type=VK_IMAGE_ASPECT_COLOR_BIT)
 Creates a new image view for this image, and adds it to the array of image views of this image, on last position. More...
 
void eliminateImageView (std::string tag)
 Eliminates the specified image view. More...
 
const ImageViewoperator[] (std::string tag) const
 Returns the image view associated with the tag. More...
 
const std::map< std::string, ImageView > & getImageViews () const
 Returns all the image views of this image. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Vulkan::Image
 Image ()
 
template<std::same_as< VkMemoryPropertyFlagBits >... P>
 Image (const LogicalDevice &virtualGpu, const PhysicalDevice &realGpu, VkFormat format, std::pair< unsigned int, unsigned int > resolution, VkImageTiling tiling, VkImageUsageFlags usage, P... memoryProperties)
 
- Protected Attributes inherited from Vulkan::Image
VkImage image
 
VkFormat format
 
VkImageLayout layout
 
std::pair< unsigned int, unsigned int > resolution
 
std::map< std::string, ImageViewviews
 
VkDeviceMemory allocatedMemory
 
LogicalDevice const * virtualGpu
 
bool isSwapchainImage
 

Constructor & Destructor Documentation

◆ TextureImage() [1/3]

Vulkan::TextureImage::TextureImage ( const LogicalDevice virtualGpu,
const PhysicalDevice realGpu,
const CommandBufferPool commandBufferPool,
std::pair< unsigned int, unsigned int >  resolution,
std::string  pathToTexture 
)

◆ TextureImage() [2/3]

Vulkan::TextureImage::TextureImage ( const TextureImage )
delete

◆ TextureImage() [3/3]

Vulkan::TextureImage::TextureImage ( TextureImage &&  )
default

◆ ~TextureImage()

Vulkan::TextureImage::~TextureImage ( )
default

Member Function Documentation

◆ fillImage()

void Vulkan::TextureImage::fillImage ( const Buffers::StagingBuffer imageData,
const CommandBufferPool commandBufferPool 
)

Fills the image with the data stored in the buffer.

Parameters
imageDataData to load to the image (generally textels).
commandBufferPoolFrom where to allocate the command buffer used to perform the copy.

◆ getSampler()

const Vulkan::TextureSampler & Vulkan::TextureImage::getSampler ( ) const

◆ operator=() [1/2]

TextureImage & Vulkan::TextureImage::operator= ( const TextureImage )
delete

◆ operator=() [2/2]

TextureImage & Vulkan::TextureImage::operator= ( TextureImage &&  movedFrom)
default

◆ transitionLayout()

void Vulkan::TextureImage::transitionLayout ( VkImageLayout  newLayout,
const CommandBufferPool commandBufferPool 
)

Changes the layout of the image.

Parameters
newLayoutThe New layout to apply.
commandBufferPoolFrom where to allocate the command buffer used to perform the transition.

The documentation for this class was generated from the following files: