From 92190fcbbf5339155b43e09f3129666fb325db14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Mon, 26 May 2014 17:28:28 -0700 Subject: [PATCH] Cleanup. --- examples/17-drawstress/drawstress.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/examples/17-drawstress/drawstress.cpp b/examples/17-drawstress/drawstress.cpp index 388d69e0..7032cd07 100644 --- a/examples/17-drawstress/drawstress.cpp +++ b/examples/17-drawstress/drawstress.cpp @@ -293,11 +293,12 @@ int _main_(int /*_argc*/, char** /*_argv*/) break; } - bgfx::ShaderHandle vsh = bgfx::createShader(vs_drawstress); - bgfx::ShaderHandle fsh = bgfx::createShader(fs_drawstress); - // Create program from shaders. - program = bgfx::createProgram(vsh, fsh); + program = bgfx::createProgram( + bgfx::createShader(vs_drawstress) + , bgfx::createShader(fs_drawstress) + , true /* destroy shaders when program is destroyed */ + ); const bgfx::Memory* mem; @@ -309,13 +310,6 @@ int _main_(int /*_argc*/, char** /*_argv*/) mem = bgfx::makeRef(s_cubeIndices, sizeof(s_cubeIndices) ); ibh = bgfx::createIndexBuffer(mem); - // We can destroy vertex and fragment shader here since - // their reference is kept inside bgfx after calling createProgram. - // Vertex and fragment shader will be destroyed once program is - // destroyed. - bgfx::destroyShader(vsh); - bgfx::destroyShader(fsh); - imguiCreate(s_droidSansTtf); #if BX_PLATFORM_EMSCRIPTEN