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

This class is a wrapper around the. More...

#include <cs237-depth-buffer.hpp>

Public Member Functions

 DepthBuffer (Application *app, uint32_t wid, uint32_t ht)
 construct and initialize a new depth buffer of the give size
 
 ~DepthBuffer ()
 destructor; this will free the underlying resources
 
uint32_t width () const
 get the width of the buffer
 
uint32_t height () const
 get the height of the buffer
 
vk::Format format () const
 get the depth-buffer image format
 
vk::Sampler sampler () const
 get the sampler
 
vk::ImageView imageView () const
 get the image view for the depth buffer
 
vk::DescriptorImageInfo imageInfo () const
 get the image information for the depth buffer
 
vk::Framebuffer createFramebuffer (vk::RenderPass rp)
 

Detailed Description

This class is a wrapper around the.

Constructor & Destructor Documentation

◆ DepthBuffer()

cs237::DepthBuffer::DepthBuffer ( Application app,
uint32_t  wid,
uint32_t  ht 
)

construct and initialize a new depth buffer of the give size

Parameters
appthe owning application
widthe width of the buffer (should be power of 2)
htthe height of the buffer (should be power of 2)

This function allocates and initializes a frame-buffer object and associated sampler. The sampler is initialized with the following parameters:

  • the filter parameters are set to VK_FILTER_LINEAR
  • the mimap mode is VK_SAMPLER_MIPMAP_MODE_NEAREST
  • the address modes are set to VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE

◆ ~DepthBuffer()

cs237::DepthBuffer::~DepthBuffer ( )

destructor; this will free the underlying resources

Member Function Documentation

◆ createFramebuffer()

vk::Framebuffer cs237::DepthBuffer::createFramebuffer ( vk::RenderPass  rp)

create a framebuffer that writes to the depth-buffer image.

Parameters
rpthe render pass used to render to the framebuffer
Returns
the framebuffer for the depth buffer

◆ format()

vk::Format cs237::DepthBuffer::format ( ) const
inline

get the depth-buffer image format

◆ height()

uint32_t cs237::DepthBuffer::height ( ) const
inline

get the height of the buffer

◆ imageInfo()

vk::DescriptorImageInfo cs237::DepthBuffer::imageInfo ( ) const
inline

get the image information for the depth buffer

◆ imageView()

vk::ImageView cs237::DepthBuffer::imageView ( ) const
inline

get the image view for the depth buffer

◆ sampler()

vk::Sampler cs237::DepthBuffer::sampler ( ) const
inline

get the sampler

◆ width()

uint32_t cs237::DepthBuffer::width ( ) const
inline

get the width of the buffer


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