Texture class for managing textures in Vulkan.
More...
#include <Texture.h>
|
MANDRILL_API | Texture (ptr< Device > pDevice, Type type, VkFormat format, const std::filesystem::path &path, bool mipmaps=false) |
| Create a new texture from a file.
|
|
MANDRILL_API | Texture (ptr< Device > pDevice, Type type, VkFormat format, const void *pData, uint32_t width, uint32_t height, uint32_t depth, uint32_t channels, bool mipmaps=false) |
| Create a new texture from a buffer.
|
|
MANDRILL_API | ~Texture () |
| Destructor for texture.
|
|
MANDRILL_API void | setSampler (const ptr< Sampler > pSampler) |
| Set the sampler for the texture.
|
|
MANDRILL_API VkSampler | getSampler () const |
| Get the sampler handle currently in use by the texture.
|
|
MANDRILL_API ptr< Image > | getImage () const |
| Get the image of the texture.
|
|
MANDRILL_API VkImageView | getImageView () const |
| Get the image view handle.
|
|
MANDRILL_API VkWriteDescriptorSet | getWriteDescriptor (uint32_t binding) const |
| Get the write descriptor set. Useful when using push descriptors.
|
|
Texture class for managing textures in Vulkan.
◆ Texture() [1/2]
Texture::Texture |
( |
ptr< Device > |
pDevice, |
|
|
Type |
type, |
|
|
VkFormat |
format, |
|
|
const std::filesystem::path & |
path, |
|
|
bool |
mipmaps = false |
|
) |
| |
Create a new texture from a file.
- Parameters
-
pDevice | Device to use |
type | Type of texture |
format | Format to use |
path | Path to texture file |
mipmaps | Whether to use mipmaps or not |
◆ Texture() [2/2]
Texture::Texture |
( |
ptr< Device > |
pDevice, |
|
|
Type |
type, |
|
|
VkFormat |
format, |
|
|
const void * |
pData, |
|
|
uint32_t |
width, |
|
|
uint32_t |
height, |
|
|
uint32_t |
depth, |
|
|
uint32_t |
channels, |
|
|
bool |
mipmaps = false |
|
) |
| |
Create a new texture from a buffer.
- Parameters
-
pDevice | Device to use |
type | Type of texture |
format | Format to use |
pData | Pointer to texture data |
width | Width of texture |
height | Height of texture |
depth | Depth of texture |
channels | Number of channels in texture |
mipmaps | Whether to use mipmaps or not |
◆ getImage()
MANDRILL_API ptr< Image > Mandrill::Texture::getImage |
( |
| ) |
const |
|
inline |
Get the image of the texture.
- Returns
- Pointer to image
◆ getImageView()
MANDRILL_API VkImageView Mandrill::Texture::getImageView |
( |
| ) |
const |
|
inline |
Get the image view handle.
- Returns
- Image view handle
◆ getSampler()
MANDRILL_API VkSampler Mandrill::Texture::getSampler |
( |
| ) |
const |
|
inline |
Get the sampler handle currently in use by the texture.
- Returns
- Vulkan sampler handle
◆ getWriteDescriptor()
MANDRILL_API VkWriteDescriptorSet Mandrill::Texture::getWriteDescriptor |
( |
uint32_t |
binding | ) |
const |
|
inline |
Get the write descriptor set. Useful when using push descriptors.
- Parameters
-
binding | Binding to place the write descriptor in |
- Returns
- Write descriptor set
◆ setSampler()
MANDRILL_API void Mandrill::Texture::setSampler |
( |
const ptr< Sampler > |
pSampler | ) |
|
|
inline |
Set the sampler for the texture.
- Parameters
-
The documentation for this class was generated from the following files:
- /home/runner/work/Mandrill/Mandrill/src/Texture.h
- /home/runner/work/Mandrill/Mandrill/src/Texture.cpp