23#ifndef VCL_BGFX_BUFFERS_DYNAMIC_VERTEX_BUFFER_H
24#define VCL_BGFX_BUFFERS_DYNAMIC_VERTEX_BUFFER_H
26#include "generic_buffer.h"
51 bool mCompute =
false;
103 bgfx::Attrib::Enum
attrib,
112 bgfx::VertexLayout
layout;
144 bgfx::Attrib::Enum
attrib,
154 bgfx::VertexLayout
layout;
179 const bgfx::VertexLayout&
layout,
186 mHandle = bgfx::createDynamicVertexBuffer(
vertNum,
layout, flags);
215 const bgfx::Memory* data = bgfx::makeRef(
230 if (bgfx::isValid(mHandle)) {
244 if (bgfx::isValid(mHandle)) {
246 bgfx::setVertexBuffer(
stream, mHandle);
The DynamicVertexBuffer manages the lifetime of a bgfx::DynamicVertexBufferHandle.
Definition dynamic_vertex_buffer.h:48
void create(uint vertNum, const bgfx::VertexLayout &layout, uint64_t flags=BGFX_BUFFER_NONE, bool compute=false)
Creates the dynamic vertex buffer data for rendering, with the given layout and without any data.
Definition dynamic_vertex_buffer.h:177
void create(uint vertNum, bgfx::Attrib::Enum attrib, uint attribNumPerVertex, PrimitiveType attribType, bool normalize=false, bool allowResize=true)
Creates the dynamic vertex buffer data for rendering, with the layout given by the vertex attributes ...
Definition dynamic_vertex_buffer.h:101
DynamicVertexBuffer()=default
Empty constructor.
void swap(DynamicVertexBuffer &other)
Swap the content of this object with another DynamicVertexBuffer object.
Definition dynamic_vertex_buffer.h:67
bool isCompute() const
Check if the VertexBuffer is used for compute shaders.
Definition dynamic_vertex_buffer.h:85
void update(const void *bufferData, uint vertNum, uint attribNumPerVertex, PrimitiveType attribType, uint startIndex=0, bgfx::ReleaseFn releaseFn=nullptr)
Updates the dynamic vertex buffer with the given data.
Definition dynamic_vertex_buffer.h:206
void create(const void *bufferData, uint vertNum, bgfx::Attrib::Enum attrib, uint attribNumPerVertex, PrimitiveType attribType, bool normalize=false, bgfx::ReleaseFn releaseFn=nullptr, bool allowResize=true)
Creates the dynamic vertex buffer data for rendering, with the layout given by the vertex attributes ...
Definition dynamic_vertex_buffer.h:141
void bind(uint stream, bgfx::Access::Enum access=bgfx::Access::Read) const
Bind the dynamic vertex buffer to the rendering pipeline.
Definition dynamic_vertex_buffer.h:242
The GenericBuffer manages the lifetime of a bgfx BufferHandle.
Definition generic_buffer.h:44
void destroy()
Definition generic_buffer.h:59
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:43
PrimitiveType
A simple type that enumerates the main primitive types.
Definition base.h:58