CMSC23740 Common Code Library
Support code for CS23740 programming projects
Loading...
Searching...
No Matches
cs237::Texture2D Class Reference

#include <texture.hpp>

Inheritance diagram for cs237::Texture2D:
Collaboration diagram for cs237::Texture2D:

Public Member Functions

 Texture2D (Application *app, Image2D const *img, bool mipmap=false)
 Construct a 2D texture from a 2D image.
Public Member Functions inherited from cs237::__detail::TextureBase
vk::ImageView view () const
 return the image view for the texture
vk::Format format () const
 get the texel format

Additional Inherited Members

Protected Member Functions inherited from cs237::__detail::TextureBase
 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 inherited from cs237::__detail::TextureBase
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

◆ Texture2D()

cs237::Texture2D::Texture2D ( Application * app,
Image2D const * img,
bool mipmap = false )

Construct a 2D texture from a 2D image.

Parameters
appthe owning application
imgthe source image for the texture
mipmapif true, generate mipmap levels for the texture.

The documentation for this class was generated from the following file:
  • /Users/jhr/Classes/23740/f2026/solutions/cs237-library/include/cs237/texture.hpp