14#ifndef _CS237_TEXTURE_HPP_
15#define _CS237_TEXTURE_HPP_
18# error "cs237/texture.hpp should not be included directly"
45 uint32_t wid, uint32_t ht, uint32_t mipLvls,
Definition texture.hpp:25
vk::Format format() const
get the texel format
Definition texture.hpp:31
vk::DeviceMemory _allocBufferMemory(vk::Buffer buf, vk::MemoryPropertyFlags props)
A helper function for allocating and binding device memory for a buffer.
Definition texture.hpp:62
uint32_t _ht
teture height (1 for 1D textures)
Definition texture.hpp:39
void _init(cs237::__detail::ImageBase const *img)
initialize a texture by copying data into it using a staging buffer.
vk::ImageView _view
image view for texture image
Definition texture.hpp:37
uint32_t _wid
texture width
Definition texture.hpp:38
Application * _app
the owning application
Definition texture.hpp:34
vk::Buffer _createBuffer(size_t size, vk::BufferUsageFlags usage)
create a vk::Buffer object
Definition texture.hpp:53
uint32_t _nMipLevels
number of mipmap levels
Definition texture.hpp:40
vk::ImageView view() const
return the image view for the texture
Definition texture.hpp:28
vk::Image _img
Vulkan image to hold the texture.
Definition texture.hpp:35
vk::DeviceMemory _mem
device memory for the texture image
Definition texture.hpp:36
TextureBase(Application *app, uint32_t wid, uint32_t ht, uint32_t mipLvls, cs237::__detail::ImageBase const *img)
vk::Format _fmt
the texel format
Definition texture.hpp:41
the base class for applications
Definition application.hpp:25
vk::DeviceMemory _allocBufferMemory(vk::Buffer buf, vk::MemoryPropertyFlags props)
A helper function for allocating and binding device memory for a buffer.
vk::Buffer _createBuffer(size_t size, vk::BufferUsageFlags usage)
create a vk::Buffer object
Definition texture.hpp:76
Texture1D(Application *app, Image1D const *img)
Construct a 1D texture from a 1D image.
Definition texture.hpp:87
Texture2D(Application *app, Image2D const *img, bool mipmap=false)
Construct a 2D texture from a 2D image.