vengine  0.0.1
3D graphics engine
Loading...
Searching...
No Matches
ven::Texture Class Reference

Class for texture. More...

#include <Texture.hpp>

+ Collaboration diagram for ven::Texture:

Public Member Functions

 Texture (Device &device, const std::string &textureFilepath)
 
 Texture (Device &device, VkFormat format, VkExtent3D extent, VkImageUsageFlags usage, VkSampleCountFlagBits sampleCount)
 
 ~Texture ()
 
 Texture (const Texture &)=delete
 
Textureoperator= (const Texture &)=delete
 
 Texture (Texture &&)=delete
 
Textureoperator= (Texture &&)=delete
 
void updateDescriptor ()
 
void transitionLayout (VkCommandBuffer commandBuffer, VkImageLayout oldLayout, VkImageLayout newLayout) const
 
VkImageView imageView () const
 
VkSampler sampler () const
 
VkImage getImage () const
 
VkImageView getImageView () const
 
VkDescriptorImageInfo getImageInfo () const
 
VkImageLayout getImageLayout () const
 
VkExtent3D getExtent () const
 
VkFormat getFormat () const
 

Private Member Functions

void createTextureImage (const std::string &filepath)
 
void createTextureImageView (VkImageViewType viewType)
 
void createTextureSampler ()
 

Private Attributes

VkDescriptorImageInfo m_descriptor {}
 
Devicem_device
 
VkImage m_textureImage = nullptr
 
VkDeviceMemory m_textureImageMemory = nullptr
 
VkImageView m_textureImageView = nullptr
 
VkSampler m_textureSampler = nullptr
 
VkFormat m_format
 
VkImageLayout m_textureLayout {}
 
uint32_t m_mipLevels {1}
 
uint32_t m_layerCount {1}
 
VkExtent3D m_extent {}
 

Detailed Description

Class for texture.

Definition at line 20 of file Texture.hpp.

Constructor & Destructor Documentation

◆ Texture() [1/4]

ven::Texture::Texture ( Device & device,
const std::string & textureFilepath )

Definition at line 7 of file texture.cpp.

References createTextureImage(), createTextureImageView(), createTextureSampler(), and updateDescriptor().

+ Here is the call graph for this function:

◆ Texture() [2/4]

ven::Texture::Texture ( Device & device,
VkFormat format,
VkExtent3D extent,
VkImageUsageFlags usage,
VkSampleCountFlagBits sampleCount )

Definition at line 15 of file texture.cpp.

References ven::Device::createImageWithInfo(), ven::Device::device(), m_descriptor, m_textureImage, m_textureImageMemory, m_textureImageView, and m_textureSampler.

+ Here is the call graph for this function:

◆ ~Texture()

ven::Texture::~Texture ( )

Definition at line 89 of file texture.cpp.

◆ Texture() [3/4]

ven::Texture::Texture ( const Texture & )
delete

◆ Texture() [4/4]

ven::Texture::Texture ( Texture && )
delete

Member Function Documentation

◆ createTextureImage()

void ven::Texture::createTextureImage ( const std::string & filepath)
private

Definition at line 104 of file texture.cpp.

Referenced by Texture().

+ Here is the caller graph for this function:

◆ createTextureImageView()

void ven::Texture::createTextureImageView ( VkImageViewType viewType)
private

Definition at line 191 of file texture.cpp.

Referenced by Texture().

+ Here is the caller graph for this function:

◆ createTextureSampler()

void ven::Texture::createTextureSampler ( )
private

Definition at line 209 of file texture.cpp.

Referenced by Texture().

+ Here is the caller graph for this function:

◆ getExtent()

VkExtent3D ven::Texture::getExtent ( ) const
inlinenodiscard

Definition at line 42 of file Texture.hpp.

References m_extent.

◆ getFormat()

VkFormat ven::Texture::getFormat ( ) const
inlinenodiscard

Definition at line 43 of file Texture.hpp.

References m_format.

◆ getImage()

VkImage ven::Texture::getImage ( ) const
inlinenodiscard

Definition at line 38 of file Texture.hpp.

References m_textureImage.

◆ getImageInfo()

VkDescriptorImageInfo ven::Texture::getImageInfo ( ) const
inlinenodiscard

Definition at line 40 of file Texture.hpp.

References m_descriptor.

◆ getImageLayout()

VkImageLayout ven::Texture::getImageLayout ( ) const
inlinenodiscard

Definition at line 41 of file Texture.hpp.

References m_textureLayout.

◆ getImageView()

VkImageView ven::Texture::getImageView ( ) const
inlinenodiscard

Definition at line 39 of file Texture.hpp.

References m_textureImageView.

◆ imageView()

VkImageView ven::Texture::imageView ( ) const
inlinenodiscard

Definition at line 36 of file Texture.hpp.

References m_textureImageView.

◆ operator=() [1/2]

Texture & ven::Texture::operator= ( const Texture & )
delete

◆ operator=() [2/2]

Texture & ven::Texture::operator= ( Texture && )
delete

◆ sampler()

VkSampler ven::Texture::sampler ( ) const
inlinenodiscard

Definition at line 37 of file Texture.hpp.

References m_textureSampler.

◆ transitionLayout()

void ven::Texture::transitionLayout ( VkCommandBuffer commandBuffer,
VkImageLayout oldLayout,
VkImageLayout newLayout ) const

Definition at line 239 of file texture.cpp.

◆ updateDescriptor()

void ven::Texture::updateDescriptor ( )

Definition at line 97 of file texture.cpp.

Referenced by Texture().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_descriptor

VkDescriptorImageInfo ven::Texture::m_descriptor {}
private

Definition at line 51 of file Texture.hpp.

Referenced by getImageInfo(), and Texture().

◆ m_device

Device& ven::Texture::m_device
private

Definition at line 52 of file Texture.hpp.

◆ m_extent

VkExtent3D ven::Texture::m_extent {}
private

Definition at line 61 of file Texture.hpp.

Referenced by getExtent().

◆ m_format

VkFormat ven::Texture::m_format
private

Definition at line 57 of file Texture.hpp.

Referenced by getFormat().

◆ m_layerCount

uint32_t ven::Texture::m_layerCount {1}
private

Definition at line 60 of file Texture.hpp.

◆ m_mipLevels

uint32_t ven::Texture::m_mipLevels {1}
private

Definition at line 59 of file Texture.hpp.

◆ m_textureImage

VkImage ven::Texture::m_textureImage = nullptr
private

Definition at line 53 of file Texture.hpp.

Referenced by getImage(), and Texture().

◆ m_textureImageMemory

VkDeviceMemory ven::Texture::m_textureImageMemory = nullptr
private

Definition at line 54 of file Texture.hpp.

Referenced by Texture().

◆ m_textureImageView

VkImageView ven::Texture::m_textureImageView = nullptr
private

Definition at line 55 of file Texture.hpp.

Referenced by getImageView(), imageView(), and Texture().

◆ m_textureLayout

VkImageLayout ven::Texture::m_textureLayout {}
private

Definition at line 58 of file Texture.hpp.

Referenced by getImageLayout().

◆ m_textureSampler

VkSampler ven::Texture::m_textureSampler = nullptr
private

Definition at line 56 of file Texture.hpp.

Referenced by sampler(), and Texture().


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