Crafter.Graphics
C++ graphics library using Wayland and Vulkan.
 
Loading...
Searching...
No Matches
Crafter::Buffer< T > Class Template Referenceexport

VkBuffer holder. Stores a value and handles buffer mapping and lifetime management. More...

Public Member Functions

 Buffer (VkBufferUsageFlags usageFlags, VkMemoryPropertyFlags memoryPropertyFlags, std::uint32_t count=1)
 Creates and initializes a Vulkan buffer with the specified usage and memory properties.
 
 ~Buffer ()
 Frees all resources assosiacted with the buffer.
 

Public Attributes

T * value
 
VkDescriptorBufferInfo descriptor
 

Detailed Description

template<typename T>
class Crafter::Buffer< T >

VkBuffer holder. Stores a value and handles buffer mapping and lifetime management.

Template Parameters
TThe value to store.

Constructor & Destructor Documentation

◆ Buffer()

template<typename T>
Crafter::Buffer< T >::Buffer ( VkBufferUsageFlags usageFlags,
VkMemoryPropertyFlags memoryPropertyFlags,
std::uint32_t count = 1 )
inline

Creates and initializes a Vulkan buffer with the specified usage and memory properties.

This constructor allocates a buffer capable of holding count elements of type T. The buffer usage and memory property flags control how the buffer will be used and how its memory is managed.

Parameters
usageFlagsVulkan buffer usage flags that define allowed operations on the buffer (e.g., vertex buffer, index buffer, uniform buffer).
memoryPropertyFlagsVulkan memory property flags specifying the desired memory properties (e.g., device local, host visible).
countNumber of elements to allocate space for in the buffer. The total buffer size will be count * sizeof(T). Must be above 0.

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