This commit is contained in:
Branimir Karadžić 2014-05-26 17:28:28 -07:00
parent 816860d38e
commit 92190fcbbf

View file

@ -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