From 9da45ed78c44f7a5ec2156b0ec0c943d521f1a3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Sat, 9 Jun 2018 17:29:00 -0700 Subject: [PATCH] Renamed bgfx::updateDynamic* to just bgfx::update. --- examples/23-vectordisplay/vectordisplay.cpp | 5 +++-- examples/27-terrain/terrain.cpp | 4 ++-- examples/35-dynamic/dynamic.cpp | 2 +- examples/common/font/text_buffer_manager.cpp | 18 ++++++++++-------- include/bgfx/bgfx.h | 4 ++-- include/bgfx/defines.h | 2 +- src/bgfx.cpp | 12 ++++++------ src/bgfx_p.h | 8 ++++---- 8 files changed, 29 insertions(+), 26 deletions(-) diff --git a/examples/23-vectordisplay/vectordisplay.cpp b/examples/23-vectordisplay/vectordisplay.cpp index acc440661..4342f9afb 100644 --- a/examples/23-vectordisplay/vectordisplay.cpp +++ b/examples/23-vectordisplay/vectordisplay.cpp @@ -163,10 +163,11 @@ void VectorDisplay::endFrame() BX_CHECK(m_points.size() < MAX_NUMBER_VERTICES, ""); - bgfx::updateDynamicVertexBuffer(m_vertexBuffers[m_currentDrawStep] + bgfx::update( + m_vertexBuffers[m_currentDrawStep] , 0 , bgfx::copy(m_points.data(), (uint32_t)m_points.size() * sizeof(PosColorUvVertex) ) - ); + ); m_vertexBuffersSize[m_currentDrawStep] = (uint32_t)m_points.size(); for (int loopvar = 0; loopvar < m_numberDecaySteps; loopvar++) diff --git a/examples/27-terrain/terrain.cpp b/examples/27-terrain/terrain.cpp index 63b5e3035..8ae06d568 100644 --- a/examples/27-terrain/terrain.cpp +++ b/examples/27-terrain/terrain.cpp @@ -261,7 +261,7 @@ public: } mem = bgfx::makeRef(&m_terrain.m_vertices[0], sizeof(PosTexCoord0Vertex) * m_terrain.m_vertexCount); - bgfx::updateDynamicVertexBuffer(m_dvbh, 0, mem); + bgfx::update(m_dvbh, 0, mem); if (!bgfx::isValid(m_dibh) ) { @@ -269,7 +269,7 @@ public: } mem = bgfx::makeRef(&m_terrain.m_indices[0], sizeof(uint16_t) * m_terrain.m_indexCount); - bgfx::updateDynamicIndexBuffer(m_dibh, 0, mem); + bgfx::update(m_dibh, 0, mem); break; case 2: // Height Texture: Update a height texture that is sampled in the terrain vertex shader. diff --git a/examples/35-dynamic/dynamic.cpp b/examples/35-dynamic/dynamic.cpp index 68d388c30..9bb021b85 100644 --- a/examples/35-dynamic/dynamic.cpp +++ b/examples/35-dynamic/dynamic.cpp @@ -239,7 +239,7 @@ public: } uint32_t idx = m_mwc.gen() % (kDimWidth*kDimHeight); - bgfx::updateDynamicVertexBuffer(m_vbh[idx], 0, mem); + bgfx::update(m_vbh[idx], 0, mem); } // Submit 11x11 cubes. diff --git a/examples/common/font/text_buffer_manager.cpp b/examples/common/font/text_buffer_manager.cpp index 628ae6ddf..c231a87c5 100644 --- a/examples/common/font/text_buffer_manager.cpp +++ b/examples/common/font/text_buffer_manager.cpp @@ -779,15 +779,17 @@ void TextBufferManager::submitTextBuffer(TextBufferHandle _handle, bgfx::ViewId ibh.idx = bc.indexBufferHandleIdx; vbh.idx = bc.vertexBufferHandleIdx; - bgfx::updateDynamicIndexBuffer(ibh - , 0 - , bgfx::copy(bc.textBuffer->getIndexBuffer(), indexSize) - ); + bgfx::update( + ibh + , 0 + , bgfx::copy(bc.textBuffer->getIndexBuffer(), indexSize) + ); - bgfx::updateDynamicVertexBuffer(vbh - , 0 - , bgfx::copy(bc.textBuffer->getVertexBuffer(), vertexSize) - ); + bgfx::update( + vbh + , 0 + , bgfx::copy(bc.textBuffer->getVertexBuffer(), vertexSize) + ); } bgfx::setVertexBuffer(0, vbh, 0, bc.textBuffer->getVertexCount() ); diff --git a/include/bgfx/bgfx.h b/include/bgfx/bgfx.h index a3d426e0b..aef40a89a 100644 --- a/include/bgfx/bgfx.h +++ b/include/bgfx/bgfx.h @@ -2178,7 +2178,7 @@ namespace bgfx /// /// @attention C99 equivalent is `bgfx_update_dynamic_index_buffer`. /// - void updateDynamicIndexBuffer( + void update( DynamicIndexBufferHandle _handle , uint32_t _startIndex , const Memory* _mem @@ -2252,7 +2252,7 @@ namespace bgfx /// /// @attention C99 equivalent is `bgfx_update_dynamic_vertex_buffer`. /// - void updateDynamicVertexBuffer( + void update( DynamicVertexBufferHandle _handle , uint32_t _startVertex , const Memory* _mem diff --git a/include/bgfx/defines.h b/include/bgfx/defines.h index bfc7df5e3..d24ff697b 100644 --- a/include/bgfx/defines.h +++ b/include/bgfx/defines.h @@ -6,7 +6,7 @@ #ifndef BGFX_DEFINES_H_HEADER_GUARD #define BGFX_DEFINES_H_HEADER_GUARD -#define BGFX_API_VERSION UINT32_C(70) +#define BGFX_API_VERSION UINT32_C(71) /// Color RGB/alpha/depth write. When it's not specified write will be disabled. #define BGFX_STATE_WRITE_R UINT64_C(0x0000000000000001) //!< Enable R write. diff --git a/src/bgfx.cpp b/src/bgfx.cpp index 5a07d8098..1e9a0f8cb 100644 --- a/src/bgfx.cpp +++ b/src/bgfx.cpp @@ -3448,10 +3448,10 @@ error: return s_ctx->createDynamicIndexBuffer(_mem, _flags); } - void updateDynamicIndexBuffer(DynamicIndexBufferHandle _handle, uint32_t _startIndex, const Memory* _mem) + void update(DynamicIndexBufferHandle _handle, uint32_t _startIndex, const Memory* _mem) { BX_CHECK(NULL != _mem, "_mem can't be NULL"); - s_ctx->updateDynamicIndexBuffer(_handle, _startIndex, _mem); + s_ctx->update(_handle, _startIndex, _mem); } void destroy(DynamicIndexBufferHandle _handle) @@ -3472,10 +3472,10 @@ error: return s_ctx->createDynamicVertexBuffer(_mem, _decl, _flags); } - void updateDynamicVertexBuffer(DynamicVertexBufferHandle _handle, uint32_t _startVertex, const Memory* _mem) + void update(DynamicVertexBufferHandle _handle, uint32_t _startVertex, const Memory* _mem) { BX_CHECK(NULL != _mem, "_mem can't be NULL"); - s_ctx->updateDynamicVertexBuffer(_handle, _startVertex, _mem); + s_ctx->update(_handle, _startVertex, _mem); } void destroy(DynamicVertexBufferHandle _handle) @@ -4947,7 +4947,7 @@ BGFX_C_API bgfx_dynamic_index_buffer_handle_t bgfx_create_dynamic_index_buffer_m 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, _startIndex, (const bgfx::Memory*)_mem); + bgfx::update(handle.cpp, _startIndex, (const bgfx::Memory*)_mem); } BGFX_C_API void bgfx_destroy_dynamic_index_buffer(bgfx_dynamic_index_buffer_handle_t _handle) @@ -4975,7 +4975,7 @@ BGFX_C_API bgfx_dynamic_vertex_buffer_handle_t bgfx_create_dynamic_vertex_buffer 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, _startVertex, (const bgfx::Memory*)_mem); + bgfx::update(handle.cpp, _startVertex, (const bgfx::Memory*)_mem); } BGFX_C_API void bgfx_destroy_dynamic_vertex_buffer(bgfx_dynamic_vertex_buffer_handle_t _handle) diff --git a/src/bgfx_p.h b/src/bgfx_p.h index 30ca55529..31464fc7b 100644 --- a/src/bgfx_p.h +++ b/src/bgfx_p.h @@ -3052,7 +3052,7 @@ namespace bgfx if (isValid(handle) ) { - updateDynamicIndexBuffer(handle, 0, _mem); + update(handle, 0, _mem); } else { @@ -3062,7 +3062,7 @@ namespace bgfx return handle; } - BGFX_API_FUNC(void updateDynamicIndexBuffer(DynamicIndexBufferHandle _handle, uint32_t _startIndex, const Memory* _mem) ) + BGFX_API_FUNC(void update(DynamicIndexBufferHandle _handle, uint32_t _startIndex, const Memory* _mem) ) { BGFX_MUTEX_SCOPE(m_resourceApiLock); @@ -3238,7 +3238,7 @@ namespace bgfx if (isValid(handle) ) { - updateDynamicVertexBuffer(handle, 0, _mem); + update(handle, 0, _mem); } else { @@ -3248,7 +3248,7 @@ namespace bgfx return handle; } - BGFX_API_FUNC(void updateDynamicVertexBuffer(DynamicVertexBufferHandle _handle, uint32_t _startVertex, const Memory* _mem) ) + BGFX_API_FUNC(void update(DynamicVertexBufferHandle _handle, uint32_t _startVertex, const Memory* _mem) ) { BGFX_MUTEX_SCOPE(m_resourceApiLock);