CMSC23700 Common Code Library
Support code for CS23700 programming projects
Loading...
Searching...
No Matches
cs237::__detail::TextureBase Class Reference

#include <cs237-texture.hpp>

Inheritance diagram for cs237::__detail::TextureBase:
Collaboration diagram for cs237::__detail::TextureBase:

Public Member Functions

vk::ImageView view () const
 return the image view for the texture
 
vk::Format format () const
 get the texel format
 

Protected Member Functions

 TextureBase (Application *app, uint32_t wid, uint32_t ht, uint32_t mipLvls, cs237::__detail::ImageBase const *img)
 
 ~TextureBase ()
 
vk::Buffer _createBuffer (size_t size, vk::BufferUsageFlags usage)
 create a vk::Buffer object
 
vk::DeviceMemory _allocBufferMemory (vk::Buffer buf, vk::MemoryPropertyFlags props)
 A helper function for allocating and binding device memory for a buffer.
 
void _init (cs237::__detail::ImageBase const *img)
 initialize a texture by copying data into it using a staging buffer.
 

Protected Attributes

Application_app
 the owning application
 
vk::Image _img
 Vulkan image to hold the texture.
 
vk::DeviceMemory _mem
 device memory for the texture image
 
vk::ImageView _view
 image view for texture image
 
uint32_t _wid
 texture width
 
uint32_t _ht
 teture height (1 for 1D textures)
 
uint32_t _nMipLevels
 number of mipmap levels
 
vk::Format _fmt
 the texel format
 

Constructor & Destructor Documentation

◆ TextureBase()

cs237::__detail::TextureBase::TextureBase ( Application app,
uint32_t  wid,
uint32_t  ht,
uint32_t  mipLvls,
cs237::__detail::ImageBase const img 
)
protected

◆ ~TextureBase()

cs237::__detail::TextureBase::~TextureBase ( )
protected

Member Function Documentation

◆ _allocBufferMemory()

vk::DeviceMemory cs237::__detail::TextureBase::_allocBufferMemory ( vk::Buffer  buf,
vk::MemoryPropertyFlags  props 
)
inlineprotected

A helper function for allocating and binding device memory for a buffer.

Parameters
bufthe buffer to allocate memory for
propsrequred memory properties
Returns
the device memory that has been bound to the buffer

◆ _createBuffer()

vk::Buffer cs237::__detail::TextureBase::_createBuffer ( size_t  size,
vk::BufferUsageFlags  usage 
)
inlineprotected

create a vk::Buffer object

Parameters
sizethe size of the buffer in bytes
usagethe usage of the buffer
Returns
the allocated buffer

◆ _init()

void cs237::__detail::TextureBase::_init ( cs237::__detail::ImageBase const img)
protected

initialize a texture by copying data into it using a staging buffer.

Parameters
imgthe source of the data

◆ format()

vk::Format cs237::__detail::TextureBase::format ( ) const
inline

get the texel format

◆ view()

vk::ImageView cs237::__detail::TextureBase::view ( ) const
inline

return the image view for the texture

Member Data Documentation

◆ _app

Application* cs237::__detail::TextureBase::_app
protected

the owning application

◆ _fmt

vk::Format cs237::__detail::TextureBase::_fmt
protected

the texel format

◆ _ht

uint32_t cs237::__detail::TextureBase::_ht
protected

teture height (1 for 1D textures)

◆ _img

vk::Image cs237::__detail::TextureBase::_img
protected

Vulkan image to hold the texture.

◆ _mem

vk::DeviceMemory cs237::__detail::TextureBase::_mem
protected

device memory for the texture image

◆ _nMipLevels

uint32_t cs237::__detail::TextureBase::_nMipLevels
protected

number of mipmap levels

◆ _view

vk::ImageView cs237::__detail::TextureBase::_view
protected

image view for texture image

◆ _wid

uint32_t cs237::__detail::TextureBase::_wid
protected

texture width


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