API change: Simplified destroy functions to use overload resolution.
This commit is contained in:
parent
a247d29298
commit
7c9b2b7257
@ -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();
|
||||
|
@ -531,7 +531,7 @@ public:
|
||||
delete [] m_grid;
|
||||
|
||||
// Cleanup.
|
||||
bgfx::destroyProgram(m_program);
|
||||
bgfx::destroy(m_program);
|
||||
|
||||
// Shutdown bgfx.
|
||||
bgfx::shutdown();
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -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<BX_COUNTOF(m_textureCube); ++ii)
|
||||
{
|
||||
if (bgfx::isValid(m_textureCube[ii]))
|
||||
{
|
||||
bgfx::destroyTexture(m_textureCube[ii]);
|
||||
bgfx::destroy(m_textureCube[ii]);
|
||||
}
|
||||
}
|
||||
|
||||
bgfx::destroyIndexBuffer(m_ibh);
|
||||
bgfx::destroyVertexBuffer(m_vbh);
|
||||
bgfx::destroy(m_ibh);
|
||||
bgfx::destroy(m_vbh);
|
||||
if (bgfx::isValid(m_program3d) )
|
||||
{
|
||||
bgfx::destroyProgram(m_program3d);
|
||||
bgfx::destroy(m_program3d);
|
||||
}
|
||||
bgfx::destroyProgram(m_programCmp);
|
||||
bgfx::destroy(m_programCmp);
|
||||
if (bgfx::isValid(m_programCompute) )
|
||||
{
|
||||
bgfx::destroyProgram(m_programCompute);
|
||||
bgfx::destroy(m_programCompute);
|
||||
}
|
||||
bgfx::destroyProgram(m_program);
|
||||
bgfx::destroyUniform(u_time);
|
||||
bgfx::destroyUniform(s_texColor);
|
||||
bgfx::destroyUniform(s_texCube);
|
||||
bgfx::destroy(m_program);
|
||||
bgfx::destroy(u_time);
|
||||
bgfx::destroy(s_texColor);
|
||||
bgfx::destroy(s_texCube);
|
||||
|
||||
// Shutdown bgfx.
|
||||
bgfx::shutdown();
|
||||
|
@ -240,32 +240,32 @@ public:
|
||||
|
||||
for (uint32_t ii = 0; ii < BX_COUNTOF(m_lum); ++ii)
|
||||
{
|
||||
bgfx::destroyFrameBuffer(m_lum[ii]);
|
||||
bgfx::destroy(m_lum[ii]);
|
||||
}
|
||||
bgfx::destroyFrameBuffer(m_bright);
|
||||
bgfx::destroyFrameBuffer(m_blur);
|
||||
bgfx::destroyFrameBuffer(m_fbh);
|
||||
bgfx::destroy(m_bright);
|
||||
bgfx::destroy(m_blur);
|
||||
bgfx::destroy(m_fbh);
|
||||
|
||||
bgfx::destroyProgram(m_meshProgram);
|
||||
bgfx::destroyProgram(m_skyProgram);
|
||||
bgfx::destroyProgram(m_tonemapProgram);
|
||||
bgfx::destroyProgram(m_lumProgram);
|
||||
bgfx::destroyProgram(m_lumAvgProgram);
|
||||
bgfx::destroyProgram(m_blurProgram);
|
||||
bgfx::destroyProgram(m_brightProgram);
|
||||
bgfx::destroyTexture(m_uffizi);
|
||||
bgfx::destroy(m_meshProgram);
|
||||
bgfx::destroy(m_skyProgram);
|
||||
bgfx::destroy(m_tonemapProgram);
|
||||
bgfx::destroy(m_lumProgram);
|
||||
bgfx::destroy(m_lumAvgProgram);
|
||||
bgfx::destroy(m_blurProgram);
|
||||
bgfx::destroy(m_brightProgram);
|
||||
bgfx::destroy(m_uffizi);
|
||||
if (bgfx::isValid(m_rb) )
|
||||
{
|
||||
bgfx::destroyTexture(m_rb);
|
||||
bgfx::destroy(m_rb);
|
||||
}
|
||||
|
||||
bgfx::destroyUniform(s_texCube);
|
||||
bgfx::destroyUniform(s_texColor);
|
||||
bgfx::destroyUniform(s_texLum);
|
||||
bgfx::destroyUniform(s_texBlur);
|
||||
bgfx::destroyUniform(u_mtx);
|
||||
bgfx::destroyUniform(u_tonemap);
|
||||
bgfx::destroyUniform(u_offset);
|
||||
bgfx::destroy(s_texCube);
|
||||
bgfx::destroy(s_texColor);
|
||||
bgfx::destroy(s_texLum);
|
||||
bgfx::destroy(s_texBlur);
|
||||
bgfx::destroy(u_mtx);
|
||||
bgfx::destroy(u_tonemap);
|
||||
bgfx::destroy(u_offset);
|
||||
|
||||
// Shutdown bgfx.
|
||||
bgfx::shutdown();
|
||||
@ -288,7 +288,7 @@ public:
|
||||
|
||||
uint32_t msaa = (m_reset&BGFX_RESET_MSAA_MASK)>>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)<<BGFX_TEXTURE_RT_MSAA_SHIFT) );
|
||||
|
@ -110,15 +110,15 @@ public:
|
||||
}
|
||||
|
||||
// Cleanup.
|
||||
bgfx::destroyProgram(m_program);
|
||||
bgfx::destroy(m_program);
|
||||
|
||||
bgfx::destroyUniform(s_texColor);
|
||||
bgfx::destroyUniform(s_texStipple);
|
||||
bgfx::destroyUniform(u_stipple);
|
||||
bgfx::destroy(s_texColor);
|
||||
bgfx::destroy(s_texStipple);
|
||||
bgfx::destroy(u_stipple);
|
||||
|
||||
bgfx::destroyTexture(m_textureStipple);
|
||||
bgfx::destroyTexture(m_textureLeafs);
|
||||
bgfx::destroyTexture(m_textureBark);
|
||||
bgfx::destroy(m_textureStipple);
|
||||
bgfx::destroy(m_textureLeafs);
|
||||
bgfx::destroy(m_textureBark);
|
||||
|
||||
// Shutdown bgfx.
|
||||
bgfx::shutdown();
|
||||
|
@ -317,13 +317,13 @@ struct Uniforms
|
||||
|
||||
void destroy()
|
||||
{
|
||||
bgfx::destroyUniform(u_params);
|
||||
bgfx::destroyUniform(u_ambient);
|
||||
bgfx::destroyUniform(u_diffuse);
|
||||
bgfx::destroyUniform(u_specular_shininess);
|
||||
bgfx::destroyUniform(u_color);
|
||||
bgfx::destroyUniform(u_lightPosRadius);
|
||||
bgfx::destroyUniform(u_lightRgbInnerR);
|
||||
bgfx::destroy(u_params);
|
||||
bgfx::destroy(u_ambient);
|
||||
bgfx::destroy(u_diffuse);
|
||||
bgfx::destroy(u_specular_shininess);
|
||||
bgfx::destroy(u_color);
|
||||
bgfx::destroy(u_lightPosRadius);
|
||||
bgfx::destroy(u_lightRgbInnerR);
|
||||
}
|
||||
|
||||
struct Params
|
||||
@ -736,11 +736,11 @@ struct Mesh
|
||||
for (GroupArray::const_iterator it = m_groups.begin(), itEnd = m_groups.end(); it != itEnd; ++it)
|
||||
{
|
||||
const Group& group = *it;
|
||||
bgfx::destroyVertexBuffer(group.m_vbh);
|
||||
bgfx::destroy(group.m_vbh);
|
||||
|
||||
if (bgfx::isValid(group.m_ibh) )
|
||||
{
|
||||
bgfx::destroyIndexBuffer(group.m_ibh);
|
||||
bgfx::destroy(group.m_ibh);
|
||||
}
|
||||
}
|
||||
m_groups.clear();
|
||||
@ -885,17 +885,17 @@ public:
|
||||
m_hplaneMesh.unload();
|
||||
m_vplaneMesh.unload();
|
||||
|
||||
bgfx::destroyTexture(m_figureTex);
|
||||
bgfx::destroyTexture(m_fieldstoneTex);
|
||||
bgfx::destroyTexture(m_flareTex);
|
||||
bgfx::destroy(m_figureTex);
|
||||
bgfx::destroy(m_fieldstoneTex);
|
||||
bgfx::destroy(m_flareTex);
|
||||
|
||||
bgfx::destroyProgram(m_programTextureLighting);
|
||||
bgfx::destroyProgram(m_programColorLighting);
|
||||
bgfx::destroyProgram(m_programColorTexture);
|
||||
bgfx::destroyProgram(m_programColorBlack);
|
||||
bgfx::destroyProgram(m_programTexture);
|
||||
bgfx::destroy(m_programTextureLighting);
|
||||
bgfx::destroy(m_programColorLighting);
|
||||
bgfx::destroy(m_programColorTexture);
|
||||
bgfx::destroy(m_programColorBlack);
|
||||
bgfx::destroy(m_programTexture);
|
||||
|
||||
bgfx::destroyUniform(s_texColor);
|
||||
bgfx::destroy(s_texColor);
|
||||
|
||||
s_uniforms.destroy();
|
||||
|
||||
|
@ -261,16 +261,16 @@ struct Uniforms
|
||||
|
||||
void destroy()
|
||||
{
|
||||
bgfx::destroyUniform(u_params);
|
||||
bgfx::destroyUniform(u_svparams);
|
||||
bgfx::destroyUniform(u_ambient);
|
||||
bgfx::destroyUniform(u_diffuse);
|
||||
bgfx::destroyUniform(u_specular_shininess);
|
||||
bgfx::destroyUniform(u_fog);
|
||||
bgfx::destroyUniform(u_color);
|
||||
bgfx::destroyUniform(u_lightPosRadius);
|
||||
bgfx::destroyUniform(u_lightRgbInnerR);
|
||||
bgfx::destroyUniform(u_virtualLightPos_extrusionDist);
|
||||
bgfx::destroy(u_params);
|
||||
bgfx::destroy(u_svparams);
|
||||
bgfx::destroy(u_ambient);
|
||||
bgfx::destroy(u_diffuse);
|
||||
bgfx::destroy(u_specular_shininess);
|
||||
bgfx::destroy(u_fog);
|
||||
bgfx::destroy(u_color);
|
||||
bgfx::destroy(u_lightPosRadius);
|
||||
bgfx::destroy(u_lightRgbInnerR);
|
||||
bgfx::destroy(u_virtualLightPos_extrusionDist);
|
||||
}
|
||||
|
||||
struct Params
|
||||
@ -928,10 +928,10 @@ struct Group
|
||||
|
||||
void unload()
|
||||
{
|
||||
bgfx::destroyVertexBuffer(m_vbh);
|
||||
bgfx::destroy(m_vbh);
|
||||
if (bgfx::kInvalidHandle != m_ibh.idx)
|
||||
{
|
||||
bgfx::destroyIndexBuffer(m_ibh);
|
||||
bgfx::destroy(m_ibh);
|
||||
}
|
||||
free(m_vertices);
|
||||
m_vertices = NULL;
|
||||
@ -1661,8 +1661,8 @@ void shadowVolumeCreate(ShadowVolume& _shadowVolume
|
||||
|
||||
// bgfx::destroy*Buffer doesn't actually destroy buffers now.
|
||||
// Instead, these bgfx::destroy*Buffer commands get queued to be executed after the end of the next frame.
|
||||
bgfx::destroyVertexBuffer(_shadowVolume.m_vbSides);
|
||||
bgfx::destroyIndexBuffer(_shadowVolume.m_ibSides);
|
||||
bgfx::destroy(_shadowVolume.m_vbSides);
|
||||
bgfx::destroy(_shadowVolume.m_ibSides);
|
||||
|
||||
if (cap)
|
||||
{
|
||||
@ -1672,7 +1672,7 @@ void shadowVolumeCreate(ShadowVolume& _shadowVolume
|
||||
_shadowVolume.m_ibFrontCap = bgfx::createIndexBuffer(mem);
|
||||
|
||||
//gets destroyed after the end of the next frame
|
||||
bgfx::destroyIndexBuffer(_shadowVolume.m_ibFrontCap);
|
||||
bgfx::destroy(_shadowVolume.m_ibFrontCap);
|
||||
|
||||
//back cap
|
||||
isize = backCapI * sizeof(uint16_t);
|
||||
@ -1680,7 +1680,7 @@ void shadowVolumeCreate(ShadowVolume& _shadowVolume
|
||||
_shadowVolume.m_ibBackCap = bgfx::createIndexBuffer(mem);
|
||||
|
||||
//gets destroyed after the end of the next frame
|
||||
bgfx::destroyIndexBuffer(_shadowVolume.m_ibBackCap);
|
||||
bgfx::destroy(_shadowVolume.m_ibBackCap);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2055,30 +2055,30 @@ public:
|
||||
|
||||
s_uniforms.destroy();
|
||||
|
||||
bgfx::destroyUniform(s_texColor);
|
||||
bgfx::destroyUniform(s_texStencil);
|
||||
bgfx::destroyFrameBuffer(s_stencilFb);
|
||||
bgfx::destroy(s_texColor);
|
||||
bgfx::destroy(s_texStencil);
|
||||
bgfx::destroy(s_stencilFb);
|
||||
|
||||
bgfx::destroyTexture(m_figureTex);
|
||||
bgfx::destroyTexture(m_fieldstoneTex);
|
||||
bgfx::destroyTexture(m_flareTex);
|
||||
bgfx::destroy(m_figureTex);
|
||||
bgfx::destroy(m_fieldstoneTex);
|
||||
bgfx::destroy(m_flareTex);
|
||||
|
||||
bgfx::destroyProgram(m_programTextureLighting);
|
||||
bgfx::destroyProgram(m_programColorLighting);
|
||||
bgfx::destroyProgram(m_programColorTexture);
|
||||
bgfx::destroyProgram(m_programTexture);
|
||||
bgfx::destroy(m_programTextureLighting);
|
||||
bgfx::destroy(m_programColorLighting);
|
||||
bgfx::destroy(m_programColorTexture);
|
||||
bgfx::destroy(m_programTexture);
|
||||
|
||||
bgfx::destroyProgram(m_programBackBlank);
|
||||
bgfx::destroyProgram(m_programSideBlank);
|
||||
bgfx::destroyProgram(m_programFrontBlank);
|
||||
bgfx::destroyProgram(m_programBackColor);
|
||||
bgfx::destroyProgram(m_programSideColor);
|
||||
bgfx::destroyProgram(m_programFrontColor);
|
||||
bgfx::destroyProgram(m_programSideTex);
|
||||
bgfx::destroyProgram(m_programBackTex1);
|
||||
bgfx::destroyProgram(m_programBackTex2);
|
||||
bgfx::destroyProgram(m_programFrontTex1);
|
||||
bgfx::destroyProgram(m_programFrontTex2);
|
||||
bgfx::destroy(m_programBackBlank);
|
||||
bgfx::destroy(m_programSideBlank);
|
||||
bgfx::destroy(m_programFrontBlank);
|
||||
bgfx::destroy(m_programBackColor);
|
||||
bgfx::destroy(m_programSideColor);
|
||||
bgfx::destroy(m_programFrontColor);
|
||||
bgfx::destroy(m_programSideTex);
|
||||
bgfx::destroy(m_programBackTex1);
|
||||
bgfx::destroy(m_programBackTex2);
|
||||
bgfx::destroy(m_programFrontTex1);
|
||||
bgfx::destroy(m_programFrontTex2);
|
||||
|
||||
cameraDestroy();
|
||||
imguiDestroy();
|
||||
@ -2108,7 +2108,7 @@ public:
|
||||
m_oldWidth = m_viewState.m_width;
|
||||
m_oldHeight = m_viewState.m_height;
|
||||
|
||||
bgfx::destroyFrameBuffer(s_stencilFb);
|
||||
bgfx::destroy(s_stencilFb);
|
||||
|
||||
bgfx::TextureHandle fbtextures[] =
|
||||
{
|
||||
|
@ -232,18 +232,18 @@ public:
|
||||
meshStateDestroy(m_state[0]);
|
||||
meshStateDestroy(m_state[1]);
|
||||
|
||||
bgfx::destroyVertexBuffer(m_vbh);
|
||||
bgfx::destroyIndexBuffer(m_ibh);
|
||||
bgfx::destroy(m_vbh);
|
||||
bgfx::destroy(m_ibh);
|
||||
|
||||
bgfx::destroyProgram(m_progShadow);
|
||||
bgfx::destroyProgram(m_progMesh);
|
||||
bgfx::destroy(m_progShadow);
|
||||
bgfx::destroy(m_progMesh);
|
||||
|
||||
bgfx::destroyFrameBuffer(m_shadowMapFB);
|
||||
bgfx::destroy(m_shadowMapFB);
|
||||
|
||||
bgfx::destroyUniform(u_shadowMap);
|
||||
bgfx::destroyUniform(u_lightPos);
|
||||
bgfx::destroyUniform(u_lightMtx);
|
||||
bgfx::destroyUniform(u_depthScaleOffset);
|
||||
bgfx::destroy(u_shadowMap);
|
||||
bgfx::destroy(u_lightPos);
|
||||
bgfx::destroy(u_lightMtx);
|
||||
bgfx::destroy(u_depthScaleOffset);
|
||||
|
||||
// Shutdown bgfx.
|
||||
bgfx::shutdown();
|
||||
|
@ -492,34 +492,34 @@ struct Uniforms
|
||||
|
||||
void destroy()
|
||||
{
|
||||
bgfx::destroyUniform(u_params0);
|
||||
bgfx::destroyUniform(u_params1);
|
||||
bgfx::destroyUniform(u_params2);
|
||||
bgfx::destroyUniform(u_color);
|
||||
bgfx::destroyUniform(u_smSamplingParams);
|
||||
bgfx::destroyUniform(u_csmFarDistances);
|
||||
bgfx::destroy(u_params0);
|
||||
bgfx::destroy(u_params1);
|
||||
bgfx::destroy(u_params2);
|
||||
bgfx::destroy(u_color);
|
||||
bgfx::destroy(u_smSamplingParams);
|
||||
bgfx::destroy(u_csmFarDistances);
|
||||
|
||||
bgfx::destroyUniform(u_materialKa);
|
||||
bgfx::destroyUniform(u_materialKd);
|
||||
bgfx::destroyUniform(u_materialKs);
|
||||
bgfx::destroy(u_materialKa);
|
||||
bgfx::destroy(u_materialKd);
|
||||
bgfx::destroy(u_materialKs);
|
||||
|
||||
bgfx::destroyUniform(u_tetraNormalGreen);
|
||||
bgfx::destroyUniform(u_tetraNormalYellow);
|
||||
bgfx::destroyUniform(u_tetraNormalBlue);
|
||||
bgfx::destroyUniform(u_tetraNormalRed);
|
||||
bgfx::destroy(u_tetraNormalGreen);
|
||||
bgfx::destroy(u_tetraNormalYellow);
|
||||
bgfx::destroy(u_tetraNormalBlue);
|
||||
bgfx::destroy(u_tetraNormalRed);
|
||||
|
||||
bgfx::destroyUniform(u_shadowMapMtx0);
|
||||
bgfx::destroyUniform(u_shadowMapMtx1);
|
||||
bgfx::destroyUniform(u_shadowMapMtx2);
|
||||
bgfx::destroyUniform(u_shadowMapMtx3);
|
||||
bgfx::destroy(u_shadowMapMtx0);
|
||||
bgfx::destroy(u_shadowMapMtx1);
|
||||
bgfx::destroy(u_shadowMapMtx2);
|
||||
bgfx::destroy(u_shadowMapMtx3);
|
||||
|
||||
bgfx::destroyUniform(u_lightMtx);
|
||||
bgfx::destroyUniform(u_lightPosition);
|
||||
bgfx::destroyUniform(u_lightAmbientPower);
|
||||
bgfx::destroyUniform(u_lightDiffusePower);
|
||||
bgfx::destroyUniform(u_lightSpecularPower);
|
||||
bgfx::destroyUniform(u_lightSpotDirectionInner);
|
||||
bgfx::destroyUniform(u_lightAttenuationSpotOuter);
|
||||
bgfx::destroy(u_lightMtx);
|
||||
bgfx::destroy(u_lightPosition);
|
||||
bgfx::destroy(u_lightAmbientPower);
|
||||
bgfx::destroy(u_lightDiffusePower);
|
||||
bgfx::destroy(u_lightSpecularPower);
|
||||
bgfx::destroy(u_lightSpotDirectionInner);
|
||||
bgfx::destroy(u_lightAttenuationSpotOuter);
|
||||
}
|
||||
|
||||
union
|
||||
@ -924,11 +924,11 @@ struct Mesh
|
||||
for (GroupArray::const_iterator it = m_groups.begin(), itEnd = m_groups.end(); it != itEnd; ++it)
|
||||
{
|
||||
const Group& group = *it;
|
||||
bgfx::destroyVertexBuffer(group.m_vbh);
|
||||
bgfx::destroy(group.m_vbh);
|
||||
|
||||
if (bgfx::kInvalidHandle != group.m_ibh.idx)
|
||||
{
|
||||
bgfx::destroyIndexBuffer(group.m_ibh);
|
||||
bgfx::destroy(group.m_ibh);
|
||||
}
|
||||
}
|
||||
m_groups.clear();
|
||||
@ -1190,7 +1190,7 @@ struct Programs
|
||||
{
|
||||
for (uint8_t kk = 0; kk < SmImpl::Count; ++kk)
|
||||
{
|
||||
bgfx::destroyProgram(m_colorLighting[ii][jj][kk]);
|
||||
bgfx::destroy(m_colorLighting[ii][jj][kk]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1200,32 +1200,32 @@ struct Programs
|
||||
{
|
||||
for (uint8_t jj = 0; jj < PackDepth::Count; ++jj)
|
||||
{
|
||||
bgfx::destroyProgram(m_packDepth[ii][jj]);
|
||||
bgfx::destroy(m_packDepth[ii][jj]);
|
||||
}
|
||||
}
|
||||
|
||||
// Draw depth.
|
||||
for (uint8_t ii = 0; ii < PackDepth::Count; ++ii)
|
||||
{
|
||||
bgfx::destroyProgram(m_drawDepth[ii]);
|
||||
bgfx::destroy(m_drawDepth[ii]);
|
||||
}
|
||||
|
||||
// Hblur.
|
||||
for (uint8_t ii = 0; ii < PackDepth::Count; ++ii)
|
||||
{
|
||||
bgfx::destroyProgram(m_hBlur[ii]);
|
||||
bgfx::destroy(m_hBlur[ii]);
|
||||
}
|
||||
|
||||
// Vblur.
|
||||
for (uint8_t ii = 0; ii < PackDepth::Count; ++ii)
|
||||
{
|
||||
bgfx::destroyProgram(m_vBlur[ii]);
|
||||
bgfx::destroy(m_vBlur[ii]);
|
||||
}
|
||||
|
||||
// Misc.
|
||||
bgfx::destroyProgram(m_colorTexture);
|
||||
bgfx::destroyProgram(m_texture);
|
||||
bgfx::destroyProgram(m_black);
|
||||
bgfx::destroy(m_colorTexture);
|
||||
bgfx::destroy(m_texture);
|
||||
bgfx::destroy(m_black);
|
||||
}
|
||||
|
||||
bgfx::ProgramHandle m_black;
|
||||
@ -1914,23 +1914,23 @@ public:
|
||||
m_hplaneMesh.unload();
|
||||
m_vplaneMesh.unload();
|
||||
|
||||
bgfx::destroyTexture(m_texFigure);
|
||||
bgfx::destroyTexture(m_texFieldstone);
|
||||
bgfx::destroyTexture(m_texFlare);
|
||||
bgfx::destroy(m_texFigure);
|
||||
bgfx::destroy(m_texFieldstone);
|
||||
bgfx::destroy(m_texFlare);
|
||||
|
||||
for (uint8_t ii = 0; ii < ShadowMapRenderTargets::Count; ++ii)
|
||||
{
|
||||
bgfx::destroyFrameBuffer(s_rtShadowMap[ii]);
|
||||
bgfx::destroy(s_rtShadowMap[ii]);
|
||||
}
|
||||
bgfx::destroyFrameBuffer(s_rtBlur);
|
||||
bgfx::destroy(s_rtBlur);
|
||||
|
||||
s_programs.destroy();
|
||||
|
||||
bgfx::destroyUniform(s_texColor);
|
||||
bgfx::destroyUniform(s_shadowMap[3]);
|
||||
bgfx::destroyUniform(s_shadowMap[2]);
|
||||
bgfx::destroyUniform(s_shadowMap[1]);
|
||||
bgfx::destroyUniform(s_shadowMap[0]);
|
||||
bgfx::destroy(s_texColor);
|
||||
bgfx::destroy(s_shadowMap[3]);
|
||||
bgfx::destroy(s_shadowMap[2]);
|
||||
bgfx::destroy(s_shadowMap[1]);
|
||||
bgfx::destroy(s_shadowMap[0]);
|
||||
|
||||
s_uniforms.destroy();
|
||||
|
||||
@ -3168,7 +3168,7 @@ public:
|
||||
s_uniforms.m_shadowMapTexelSize = 1.0f / currentShadowMapSizef;
|
||||
|
||||
{
|
||||
bgfx::destroyFrameBuffer(s_rtShadowMap[0]);
|
||||
bgfx::destroy(s_rtShadowMap[0]);
|
||||
|
||||
bgfx::TextureHandle fbtextures[] =
|
||||
{
|
||||
@ -3183,7 +3183,7 @@ public:
|
||||
for (uint8_t ii = 1; ii < ShadowMapRenderTargets::Count; ++ii)
|
||||
{
|
||||
{
|
||||
bgfx::destroyFrameBuffer(s_rtShadowMap[ii]);
|
||||
bgfx::destroy(s_rtShadowMap[ii]);
|
||||
|
||||
bgfx::TextureHandle fbtextures[] =
|
||||
{
|
||||
@ -3195,7 +3195,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
bgfx::destroyFrameBuffer(s_rtBlur);
|
||||
bgfx::destroy(s_rtBlur);
|
||||
s_rtBlur = bgfx::createFrameBuffer(m_currentShadowMapSize, m_currentShadowMapSize, bgfx::TextureFormat::BGRA8);
|
||||
}
|
||||
|
||||
|
@ -158,9 +158,9 @@ public:
|
||||
{
|
||||
// Cleanup.
|
||||
imguiDestroy();
|
||||
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();
|
||||
|
@ -35,7 +35,7 @@ struct Uniforms
|
||||
|
||||
void destroy()
|
||||
{
|
||||
bgfx::destroyUniform(u_params);
|
||||
bgfx::destroy(u_params);
|
||||
}
|
||||
|
||||
union
|
||||
@ -168,8 +168,8 @@ struct LightProbe
|
||||
|
||||
void destroy()
|
||||
{
|
||||
bgfx::destroyTexture(m_tex);
|
||||
bgfx::destroyTexture(m_texIrr);
|
||||
bgfx::destroy(m_tex);
|
||||
bgfx::destroy(m_texIrr);
|
||||
}
|
||||
|
||||
bgfx::TextureHandle m_tex;
|
||||
@ -548,16 +548,16 @@ public:
|
||||
meshUnload(m_meshOrb);
|
||||
|
||||
// Cleanup.
|
||||
bgfx::destroyProgram(m_programMesh);
|
||||
bgfx::destroyProgram(m_programSky);
|
||||
bgfx::destroy(m_programMesh);
|
||||
bgfx::destroy(m_programSky);
|
||||
|
||||
bgfx::destroyUniform(u_camPos);
|
||||
bgfx::destroyUniform(u_flags);
|
||||
bgfx::destroyUniform(u_params);
|
||||
bgfx::destroyUniform(u_mtx);
|
||||
bgfx::destroy(u_camPos);
|
||||
bgfx::destroy(u_flags);
|
||||
bgfx::destroy(u_params);
|
||||
bgfx::destroy(u_mtx);
|
||||
|
||||
bgfx::destroyUniform(s_texCube);
|
||||
bgfx::destroyUniform(s_texCubeIrr);
|
||||
bgfx::destroy(s_texCube);
|
||||
bgfx::destroy(s_texCubeIrr);
|
||||
|
||||
for (uint8_t ii = 0; ii < LightProbe::Count; ++ii)
|
||||
{
|
||||
|
@ -235,17 +235,17 @@ public:
|
||||
// Cleanup.
|
||||
imguiDestroy();
|
||||
|
||||
bgfx::destroyFrameBuffer(m_fbh);
|
||||
bgfx::destroyIndexBuffer(m_ibh);
|
||||
bgfx::destroyVertexBuffer(m_vbh);
|
||||
bgfx::destroyProgram(m_blend);
|
||||
bgfx::destroyProgram(m_wbSeparatePass);
|
||||
bgfx::destroyProgram(m_wbSeparateBlit);
|
||||
bgfx::destroyProgram(m_wbPass);
|
||||
bgfx::destroyProgram(m_wbBlit);
|
||||
bgfx::destroyUniform(s_texColor0);
|
||||
bgfx::destroyUniform(s_texColor1);
|
||||
bgfx::destroyUniform(u_color);
|
||||
bgfx::destroy(m_fbh);
|
||||
bgfx::destroy(m_ibh);
|
||||
bgfx::destroy(m_vbh);
|
||||
bgfx::destroy(m_blend);
|
||||
bgfx::destroy(m_wbSeparatePass);
|
||||
bgfx::destroy(m_wbSeparateBlit);
|
||||
bgfx::destroy(m_wbPass);
|
||||
bgfx::destroy(m_wbBlit);
|
||||
bgfx::destroy(s_texColor0);
|
||||
bgfx::destroy(s_texColor1);
|
||||
bgfx::destroy(u_color);
|
||||
|
||||
// Shutdown bgfx.
|
||||
bgfx::shutdown();
|
||||
@ -269,7 +269,7 @@ public:
|
||||
|
||||
if (bgfx::isValid(m_fbh) )
|
||||
{
|
||||
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::RGBA16F, BGFX_TEXTURE_RT);
|
||||
|
@ -324,32 +324,32 @@ public:
|
||||
|
||||
if (bgfx::isValid(m_gbuffer) )
|
||||
{
|
||||
bgfx::destroyFrameBuffer(m_gbuffer);
|
||||
bgfx::destroyFrameBuffer(m_lightBuffer);
|
||||
bgfx::destroy(m_gbuffer);
|
||||
bgfx::destroy(m_lightBuffer);
|
||||
}
|
||||
|
||||
bgfx::destroyIndexBuffer(m_ibh);
|
||||
bgfx::destroyVertexBuffer(m_vbh);
|
||||
bgfx::destroy(m_ibh);
|
||||
bgfx::destroy(m_vbh);
|
||||
|
||||
bgfx::destroyProgram(m_geomProgram);
|
||||
bgfx::destroyProgram(m_lightProgram);
|
||||
bgfx::destroyProgram(m_combineProgram);
|
||||
bgfx::destroyProgram(m_debugProgram);
|
||||
bgfx::destroyProgram(m_lineProgram);
|
||||
bgfx::destroy(m_geomProgram);
|
||||
bgfx::destroy(m_lightProgram);
|
||||
bgfx::destroy(m_combineProgram);
|
||||
bgfx::destroy(m_debugProgram);
|
||||
bgfx::destroy(m_lineProgram);
|
||||
|
||||
bgfx::destroyTexture(m_textureColor);
|
||||
bgfx::destroyTexture(m_textureNormal);
|
||||
bgfx::destroyUniform(s_texColor);
|
||||
bgfx::destroyUniform(s_texNormal);
|
||||
bgfx::destroy(m_textureColor);
|
||||
bgfx::destroy(m_textureNormal);
|
||||
bgfx::destroy(s_texColor);
|
||||
bgfx::destroy(s_texNormal);
|
||||
|
||||
bgfx::destroyUniform(s_albedo);
|
||||
bgfx::destroyUniform(s_normal);
|
||||
bgfx::destroyUniform(s_depth);
|
||||
bgfx::destroyUniform(s_light);
|
||||
bgfx::destroy(s_albedo);
|
||||
bgfx::destroy(s_normal);
|
||||
bgfx::destroy(s_depth);
|
||||
bgfx::destroy(s_light);
|
||||
|
||||
bgfx::destroyUniform(u_lightPosRadius);
|
||||
bgfx::destroyUniform(u_lightRgbInnerR);
|
||||
bgfx::destroyUniform(u_mtx);
|
||||
bgfx::destroy(u_lightPosRadius);
|
||||
bgfx::destroy(u_lightRgbInnerR);
|
||||
bgfx::destroy(u_mtx);
|
||||
|
||||
// Shutdown bgfx.
|
||||
bgfx::shutdown();
|
||||
@ -410,7 +410,7 @@ public:
|
||||
|
||||
if (bgfx::isValid(m_gbuffer) )
|
||||
{
|
||||
bgfx::destroyFrameBuffer(m_gbuffer);
|
||||
bgfx::destroy(m_gbuffer);
|
||||
}
|
||||
|
||||
const uint32_t samplerFlags = 0
|
||||
@ -428,7 +428,7 @@ public:
|
||||
|
||||
if (bgfx::isValid(m_lightBuffer) )
|
||||
{
|
||||
bgfx::destroyFrameBuffer(m_lightBuffer);
|
||||
bgfx::destroy(m_lightBuffer);
|
||||
}
|
||||
|
||||
m_lightBuffer = bgfx::createFrameBuffer(uint16_t(m_width), uint16_t(m_height), bgfx::TextureFormat::BGRA8, samplerFlags);
|
||||
|
@ -148,16 +148,16 @@ public:
|
||||
{
|
||||
if (bgfx::isValid(m_fbh[ii]) )
|
||||
{
|
||||
bgfx::destroyFrameBuffer(m_fbh[ii]);
|
||||
bgfx::destroy(m_fbh[ii]);
|
||||
}
|
||||
}
|
||||
|
||||
BX_FREE(entry::getAllocator(), m_bindings);
|
||||
|
||||
// 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();
|
||||
@ -206,7 +206,7 @@ public:
|
||||
// frame buffer must be recreated.
|
||||
if (bgfx::isValid(m_fbh[viewId]) )
|
||||
{
|
||||
bgfx::destroyFrameBuffer(m_fbh[viewId]);
|
||||
bgfx::destroy(m_fbh[viewId]);
|
||||
m_fbh[viewId].idx = bgfx::kInvalidHandle;
|
||||
}
|
||||
|
||||
@ -335,7 +335,7 @@ public:
|
||||
{
|
||||
if (bgfx::isValid(m_fbh[ii]) )
|
||||
{
|
||||
bgfx::destroyFrameBuffer(m_fbh[ii]);
|
||||
bgfx::destroy(m_fbh[ii]);
|
||||
m_fbh[ii].idx = bgfx::kInvalidHandle;
|
||||
|
||||
// Flush destruction of swap chain before destroying window!
|
||||
|
@ -117,19 +117,19 @@ void VectorDisplay::teardown()
|
||||
{
|
||||
for (size_t i = 0; i < m_vertexBuffers.size(); ++i)
|
||||
{
|
||||
bgfx::destroyDynamicVertexBuffer(m_vertexBuffers[i]);
|
||||
bgfx::destroy(m_vertexBuffers[i]);
|
||||
}
|
||||
|
||||
teardownResDependent();
|
||||
|
||||
bgfx::destroyProgram(m_drawToScreenShader);
|
||||
bgfx::destroyProgram(m_blurShader);
|
||||
bgfx::destroyProgram(m_blitShader);
|
||||
bgfx::destroy(m_drawToScreenShader);
|
||||
bgfx::destroy(m_blurShader);
|
||||
bgfx::destroy(m_blitShader);
|
||||
|
||||
bgfx::destroyUniform(u_params);
|
||||
bgfx::destroyUniform(s_texColor);
|
||||
bgfx::destroy(u_params);
|
||||
bgfx::destroy(s_texColor);
|
||||
|
||||
bgfx::destroyTexture(m_lineTexId);
|
||||
bgfx::destroy(m_lineTexId);
|
||||
}
|
||||
|
||||
void VectorDisplay::beginFrame()
|
||||
@ -719,7 +719,7 @@ bool VectorDisplay::setDecaySteps(int _steps)
|
||||
{
|
||||
for (size_t i = 0; i < m_vertexBuffers.size(); ++i)
|
||||
{
|
||||
bgfx::destroyDynamicVertexBuffer(m_vertexBuffers[i]);
|
||||
bgfx::destroy(m_vertexBuffers[i]);
|
||||
}
|
||||
|
||||
m_vertexBuffers.clear();
|
||||
@ -837,9 +837,9 @@ void VectorDisplay::setupResDependent()
|
||||
|
||||
void VectorDisplay::teardownResDependent()
|
||||
{
|
||||
bgfx::destroyFrameBuffer(m_sceneFrameBuffer);
|
||||
bgfx::destroyFrameBuffer(m_glow0FrameBuffer);
|
||||
bgfx::destroyFrameBuffer(m_glow1FrameBuffer);
|
||||
bgfx::destroy(m_sceneFrameBuffer);
|
||||
bgfx::destroy(m_glow0FrameBuffer);
|
||||
bgfx::destroy(m_glow1FrameBuffer);
|
||||
}
|
||||
|
||||
void VectorDisplay::genLinetex() // generate the texture
|
||||
|
@ -221,20 +221,20 @@ public:
|
||||
|
||||
if (bgfx::isValid(m_indirectProgram) )
|
||||
{
|
||||
bgfx::destroyProgram(m_indirectProgram);
|
||||
bgfx::destroyIndirectBuffer(m_indirectBuffer);
|
||||
bgfx::destroy(m_indirectProgram);
|
||||
bgfx::destroy(m_indirectBuffer);
|
||||
}
|
||||
|
||||
bgfx::destroyUniform(u_params);
|
||||
bgfx::destroyDynamicVertexBuffer(m_currPositionBuffer0);
|
||||
bgfx::destroyDynamicVertexBuffer(m_currPositionBuffer1);
|
||||
bgfx::destroyDynamicVertexBuffer(m_prevPositionBuffer0);
|
||||
bgfx::destroyDynamicVertexBuffer(m_prevPositionBuffer1);
|
||||
bgfx::destroyProgram(m_updateInstancesProgram);
|
||||
bgfx::destroyProgram(m_initInstancesProgram);
|
||||
bgfx::destroyIndexBuffer(m_ibh);
|
||||
bgfx::destroyVertexBuffer(m_vbh);
|
||||
bgfx::destroyProgram(m_particleProgram);
|
||||
bgfx::destroy(u_params);
|
||||
bgfx::destroy(m_currPositionBuffer0);
|
||||
bgfx::destroy(m_currPositionBuffer1);
|
||||
bgfx::destroy(m_prevPositionBuffer0);
|
||||
bgfx::destroy(m_prevPositionBuffer1);
|
||||
bgfx::destroy(m_updateInstancesProgram);
|
||||
bgfx::destroy(m_initInstancesProgram);
|
||||
bgfx::destroy(m_ibh);
|
||||
bgfx::destroy(m_vbh);
|
||||
bgfx::destroy(m_particleProgram);
|
||||
|
||||
// Shutdown bgfx.
|
||||
bgfx::shutdown();
|
||||
|
@ -144,12 +144,12 @@ public:
|
||||
|
||||
for (uint32_t ii = 0; ii < BX_COUNTOF(m_occlusionQueries); ++ii)
|
||||
{
|
||||
bgfx::destroyOcclusionQuery(m_occlusionQueries[ii]);
|
||||
bgfx::destroy(m_occlusionQueries[ii]);
|
||||
}
|
||||
|
||||
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();
|
||||
|
@ -143,33 +143,33 @@ public:
|
||||
|
||||
if (bgfx::isValid(m_ibh) )
|
||||
{
|
||||
bgfx::destroyIndexBuffer(m_ibh);
|
||||
bgfx::destroy(m_ibh);
|
||||
}
|
||||
|
||||
if (bgfx::isValid(m_vbh) )
|
||||
{
|
||||
bgfx::destroyVertexBuffer(m_vbh);
|
||||
bgfx::destroy(m_vbh);
|
||||
}
|
||||
|
||||
if (bgfx::isValid(m_dibh) )
|
||||
{
|
||||
bgfx::destroyDynamicIndexBuffer(m_dibh);
|
||||
bgfx::destroy(m_dibh);
|
||||
}
|
||||
|
||||
if (bgfx::isValid(m_dvbh) )
|
||||
{
|
||||
bgfx::destroyDynamicVertexBuffer(m_dvbh);
|
||||
bgfx::destroy(m_dvbh);
|
||||
}
|
||||
|
||||
bgfx::destroyUniform(s_heightTexture);
|
||||
bgfx::destroy(s_heightTexture);
|
||||
|
||||
if (bgfx::isValid(m_heightTexture) )
|
||||
{
|
||||
bgfx::destroyTexture(m_heightTexture);
|
||||
bgfx::destroy(m_heightTexture);
|
||||
}
|
||||
|
||||
bgfx::destroyProgram(m_terrainProgram);
|
||||
bgfx::destroyProgram(m_terrainHeightTextureProgram);
|
||||
bgfx::destroy(m_terrainProgram);
|
||||
bgfx::destroy(m_terrainHeightTextureProgram);
|
||||
|
||||
/// When data is passed to bgfx via makeRef we need to make
|
||||
/// sure library is done with it before freeing memory blocks.
|
||||
@ -233,14 +233,14 @@ public:
|
||||
|
||||
if (bgfx::isValid(m_vbh) )
|
||||
{
|
||||
bgfx::destroyVertexBuffer(m_vbh);
|
||||
bgfx::destroy(m_vbh);
|
||||
}
|
||||
|
||||
mem = bgfx::makeRef(&m_terrain.m_vertices[0], sizeof(PosTexCoord0Vertex) * m_terrain.m_vertexCount);
|
||||
m_vbh = bgfx::createVertexBuffer(mem, PosTexCoord0Vertex::ms_decl);
|
||||
if (bgfx::isValid(m_ibh) )
|
||||
{
|
||||
bgfx::destroyIndexBuffer(m_ibh);
|
||||
bgfx::destroy(m_ibh);
|
||||
}
|
||||
|
||||
mem = bgfx::makeRef(&m_terrain.m_indices[0], sizeof(uint16_t) * m_terrain.m_indexCount);
|
||||
|
@ -265,7 +265,7 @@ struct Uniforms
|
||||
|
||||
void destroy()
|
||||
{
|
||||
bgfx::destroyUniform(u_params);
|
||||
bgfx::destroy(u_params);
|
||||
}
|
||||
|
||||
union
|
||||
@ -346,8 +346,8 @@ public:
|
||||
m_meshes[1].destroy();
|
||||
m_meshes[2].destroy();
|
||||
|
||||
bgfx::destroyProgram(m_wfProgram);
|
||||
bgfx::destroyProgram(m_meshProgram);
|
||||
bgfx::destroy(m_wfProgram);
|
||||
bgfx::destroy(m_meshProgram);
|
||||
|
||||
m_uniforms.destroy();
|
||||
|
||||
|
@ -161,16 +161,16 @@ public:
|
||||
}
|
||||
|
||||
// Cleanup.
|
||||
bgfx::destroyProgram(m_shadingProgram);
|
||||
bgfx::destroyProgram(m_idProgram);
|
||||
bgfx::destroy(m_shadingProgram);
|
||||
bgfx::destroy(m_idProgram);
|
||||
|
||||
bgfx::destroyUniform(u_tint);
|
||||
bgfx::destroyUniform(u_id);
|
||||
bgfx::destroy(u_tint);
|
||||
bgfx::destroy(u_id);
|
||||
|
||||
bgfx::destroyFrameBuffer(m_pickingFB);
|
||||
bgfx::destroyTexture(m_pickingRT);
|
||||
bgfx::destroyTexture(m_pickingRTDepth);
|
||||
bgfx::destroyTexture(m_blitTex);
|
||||
bgfx::destroy(m_pickingFB);
|
||||
bgfx::destroy(m_pickingRT);
|
||||
bgfx::destroy(m_pickingRTDepth);
|
||||
bgfx::destroy(m_blitTex);
|
||||
|
||||
imguiDestroy();
|
||||
|
||||
|
@ -386,39 +386,39 @@ public:
|
||||
meshUnload(m_lightSphere);
|
||||
|
||||
// Cleanup.
|
||||
bgfx::destroyProgram(m_gbufferProgram);
|
||||
bgfx::destroyProgram(m_lightProgram);
|
||||
bgfx::destroyProgram(m_combineProgram);
|
||||
bgfx::destroyProgram(m_shadowProgram);
|
||||
bgfx::destroy(m_gbufferProgram);
|
||||
bgfx::destroy(m_lightProgram);
|
||||
bgfx::destroy(m_combineProgram);
|
||||
bgfx::destroy(m_shadowProgram);
|
||||
|
||||
bgfx::destroyUniform(u_tint);
|
||||
bgfx::destroyUniform(u_lightDir);
|
||||
bgfx::destroyUniform(u_sphereInfo);
|
||||
bgfx::destroyUniform(u_invMvp);
|
||||
bgfx::destroyUniform(u_invMvpShadow);
|
||||
bgfx::destroyUniform(u_lightMtx);
|
||||
bgfx::destroyUniform(u_shadowDimsInv);
|
||||
bgfx::destroyUniform(u_rsmAmount);
|
||||
bgfx::destroyUniform(s_normal);
|
||||
bgfx::destroyUniform(s_depth);
|
||||
bgfx::destroyUniform(s_light);
|
||||
bgfx::destroyUniform(s_color);
|
||||
bgfx::destroyUniform(s_shadowMap);
|
||||
bgfx::destroyUniform(s_rsm);
|
||||
bgfx::destroy(u_tint);
|
||||
bgfx::destroy(u_lightDir);
|
||||
bgfx::destroy(u_sphereInfo);
|
||||
bgfx::destroy(u_invMvp);
|
||||
bgfx::destroy(u_invMvpShadow);
|
||||
bgfx::destroy(u_lightMtx);
|
||||
bgfx::destroy(u_shadowDimsInv);
|
||||
bgfx::destroy(u_rsmAmount);
|
||||
bgfx::destroy(s_normal);
|
||||
bgfx::destroy(s_depth);
|
||||
bgfx::destroy(s_light);
|
||||
bgfx::destroy(s_color);
|
||||
bgfx::destroy(s_shadowMap);
|
||||
bgfx::destroy(s_rsm);
|
||||
|
||||
bgfx::destroyFrameBuffer(m_gbuffer);
|
||||
bgfx::destroyFrameBuffer(m_lightBuffer);
|
||||
bgfx::destroyFrameBuffer(m_shadowBuffer);
|
||||
bgfx::destroy(m_gbuffer);
|
||||
bgfx::destroy(m_lightBuffer);
|
||||
bgfx::destroy(m_shadowBuffer);
|
||||
|
||||
for (uint32_t ii = 0; ii < BX_COUNTOF(m_gbufferTex); ++ii)
|
||||
{
|
||||
bgfx::destroyTexture(m_gbufferTex[ii]);
|
||||
bgfx::destroy(m_gbufferTex[ii]);
|
||||
}
|
||||
|
||||
bgfx::destroyTexture(m_lightBufferTex);
|
||||
bgfx::destroy(m_lightBufferTex);
|
||||
for (uint32_t ii = 0; ii < BX_COUNTOF(m_shadowBufferTex); ++ii)
|
||||
{
|
||||
bgfx::destroyTexture(m_shadowBufferTex[ii]);
|
||||
bgfx::destroy(m_shadowBufferTex[ii]);
|
||||
}
|
||||
|
||||
cameraDestroy();
|
||||
|
@ -183,18 +183,18 @@ public:
|
||||
virtual int shutdown() override
|
||||
{
|
||||
// Cleanup.
|
||||
bgfx::destroyIndexBuffer(m_ibh);
|
||||
bgfx::destroyVertexBuffer(m_vbh);
|
||||
bgfx::destroyProgram(m_program);
|
||||
bgfx::destroyTexture(m_textureColor);
|
||||
bgfx::destroyTexture(m_textureNormal);
|
||||
bgfx::destroyTexture(m_textureDepth);
|
||||
bgfx::destroyUniform(s_texColor);
|
||||
bgfx::destroyUniform(s_texNormal);
|
||||
bgfx::destroyUniform(s_texDepth);
|
||||
bgfx::destroyUniform(u_light_pos);
|
||||
bgfx::destroyUniform(u_norm_mtx);
|
||||
bgfx::destroyUniform(u_pomParam);
|
||||
bgfx::destroy(m_ibh);
|
||||
bgfx::destroy(m_vbh);
|
||||
bgfx::destroy(m_program);
|
||||
bgfx::destroy(m_textureColor);
|
||||
bgfx::destroy(m_textureNormal);
|
||||
bgfx::destroy(m_textureDepth);
|
||||
bgfx::destroy(s_texColor);
|
||||
bgfx::destroy(s_texNormal);
|
||||
bgfx::destroy(s_texDepth);
|
||||
bgfx::destroy(u_light_pos);
|
||||
bgfx::destroy(u_norm_mtx);
|
||||
bgfx::destroy(u_pomParam);
|
||||
|
||||
imguiDestroy();
|
||||
|
||||
|
@ -527,11 +527,11 @@ struct Mesh
|
||||
for (GroupArray::const_iterator it = m_groups.begin(), itEnd = m_groups.end(); it != itEnd; ++it)
|
||||
{
|
||||
const Group& group = *it;
|
||||
bgfx::destroyVertexBuffer(group.m_vbh);
|
||||
bgfx::destroy(group.m_vbh);
|
||||
|
||||
if (bgfx::isValid(group.m_ibh) )
|
||||
{
|
||||
bgfx::destroyIndexBuffer(group.m_ibh);
|
||||
bgfx::destroy(group.m_ibh);
|
||||
}
|
||||
}
|
||||
m_groups.clear();
|
||||
|
@ -306,7 +306,7 @@ Atlas::Atlas(uint16_t _textureSize, const uint8_t* _textureBuffer, uint16_t _reg
|
||||
|
||||
Atlas::~Atlas()
|
||||
{
|
||||
bgfx::destroyTexture(m_textureHandle);
|
||||
bgfx::destroy(m_textureHandle);
|
||||
|
||||
delete [] m_layers;
|
||||
delete [] m_regions;
|
||||
|
@ -740,15 +740,15 @@ struct DebugDraw
|
||||
|
||||
void shutdown()
|
||||
{
|
||||
bgfx::destroyIndexBuffer(m_ibh);
|
||||
bgfx::destroyVertexBuffer(m_vbh);
|
||||
bgfx::destroy(m_ibh);
|
||||
bgfx::destroy(m_vbh);
|
||||
for (uint32_t ii = 0; ii < Program::Count; ++ii)
|
||||
{
|
||||
bgfx::destroyProgram(m_program[ii]);
|
||||
bgfx::destroy(m_program[ii]);
|
||||
}
|
||||
bgfx::destroyUniform(u_params);
|
||||
bgfx::destroyUniform(s_texColor);
|
||||
bgfx::destroyTexture(m_texture);
|
||||
bgfx::destroy(u_params);
|
||||
bgfx::destroy(s_texColor);
|
||||
bgfx::destroy(m_texture);
|
||||
}
|
||||
|
||||
SpriteHandle createSprite(uint16_t _width, uint16_t _height, const void* _data)
|
||||
|
@ -613,11 +613,11 @@ TextBufferManager::~TextBufferManager()
|
||||
BX_CHECK(m_textBufferHandles.getNumHandles() == 0, "All the text buffers must be destroyed before destroying the manager");
|
||||
delete [] m_textBuffers;
|
||||
|
||||
bgfx::destroyUniform(s_texColor);
|
||||
bgfx::destroy(s_texColor);
|
||||
|
||||
bgfx::destroyProgram(m_basicProgram);
|
||||
bgfx::destroyProgram(m_distanceProgram);
|
||||
bgfx::destroyProgram(m_distanceSubpixelProgram);
|
||||
bgfx::destroy(m_basicProgram);
|
||||
bgfx::destroy(m_distanceProgram);
|
||||
bgfx::destroy(m_distanceSubpixelProgram);
|
||||
}
|
||||
|
||||
TextBufferHandle TextBufferManager::createTextBuffer(uint32_t _type, BufferType::Enum _bufferType)
|
||||
@ -657,8 +657,8 @@ void TextBufferManager::destroyTextBuffer(TextBufferHandle _handle)
|
||||
bgfx::VertexBufferHandle vbh;
|
||||
ibh.idx = bc.indexBufferHandleIdx;
|
||||
vbh.idx = bc.vertexBufferHandleIdx;
|
||||
bgfx::destroyIndexBuffer(ibh);
|
||||
bgfx::destroyVertexBuffer(vbh);
|
||||
bgfx::destroy(ibh);
|
||||
bgfx::destroy(vbh);
|
||||
}
|
||||
|
||||
break;
|
||||
@ -668,8 +668,8 @@ void TextBufferManager::destroyTextBuffer(TextBufferHandle _handle)
|
||||
bgfx::DynamicVertexBufferHandle vbh;
|
||||
ibh.idx = bc.indexBufferHandleIdx;
|
||||
vbh.idx = bc.vertexBufferHandleIdx;
|
||||
bgfx::destroyDynamicIndexBuffer(ibh);
|
||||
bgfx::destroyDynamicVertexBuffer(vbh);
|
||||
bgfx::destroy(ibh);
|
||||
bgfx::destroy(vbh);
|
||||
|
||||
break;
|
||||
|
||||
|
@ -307,12 +307,12 @@ struct OcornutImguiContext
|
||||
ImGui::ShutdownDockContext();
|
||||
ImGui::Shutdown();
|
||||
|
||||
bgfx::destroyUniform(s_tex);
|
||||
bgfx::destroyTexture(m_texture);
|
||||
bgfx::destroy(s_tex);
|
||||
bgfx::destroy(m_texture);
|
||||
|
||||
bgfx::destroyUniform(u_imageLodEnabled);
|
||||
bgfx::destroyProgram(m_imageProgram);
|
||||
bgfx::destroyProgram(m_program);
|
||||
bgfx::destroy(u_imageLodEnabled);
|
||||
bgfx::destroy(m_imageProgram);
|
||||
bgfx::destroy(m_program);
|
||||
|
||||
m_allocator = NULL;
|
||||
}
|
||||
|
@ -236,7 +236,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);
|
||||
}
|
||||
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);
|
||||
|
@ -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);
|
||||
|
@ -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.
|
||||
///
|
||||
|
@ -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.
|
||||
|
54
src/bgfx.cpp
54
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])
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user