From 7c9b2b7257c10aaad61e43bea1b2593520a913a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Mon, 17 Jul 2017 22:29:43 -0700 Subject: [PATCH] API change: Simplified destroy functions to use overload resolution. --- examples/01-cubes/cubes.cpp | 6 +- examples/02-metaballs/metaballs.cpp | 2 +- examples/03-raymarch/raymarch.cpp | 6 +- examples/04-mesh/mesh.cpp | 4 +- examples/05-instancing/instancing.cpp | 6 +- examples/06-bump/bump.cpp | 18 ++-- examples/07-callback/callback.cpp | 6 +- examples/08-update/update.cpp | 26 ++--- examples/09-hdr/hdr.cpp | 42 ++++----- examples/12-lod/lod.cpp | 14 +-- examples/13-stencil/stencil.cpp | 36 +++---- examples/14-shadowvolumes/shadowvolumes.cpp | 76 +++++++-------- .../shadowmaps_simple.cpp | 18 ++-- examples/16-shadowmaps/shadowmaps.cpp | 94 +++++++++---------- examples/17-drawstress/drawstress.cpp | 6 +- examples/18-ibl/ibl.cpp | 22 ++--- examples/19-oit/oit.cpp | 24 ++--- examples/21-deferred/deferred.cpp | 44 ++++----- examples/22-windows/windows.cpp | 12 +-- examples/23-vectordisplay/vectordisplay.cpp | 22 ++--- examples/24-nbody/nbody.cpp | 24 ++--- examples/26-occlusion/occlusion.cpp | 8 +- examples/27-terrain/terrain.cpp | 20 ++-- examples/28-wireframe/wireframe.cpp | 6 +- examples/30-picking/picking.cpp | 16 ++-- examples/31-rsm/reflectiveshadowmap.cpp | 48 +++++----- examples/33-pom/pom.cpp | 24 ++--- examples/common/bgfx_utils.cpp | 4 +- examples/common/cube_atlas.cpp | 2 +- examples/common/debugdraw/debugdraw.cpp | 12 +-- examples/common/font/text_buffer_manager.cpp | 16 ++-- examples/common/imgui/imgui.cpp | 10 +- examples/common/nanovg/nanovg_bgfx.cpp | 32 +++---- examples/common/ps/particle_system.cpp | 6 +- include/bgfx/bgfx.h | 22 ++--- include/bgfx/defines.h | 2 +- src/bgfx.cpp | 54 +++++------ tools/texturev/texturev.cpp | 24 ++--- 38 files changed, 407 insertions(+), 407 deletions(-) diff --git a/examples/01-cubes/cubes.cpp b/examples/01-cubes/cubes.cpp index 3e1f86ade..5a1ca9dc4 100644 --- a/examples/01-cubes/cubes.cpp +++ b/examples/01-cubes/cubes.cpp @@ -137,9 +137,9 @@ public: imguiDestroy(); // Cleanup. - bgfx::destroyIndexBuffer(m_ibh); - bgfx::destroyVertexBuffer(m_vbh); - bgfx::destroyProgram(m_program); + bgfx::destroy(m_ibh); + bgfx::destroy(m_vbh); + bgfx::destroy(m_program); // Shutdown bgfx. bgfx::shutdown(); diff --git a/examples/02-metaballs/metaballs.cpp b/examples/02-metaballs/metaballs.cpp index a0dd5f9b0..34d224133 100644 --- a/examples/02-metaballs/metaballs.cpp +++ b/examples/02-metaballs/metaballs.cpp @@ -531,7 +531,7 @@ public: delete [] m_grid; // Cleanup. - bgfx::destroyProgram(m_program); + bgfx::destroy(m_program); // Shutdown bgfx. bgfx::shutdown(); diff --git a/examples/03-raymarch/raymarch.cpp b/examples/03-raymarch/raymarch.cpp index a82e43209..882693742 100644 --- a/examples/03-raymarch/raymarch.cpp +++ b/examples/03-raymarch/raymarch.cpp @@ -149,10 +149,10 @@ public: imguiDestroy(); // Cleanup. - bgfx::destroyProgram(m_program); + bgfx::destroy(m_program); - bgfx::destroyUniform(u_mtx); - bgfx::destroyUniform(u_lightDirTime); + bgfx::destroy(u_mtx); + bgfx::destroy(u_lightDirTime); // Shutdown bgfx. bgfx::shutdown(); diff --git a/examples/04-mesh/mesh.cpp b/examples/04-mesh/mesh.cpp index 4bb7e607b..2b2e2f2ce 100644 --- a/examples/04-mesh/mesh.cpp +++ b/examples/04-mesh/mesh.cpp @@ -60,9 +60,9 @@ public: meshUnload(m_mesh); // Cleanup. - bgfx::destroyProgram(m_program); + bgfx::destroy(m_program); - bgfx::destroyUniform(u_time); + bgfx::destroy(u_time); // Shutdown bgfx. bgfx::shutdown(); diff --git a/examples/05-instancing/instancing.cpp b/examples/05-instancing/instancing.cpp index 4ee421be1..6f1210a62 100644 --- a/examples/05-instancing/instancing.cpp +++ b/examples/05-instancing/instancing.cpp @@ -117,9 +117,9 @@ public: imguiDestroy(); // Cleanup. - bgfx::destroyIndexBuffer(m_ibh); - bgfx::destroyVertexBuffer(m_vbh); - bgfx::destroyProgram(m_program); + bgfx::destroy(m_ibh); + bgfx::destroy(m_vbh); + bgfx::destroy(m_program); // Shutdown bgfx. bgfx::shutdown(); diff --git a/examples/06-bump/bump.cpp b/examples/06-bump/bump.cpp index ad1ed2ed8..3d0a4641b 100644 --- a/examples/06-bump/bump.cpp +++ b/examples/06-bump/bump.cpp @@ -163,15 +163,15 @@ public: imguiDestroy(); // Cleanup. - bgfx::destroyIndexBuffer(m_ibh); - bgfx::destroyVertexBuffer(m_vbh); - bgfx::destroyProgram(m_program); - bgfx::destroyTexture(m_textureColor); - bgfx::destroyTexture(m_textureNormal); - bgfx::destroyUniform(s_texColor); - bgfx::destroyUniform(s_texNormal); - bgfx::destroyUniform(u_lightPosRadius); - bgfx::destroyUniform(u_lightRgbInnerR); + bgfx::destroy(m_ibh); + bgfx::destroy(m_vbh); + bgfx::destroy(m_program); + bgfx::destroy(m_textureColor); + bgfx::destroy(m_textureNormal); + bgfx::destroy(s_texColor); + bgfx::destroy(s_texNormal); + bgfx::destroy(u_lightPosRadius); + bgfx::destroy(u_lightRgbInnerR); // Shutdown bgfx. bgfx::shutdown(); diff --git a/examples/07-callback/callback.cpp b/examples/07-callback/callback.cpp index 960b5fa8d..62eac1ba4 100644 --- a/examples/07-callback/callback.cpp +++ b/examples/07-callback/callback.cpp @@ -386,9 +386,9 @@ public: imguiDestroy(); // Cleanup. - bgfx::destroyIndexBuffer(m_ibh); - bgfx::destroyVertexBuffer(m_vbh); - bgfx::destroyProgram(m_program); + bgfx::destroy(m_ibh); + bgfx::destroy(m_vbh); + bgfx::destroy(m_program); // Shutdown bgfx. bgfx::shutdown(); diff --git a/examples/08-update/update.cpp b/examples/08-update/update.cpp index cd1cacd0b..789b2a038 100644 --- a/examples/08-update/update.cpp +++ b/examples/08-update/update.cpp @@ -306,39 +306,39 @@ public: for (uint32_t ii = 0; ii < BX_COUNTOF(m_textures); ++ii) { - bgfx::destroyTexture(m_textures[ii]); + bgfx::destroy(m_textures[ii]); } for (uint32_t ii = 0; ii < m_numTextures3d; ++ii) { - bgfx::destroyTexture(m_textures3d[ii]); + bgfx::destroy(m_textures3d[ii]); } - bgfx::destroyTexture(m_texture2d); + bgfx::destroy(m_texture2d); for (uint32_t ii = 0; ii>BGFX_RESET_MSAA_SHIFT; - bgfx::destroyFrameBuffer(m_fbh); + bgfx::destroy(m_fbh); m_fbtextures[0] = bgfx::createTexture2D(uint16_t(m_width), uint16_t(m_height), false, 1, bgfx::TextureFormat::BGRA8, ((msaa + 1) << BGFX_TEXTURE_RT_MSAA_SHIFT) | BGFX_TEXTURE_U_CLAMP | BGFX_TEXTURE_V_CLAMP); m_fbtextures[1] = bgfx::createTexture2D(uint16_t(m_width), uint16_t(m_height), false, 1, bgfx::TextureFormat::D16, BGFX_TEXTURE_RT_WRITE_ONLY|( (msaa+1)<textures[ii].id) && (gl->textures[ii].flags & NVG_IMAGE_NODELETE) == 0) { - bgfx::destroyTexture(gl->textures[ii].id); + bgfx::destroy(gl->textures[ii].id); } bx::memSet(&gl->textures[ii], 0, sizeof(gl->textures[ii]) ); gl->textures[ii].id.idx = bgfx::kInvalidHandle; @@ -1051,22 +1051,22 @@ namespace return; } - bgfx::destroyProgram(gl->prog); - bgfx::destroyTexture(gl->texMissing); + bgfx::destroy(gl->prog); + bgfx::destroy(gl->texMissing); - bgfx::destroyUniform(gl->u_scissorMat); - bgfx::destroyUniform(gl->u_paintMat); - bgfx::destroyUniform(gl->u_innerCol); - bgfx::destroyUniform(gl->u_outerCol); - bgfx::destroyUniform(gl->u_viewSize); - bgfx::destroyUniform(gl->u_scissorExtScale); - bgfx::destroyUniform(gl->u_extentRadius); - bgfx::destroyUniform(gl->u_params); - bgfx::destroyUniform(gl->s_tex); + bgfx::destroy(gl->u_scissorMat); + bgfx::destroy(gl->u_paintMat); + bgfx::destroy(gl->u_innerCol); + bgfx::destroy(gl->u_outerCol); + bgfx::destroy(gl->u_viewSize); + bgfx::destroy(gl->u_scissorExtScale); + bgfx::destroy(gl->u_extentRadius); + bgfx::destroy(gl->u_params); + bgfx::destroy(gl->s_tex); if (bgfx::isValid(gl->u_halfTexel) ) { - bgfx::destroyUniform(gl->u_halfTexel); + bgfx::destroy(gl->u_halfTexel); } for (uint32_t ii = 0, num = gl->ntextures; ii < num; ++ii) @@ -1074,7 +1074,7 @@ namespace if (bgfx::isValid(gl->textures[ii].id) && (gl->textures[ii].flags & NVG_IMAGE_NODELETE) == 0) { - bgfx::destroyTexture(gl->textures[ii].id); + bgfx::destroy(gl->textures[ii].id); } } @@ -1207,7 +1207,7 @@ NVGLUframebuffer* nvgluCreateFramebuffer(NVGcontext* _ctx, int _width, int _heig if (NULL == tex) { - bgfx::destroyFrameBuffer(fbh); + bgfx::destroy(fbh); return NULL; } @@ -1250,7 +1250,7 @@ void nvgluDeleteFramebuffer(NVGLUframebuffer* framebuffer) if (bgfx::isValid(framebuffer->handle)) { - bgfx::destroyFrameBuffer(framebuffer->handle); + bgfx::destroy(framebuffer->handle); } struct NVGparams* params = nvgInternalParams(framebuffer->ctx); diff --git a/examples/common/ps/particle_system.cpp b/examples/common/ps/particle_system.cpp index 2c9356794..631006482 100644 --- a/examples/common/ps/particle_system.cpp +++ b/examples/common/ps/particle_system.cpp @@ -525,9 +525,9 @@ namespace ps void shutdown() { - bgfx::destroyProgram(m_particleProgram); - bgfx::destroyTexture(m_texture); - bgfx::destroyUniform(s_texColor); + bgfx::destroy(m_particleProgram); + bgfx::destroy(m_texture); + bgfx::destroy(s_texColor); bx::destroyHandleAlloc(m_allocator, m_emitterAlloc); BX_FREE(m_allocator, m_emitter); diff --git a/include/bgfx/bgfx.h b/include/bgfx/bgfx.h index d7f622944..6d65c8860 100644 --- a/include/bgfx/bgfx.h +++ b/include/bgfx/bgfx.h @@ -1228,7 +1228,7 @@ namespace bgfx /// /// @attention C99 equivalent is `bgfx_destroy_index_buffer`. /// - void destroyIndexBuffer(IndexBufferHandle _handle); + void destroy(IndexBufferHandle _handle); /// Create static vertex buffer. /// @@ -1262,7 +1262,7 @@ namespace bgfx /// /// @attention C99 equivalent is `bgfx_destroy_vertex_buffer`. /// - void destroyVertexBuffer(VertexBufferHandle _handle); + void destroy(VertexBufferHandle _handle); /// Create empty dynamic index buffer. /// @@ -1332,7 +1332,7 @@ namespace bgfx /// /// @attention C99 equivalent is `bgfx_destroy_dynamic_index_buffer`. /// - void destroyDynamicIndexBuffer(DynamicIndexBufferHandle _handle); + void destroy(DynamicIndexBufferHandle _handle); /// Create empty dynamic vertex buffer. /// @@ -1406,7 +1406,7 @@ namespace bgfx /// /// @attention C99 equivalent is `bgfx_destroy_dynamic_vertex_buffer`. /// - void destroyDynamicVertexBuffer(DynamicVertexBufferHandle _handle); + void destroy(DynamicVertexBufferHandle _handle); /// Returns number of available indices. /// @@ -1510,7 +1510,7 @@ namespace bgfx /// /// @attention C99 equivalent is `bgfx_destroy_indirect_buffer`. /// - void destroyIndirectBuffer(IndirectBufferHandle _handle); + void destroy(IndirectBufferHandle _handle); /// Create shader from memory buffer. /// @@ -1541,7 +1541,7 @@ namespace bgfx /// /// @attention C99 equivalent is `bgfx_destroy_shader`. /// - void destroyShader(ShaderHandle _handle); + void destroy(ShaderHandle _handle); /// Create program with vertex and fragment shaders. /// @@ -1578,7 +1578,7 @@ namespace bgfx /// /// @attention C99 equivalent is `bgfx_destroy_program`. /// - void destroyProgram(ProgramHandle _handle); + void destroy(ProgramHandle _handle); /// Validate texture parameters. /// @@ -1882,7 +1882,7 @@ namespace bgfx /// /// @attention C99 equivalent is `bgfx_destroy_texture`. /// - void destroyTexture(TextureHandle _handle); + void destroy(TextureHandle _handle); /// Create frame buffer (simple). /// @@ -2000,7 +2000,7 @@ namespace bgfx /// /// @attention C99 equivalent is `bgfx_destroy_frame_buffer`. /// - void destroyFrameBuffer(FrameBufferHandle _handle); + void destroy(FrameBufferHandle _handle); /// Create shader uniform parameter. /// @@ -2053,7 +2053,7 @@ namespace bgfx /// /// @attention C99 equivalent is `bgfx_destroy_uniform`. /// - void destroyUniform(UniformHandle _handle); + void destroy(UniformHandle _handle); /// Create occlusion query. /// @@ -2080,7 +2080,7 @@ namespace bgfx /// /// @attention C99 equivalent is `bgfx_destroy_occlusion_query`. /// - void destroyOcclusionQuery(OcclusionQueryHandle _handle); + void destroy(OcclusionQueryHandle _handle); /// Set palette color value. /// diff --git a/include/bgfx/defines.h b/include/bgfx/defines.h index 93572bb7b..4c79f9a3f 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(43) +#define BGFX_API_VERSION UINT32_C(44) /// #define BGFX_STATE_RGB_WRITE UINT64_C(0x0000000000000001) //!< Enable RGB write. diff --git a/src/bgfx.cpp b/src/bgfx.cpp index 95f664bd4..7f47bdf01 100644 --- a/src/bgfx.cpp +++ b/src/bgfx.cpp @@ -626,10 +626,10 @@ namespace bgfx if (isValid(m_program) ) { - destroyProgram(m_program); + destroy(m_program); } - destroyTexture(m_texture); + destroy(m_texture); s_ctx->destroyTransientVertexBuffer(m_vb); s_ctx->destroyTransientIndexBuffer(m_ib); } @@ -761,10 +761,10 @@ namespace bgfx m_program[ii] = createProgram(vsh, fsh); BX_CHECK(isValid(m_program[ii]), "Failed to create clear quad program."); - destroyShader(fsh); + destroy(fsh); } - destroyShader(vsh); + destroy(vsh); m_vb = s_ctx->createTransientVertexBuffer(4*m_decl.m_stride, &m_decl); } @@ -780,7 +780,7 @@ namespace bgfx { if (isValid(m_program[ii]) ) { - destroyProgram(m_program[ii]); + destroy(m_program[ii]); m_program[ii].idx = kInvalidHandle; } } @@ -2872,7 +2872,7 @@ error: return s_ctx->createIndexBuffer(_mem, _flags); } - void destroyIndexBuffer(IndexBufferHandle _handle) + void destroy(IndexBufferHandle _handle) { BGFX_CHECK_MAIN_THREAD(); s_ctx->destroyIndexBuffer(_handle); @@ -2886,7 +2886,7 @@ error: return s_ctx->createVertexBuffer(_mem, _decl, _flags); } - void destroyVertexBuffer(VertexBufferHandle _handle) + void destroy(VertexBufferHandle _handle) { BGFX_CHECK_MAIN_THREAD(); s_ctx->destroyVertexBuffer(_handle); @@ -2912,7 +2912,7 @@ error: s_ctx->updateDynamicIndexBuffer(_handle, _startIndex, _mem); } - void destroyDynamicIndexBuffer(DynamicIndexBufferHandle _handle) + void destroy(DynamicIndexBufferHandle _handle) { BGFX_CHECK_MAIN_THREAD(); s_ctx->destroyDynamicIndexBuffer(_handle); @@ -2940,7 +2940,7 @@ error: s_ctx->updateDynamicVertexBuffer(_handle, _startVertex, _mem); } - void destroyDynamicVertexBuffer(DynamicVertexBufferHandle _handle) + void destroy(DynamicVertexBufferHandle _handle) { BGFX_CHECK_MAIN_THREAD(); s_ctx->destroyDynamicVertexBuffer(_handle); @@ -3026,7 +3026,7 @@ error: return s_ctx->createIndirectBuffer(_num); } - void destroyIndirectBuffer(IndirectBufferHandle _handle) + void destroy(IndirectBufferHandle _handle) { BGFX_CHECK_MAIN_THREAD(); s_ctx->destroyIndirectBuffer(_handle); @@ -3045,7 +3045,7 @@ error: return s_ctx->getShaderUniforms(_handle, _uniforms, _max); } - void destroyShader(ShaderHandle _handle) + void destroy(ShaderHandle _handle) { BGFX_CHECK_MAIN_THREAD(); s_ctx->destroyShader(_handle); @@ -3068,7 +3068,7 @@ error: return s_ctx->createProgram(_csh, _destroyShader); } - void destroyProgram(ProgramHandle _handle) + void destroy(ProgramHandle _handle) { BGFX_CHECK_MAIN_THREAD(); s_ctx->destroyProgram(_handle); @@ -3366,7 +3366,7 @@ error: return s_ctx->createTexture(mem, _flags, 0, NULL, BackbufferRatio::Count); } - void destroyTexture(TextureHandle _handle) + void destroy(TextureHandle _handle) { BGFX_CHECK_MAIN_THREAD(); s_ctx->destroyTexture(_handle); @@ -3493,7 +3493,7 @@ error: return s_ctx->getTexture(_handle, _attachment); } - void destroyFrameBuffer(FrameBufferHandle _handle) + void destroy(FrameBufferHandle _handle) { BGFX_CHECK_MAIN_THREAD(); s_ctx->destroyFrameBuffer(_handle); @@ -3511,7 +3511,7 @@ error: s_ctx->getUniformInfo(_handle, _info); } - void destroyUniform(UniformHandle _handle) + void destroy(UniformHandle _handle) { BGFX_CHECK_MAIN_THREAD(); s_ctx->destroyUniform(_handle); @@ -3531,7 +3531,7 @@ error: return s_ctx->getResult(_handle, _result); } - void destroyOcclusionQuery(OcclusionQueryHandle _handle) + void destroy(OcclusionQueryHandle _handle) { BGFX_CHECK_MAIN_THREAD(); BGFX_CHECK_CAPS(BGFX_CAPS_OCCLUSION_QUERY, "Occlusion query is not supported!"); @@ -4346,7 +4346,7 @@ BGFX_C_API bgfx_index_buffer_handle_t bgfx_create_index_buffer(const bgfx_memory BGFX_C_API void bgfx_destroy_index_buffer(bgfx_index_buffer_handle_t _handle) { union { bgfx_index_buffer_handle_t c; bgfx::IndexBufferHandle cpp; } handle = { _handle }; - bgfx::destroyIndexBuffer(handle.cpp); + bgfx::destroy(handle.cpp); } BGFX_C_API bgfx_vertex_buffer_handle_t bgfx_create_vertex_buffer(const bgfx_memory_t* _mem, const bgfx_vertex_decl_t* _decl, uint16_t _flags) @@ -4360,7 +4360,7 @@ BGFX_C_API bgfx_vertex_buffer_handle_t bgfx_create_vertex_buffer(const bgfx_memo BGFX_C_API void bgfx_destroy_vertex_buffer(bgfx_vertex_buffer_handle_t _handle) { union { bgfx_vertex_buffer_handle_t c; bgfx::VertexBufferHandle cpp; } handle = { _handle }; - bgfx::destroyVertexBuffer(handle.cpp); + bgfx::destroy(handle.cpp); } BGFX_C_API bgfx_dynamic_index_buffer_handle_t bgfx_create_dynamic_index_buffer(uint32_t _num, uint16_t _flags) @@ -4386,7 +4386,7 @@ BGFX_C_API void bgfx_update_dynamic_index_buffer(bgfx_dynamic_index_buffer_handl BGFX_C_API void bgfx_destroy_dynamic_index_buffer(bgfx_dynamic_index_buffer_handle_t _handle) { union { bgfx_dynamic_index_buffer_handle_t c; bgfx::DynamicIndexBufferHandle cpp; } handle = { _handle }; - bgfx::destroyDynamicIndexBuffer(handle.cpp); + bgfx::destroy(handle.cpp); } BGFX_C_API bgfx_dynamic_vertex_buffer_handle_t bgfx_create_dynamic_vertex_buffer(uint32_t _num, const bgfx_vertex_decl_t* _decl, uint16_t _flags) @@ -4414,7 +4414,7 @@ BGFX_C_API void bgfx_update_dynamic_vertex_buffer(bgfx_dynamic_vertex_buffer_han BGFX_C_API void bgfx_destroy_dynamic_vertex_buffer(bgfx_dynamic_vertex_buffer_handle_t _handle) { union { bgfx_dynamic_vertex_buffer_handle_t c; bgfx::DynamicVertexBufferHandle cpp; } handle = { _handle }; - bgfx::destroyDynamicVertexBuffer(handle.cpp); + bgfx::destroy(handle.cpp); } BGFX_C_API uint32_t bgfx_get_avail_transient_index_buffer(uint32_t _num) @@ -4465,7 +4465,7 @@ BGFX_C_API bgfx_indirect_buffer_handle_t bgfx_create_indirect_buffer(uint32_t _n BGFX_C_API void bgfx_destroy_indirect_buffer(bgfx_indirect_buffer_handle_t _handle) { union { bgfx_indirect_buffer_handle_t c; bgfx::IndirectBufferHandle cpp; } handle = { _handle }; - bgfx::destroyIndirectBuffer(handle.cpp); + bgfx::destroy(handle.cpp); } BGFX_C_API bgfx_shader_handle_t bgfx_create_shader(const bgfx_memory_t* _mem) @@ -4484,7 +4484,7 @@ BGFX_C_API uint16_t bgfx_get_shader_uniforms(bgfx_shader_handle_t _handle, bgfx_ BGFX_C_API void bgfx_destroy_shader(bgfx_shader_handle_t _handle) { union { bgfx_shader_handle_t c; bgfx::ShaderHandle cpp; } handle = { _handle }; - bgfx::destroyShader(handle.cpp); + bgfx::destroy(handle.cpp); } BGFX_C_API bgfx_program_handle_t bgfx_create_program(bgfx_shader_handle_t _vsh, bgfx_shader_handle_t _fsh, bool _destroyShaders) @@ -4507,7 +4507,7 @@ BGFX_C_API bgfx_program_handle_t bgfx_create_compute_program(bgfx_shader_handle_ BGFX_C_API void bgfx_destroy_program(bgfx_program_handle_t _handle) { union { bgfx_program_handle_t c; bgfx::ProgramHandle cpp; } handle = { _handle }; - bgfx::destroyProgram(handle.cpp); + bgfx::destroy(handle.cpp); } BGFX_C_API bool bgfx_is_texture_valid(uint16_t _depth, bool _cubeMap, uint16_t _numLayers, bgfx_texture_format_t _format, uint32_t _flags) @@ -4584,7 +4584,7 @@ BGFX_C_API uint32_t bgfx_read_texture(bgfx_texture_handle_t _handle, void* _data BGFX_C_API void bgfx_destroy_texture(bgfx_texture_handle_t _handle) { union { bgfx_texture_handle_t c; bgfx::TextureHandle cpp; } handle = { _handle }; - bgfx::destroyTexture(handle.cpp); + bgfx::destroy(handle.cpp); } BGFX_C_API bgfx_frame_buffer_handle_t bgfx_create_frame_buffer(uint16_t _width, uint16_t _height, bgfx_texture_format_t _format, uint32_t _textureFlags) @@ -4633,7 +4633,7 @@ BGFX_C_API bgfx_texture_handle_t bgfx_get_texture(bgfx_frame_buffer_handle_t _ha BGFX_C_API void bgfx_destroy_frame_buffer(bgfx_frame_buffer_handle_t _handle) { union { bgfx_frame_buffer_handle_t c; bgfx::FrameBufferHandle cpp; } handle = { _handle }; - bgfx::destroyFrameBuffer(handle.cpp); + bgfx::destroy(handle.cpp); } BGFX_C_API bgfx_uniform_handle_t bgfx_create_uniform(const char* _name, bgfx_uniform_type_t _type, uint16_t _num) @@ -4653,7 +4653,7 @@ BGFX_C_API void bgfx_get_uniform_info(bgfx_uniform_handle_t _handle, bgfx_unifor BGFX_C_API void bgfx_destroy_uniform(bgfx_uniform_handle_t _handle) { union { bgfx_uniform_handle_t c; bgfx::UniformHandle cpp; } handle = { _handle }; - bgfx::destroyUniform(handle.cpp); + bgfx::destroy(handle.cpp); } BGFX_C_API bgfx_occlusion_query_handle_t bgfx_create_occlusion_query() @@ -4672,7 +4672,7 @@ BGFX_C_API bgfx_occlusion_query_result_t bgfx_get_result(bgfx_occlusion_query_ha BGFX_C_API void bgfx_destroy_occlusion_query(bgfx_occlusion_query_handle_t _handle) { union { bgfx_occlusion_query_handle_t c; bgfx::OcclusionQueryHandle cpp; } handle = { _handle }; - bgfx::destroyOcclusionQuery(handle.cpp); + bgfx::destroy(handle.cpp); } BGFX_C_API void bgfx_set_palette_color(uint8_t _index, const float _rgba[4]) diff --git a/tools/texturev/texturev.cpp b/tools/texturev/texturev.cpp index 09769717e..f8a79085c 100644 --- a/tools/texturev/texturev.cpp +++ b/tools/texturev/texturev.cpp @@ -1407,7 +1407,7 @@ int _main_(int _argc, char** _argv) { if (bgfx::isValid(texture) ) { - bgfx::destroyTexture(texture); + bgfx::destroy(texture); } fileIndex = view.m_fileIndex; @@ -1628,19 +1628,19 @@ int _main_(int _argc, char** _argv) if (bgfx::isValid(texture) ) { - bgfx::destroyTexture(texture); + bgfx::destroy(texture); } - bgfx::destroyTexture(checkerBoard); - bgfx::destroyUniform(s_texColor); - bgfx::destroyUniform(u_mtx); - bgfx::destroyUniform(u_params); - bgfx::destroyProgram(textureProgram); - bgfx::destroyProgram(textureArrayProgram); - bgfx::destroyProgram(textureCubeProgram); - bgfx::destroyProgram(textureCube2Program); - bgfx::destroyProgram(textureSdfProgram); - bgfx::destroyProgram(texture3DProgram); + bgfx::destroy(checkerBoard); + bgfx::destroy(s_texColor); + bgfx::destroy(u_mtx); + bgfx::destroy(u_params); + bgfx::destroy(textureProgram); + bgfx::destroy(textureArrayProgram); + bgfx::destroy(textureCubeProgram); + bgfx::destroy(textureCube2Program); + bgfx::destroy(textureSdfProgram); + bgfx::destroy(texture3DProgram); imguiDestroy();