Class Texture#
Defined in File Texture.ixx
Class Documentation#
-
class Texture#
Public Functions
-
Texture()#
Decodes an encoded image (PNG/JPG/…) already in memory and uploads it, for glTF’s embedded / data-URI images which never touch the filesystem. Shares the upload path with createFromFile; returns false if the bytes do not decode.
srgbselects the colour space the data is uploaded in: true for colour data (base colour, emissive), false for linear data (normal maps) - see the note on uploadRgba’s texture_format.
Returns false if the white-default upload itself failed (e.g. a failed submit), in which case the texture is left empty/unwritten.
-
void setImage(vk::Image image)#
-
void setImageView(vk::ImageView imageView)#
-
inline uint32_t getMipLevel() const#
-
inline VulkanImage &getVulkanImage()#
-
inline vk::Image &getImage()#
-
inline vk::ImageView &getImageView()#
-
inline vk::Sampler &getSampler()#
-
void releaseImageView()#
Releases the current view only, leaving the sampler and image alone. Call before a createImage() that will replace the image the view looks at, so the view is destroyed before its image (VUID-vkDestroyImage-image-01000).
-
void releaseSampler()#
Releases the current sampler only, leaving the view and image alone. Called first by createTextureSampler() so a second call on an already-created instance releases the previous sampler instead of leaking it.
-
void cleanUp()#
-
~Texture()#
Public Static Functions
-
static unsigned char *loadTextureData(const std::string &file_name, int *width, int *height, vk::DeviceSize *image_size)#
-
Texture()#