mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-19 21:42:59 +01:00
Added offset for updating dynamic buffers.
This commit is contained in:
16
src/bgfx.cpp
16
src/bgfx.cpp
@@ -2220,11 +2220,11 @@ again:
|
||||
return s_ctx->createDynamicIndexBuffer(_mem, _flags);
|
||||
}
|
||||
|
||||
void updateDynamicIndexBuffer(DynamicIndexBufferHandle _handle, const Memory* _mem)
|
||||
void updateDynamicIndexBuffer(DynamicIndexBufferHandle _handle, uint32_t _startIndex, const Memory* _mem)
|
||||
{
|
||||
BGFX_CHECK_MAIN_THREAD();
|
||||
BX_CHECK(NULL != _mem, "_mem can't be NULL");
|
||||
s_ctx->updateDynamicIndexBuffer(_handle, _mem);
|
||||
s_ctx->updateDynamicIndexBuffer(_handle, _startIndex, _mem);
|
||||
}
|
||||
|
||||
void destroyDynamicIndexBuffer(DynamicIndexBufferHandle _handle)
|
||||
@@ -2248,11 +2248,11 @@ again:
|
||||
return s_ctx->createDynamicVertexBuffer(_mem, _decl, _flags);
|
||||
}
|
||||
|
||||
void updateDynamicVertexBuffer(DynamicVertexBufferHandle _handle, const Memory* _mem)
|
||||
void updateDynamicVertexBuffer(DynamicVertexBufferHandle _handle, uint32_t _startVertex, const Memory* _mem)
|
||||
{
|
||||
BGFX_CHECK_MAIN_THREAD();
|
||||
BX_CHECK(NULL != _mem, "_mem can't be NULL");
|
||||
s_ctx->updateDynamicVertexBuffer(_handle, _mem);
|
||||
s_ctx->updateDynamicVertexBuffer(_handle, _startVertex, _mem);
|
||||
}
|
||||
|
||||
void destroyDynamicVertexBuffer(DynamicVertexBufferHandle _handle)
|
||||
@@ -3342,10 +3342,10 @@ BGFX_C_API bgfx_dynamic_index_buffer_handle_t bgfx_create_dynamic_index_buffer_m
|
||||
return handle.c;
|
||||
}
|
||||
|
||||
BGFX_C_API void bgfx_update_dynamic_index_buffer(bgfx_dynamic_index_buffer_handle_t _handle, const bgfx_memory_t* _mem)
|
||||
BGFX_C_API void bgfx_update_dynamic_index_buffer(bgfx_dynamic_index_buffer_handle_t _handle, uint32_t _startIndex, const bgfx_memory_t* _mem)
|
||||
{
|
||||
union { bgfx_dynamic_index_buffer_handle_t c; bgfx::DynamicIndexBufferHandle cpp; } handle = { _handle };
|
||||
bgfx::updateDynamicIndexBuffer(handle.cpp, (const bgfx::Memory*)_mem);
|
||||
bgfx::updateDynamicIndexBuffer(handle.cpp, _startIndex, (const bgfx::Memory*)_mem);
|
||||
}
|
||||
|
||||
BGFX_C_API void bgfx_destroy_dynamic_index_buffer(bgfx_dynamic_index_buffer_handle_t _handle)
|
||||
@@ -3370,10 +3370,10 @@ BGFX_C_API bgfx_dynamic_vertex_buffer_handle_t bgfx_create_dynamic_vertex_buffer
|
||||
return handle.c;
|
||||
}
|
||||
|
||||
BGFX_C_API void bgfx_update_dynamic_vertex_buffer(bgfx_dynamic_vertex_buffer_handle_t _handle, const bgfx_memory_t* _mem)
|
||||
BGFX_C_API void bgfx_update_dynamic_vertex_buffer(bgfx_dynamic_vertex_buffer_handle_t _handle, uint32_t _startVertex, const bgfx_memory_t* _mem)
|
||||
{
|
||||
union { bgfx_dynamic_vertex_buffer_handle_t c; bgfx::DynamicVertexBufferHandle cpp; } handle = { _handle };
|
||||
bgfx::updateDynamicVertexBuffer(handle.cpp, (const bgfx::Memory*)_mem);
|
||||
bgfx::updateDynamicVertexBuffer(handle.cpp, _startVertex, (const bgfx::Memory*)_mem);
|
||||
}
|
||||
|
||||
BGFX_C_API void bgfx_destroy_dynamic_vertex_buffer(bgfx_dynamic_vertex_buffer_handle_t _handle)
|
||||
|
||||
Reference in New Issue
Block a user