CMSC23700 Common Code Library
Support code for CS23700 programming projects
Loading...
Searching...
No Matches
cs237::VertexBuffer< V > Class Template Reference

#include <cs237-buffer.hpp>

Inheritance diagram for cs237::VertexBuffer< V >:
Collaboration diagram for cs237::VertexBuffer< V >:

Public Types

using VertexType = V
 the type of vertices
 

Public Member Functions

 VertexBuffer (Application *app, uint32_t nVerts)
 
 VertexBuffer (Application *app, vk::ArrayProxy< V > const &src)
 
void copyTo (vk::ArrayProxy< V > const &src)
 
void copyTo (vk::ArrayProxy< V > const &src, uint32_t offset)
 
- Public Member Functions inherited from cs237::Buffer
vk::Buffer vkBuffer () const
 get the Vulkan buffer object for this buffer
 
const MemoryObjmemory () const
 get the memory object for this buffer
 
vk::MemoryRequirements requirements ()
 get the memory requirements of this buffer
 

Additional Inherited Members

- Protected Member Functions inherited from cs237::Buffer
 Buffer (Application *app, vk::BufferUsageFlags usage, size_t sz)
 
 ~Buffer ()
 destructor
 
void _copyTo (const void *src, size_t offset, size_t sz)
 
void _copyTo (const void *src)
 
- Protected Attributes inherited from cs237::Buffer
Application_app
 the application
 
vk::Buffer _buf
 the Vulkan buffer object
 
MemoryObj_mem
 the Vulkan memory object that holds the buffer
 

Detailed Description

template<typename V>
class cs237::VertexBuffer< V >

Buffer class for vertex data; the type parameter V is the type of an individual vertex.

Member Typedef Documentation

◆ VertexType

template<typename V >
using cs237::VertexBuffer< V >::VertexType = V

the type of vertices

Constructor & Destructor Documentation

◆ VertexBuffer() [1/2]

template<typename V >
cs237::VertexBuffer< V >::VertexBuffer ( Application app,
uint32_t  nVerts 
)
inline

constructor

Parameters
appthe owning application object
nVertsthe number of vertices in the buffer

◆ VertexBuffer() [2/2]

template<typename V >
cs237::VertexBuffer< V >::VertexBuffer ( Application app,
vk::ArrayProxy< V > const &  src 
)
inline

constructor with initialization

Parameters
appthe owning application object
srcthe array of vertices used to initialize the buffer

Member Function Documentation

◆ copyTo() [1/2]

template<typename V >
void cs237::VertexBuffer< V >::copyTo ( vk::ArrayProxy< V > const &  src)
inline

copy vertices to the device memory object

Parameters
srcproxy array of vertices

◆ copyTo() [2/2]

template<typename V >
void cs237::VertexBuffer< V >::copyTo ( vk::ArrayProxy< V > const &  src,
uint32_t  offset 
)
inline

copy vertices to the device memory object

Parameters
srcproxy array of vertices
offsetoffset from the beginning of the buffer to copy the data to

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