SPARK  0.1.0
A general purpose game engine written in C++.
Loading...
Searching...
No Matches
spark::render::vk::VulkanVertexBufferLayout Class Referencefinal

Implements IVertexBufferLayout for Vulkan. More...

#include <VulkanVertexBufferLayout.h>

Inheritance diagram for spark::render::vk::VulkanVertexBufferLayout:
spark::render::IVertexBufferLayout spark::render::IBufferLayout

Classes

struct  Impl
 

Public Member Functions

 VulkanVertexBufferLayout (std::size_t vertex_size, unsigned int binding=0)
 Initializes a new IVertexBufferLayout for use with Vulkan.
 
 VulkanVertexBufferLayout (const VulkanVertexBufferLayout &other)=delete
 
 VulkanVertexBufferLayout (VulkanVertexBufferLayout &&other) noexcept=delete
 
VulkanVertexBufferLayoutoperator= (const VulkanVertexBufferLayout &other)=delete
 
VulkanVertexBufferLayoutoperator= (VulkanVertexBufferLayout &&other) noexcept=delete
 
std::vector< const BufferAttribute * > attributes () const noexcept override
 Gets the attributes of the vertex buffer.
 
void addAttribute (BufferAttribute &&attribute) noexcept override
 Adds an attribute to the vertex buffer layout.
 
std::size_t elementSize () const noexcept override
 Gets the size of a single element in the buffer.
 
unsigned int binding () const noexcept override
 Gets the binding point the buffer will be bound to.
 
BufferType type () const noexcept override
 Gets the type of the buffer.
 

Detailed Description

Implements IVertexBufferLayout for Vulkan.

Constructor & Destructor Documentation

◆ VulkanVertexBufferLayout()

spark::render::vk::VulkanVertexBufferLayout::VulkanVertexBufferLayout ( std::size_t vertex_size,
unsigned int binding = 0 )
explicit

Initializes a new IVertexBufferLayout for use with Vulkan.

Parameters
vertex_sizeThe size of a single vertex in.
bindingThe binding index of the vertex buffers using this layout.

Member Function Documentation

◆ addAttribute()

void spark::render::vk::VulkanVertexBufferLayout::addAttribute ( BufferAttribute && attribute)
overridevirtualnoexcept

Adds an attribute to the vertex buffer layout.

Parameters
attributeThe BufferAttribute to add.

Implements spark::render::IVertexBufferLayout.

◆ attributes()

std::vector< const BufferAttribute * > spark::render::vk::VulkanVertexBufferLayout::attributes ( ) const
nodiscardoverridevirtualnoexcept

Gets the attributes of the vertex buffer.

Returns
A std::vector of BufferAttribute representing the attributes of the vertex buffer.

Implements spark::render::IVertexBufferLayout.

◆ binding()

unsigned spark::render::vk::VulkanVertexBufferLayout::binding ( ) const
nodiscardoverridevirtualnoexcept

Gets the binding point the buffer will be bound to.

Returns
The binding point the buffer will be bound to.

Implements spark::render::IBufferLayout.

◆ elementSize()

std::size_t spark::render::vk::VulkanVertexBufferLayout::elementSize ( ) const
nodiscardoverridevirtualnoexcept

Gets the size of a single element in the buffer.

Returns
The size of a single element in the buffer.

Implements spark::render::IBufferLayout.

◆ type()

BufferType spark::render::vk::VulkanVertexBufferLayout::type ( ) const
nodiscardoverridevirtualnoexcept

Gets the type of the buffer.

Returns
A BufferType representing the type of the buffer.

Implements spark::render::IBufferLayout.