mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-20 22:03:12 +01:00
Added destroy shaders option when creating program.
This commit is contained in:
12
src/bgfx.cpp
12
src/bgfx.cpp
@@ -1856,10 +1856,18 @@ namespace bgfx
|
||||
s_ctx->destroyFragmentShader(_handle);
|
||||
}
|
||||
|
||||
ProgramHandle createProgram(VertexShaderHandle _vsh, FragmentShaderHandle _fsh)
|
||||
ProgramHandle createProgram(VertexShaderHandle _vsh, FragmentShaderHandle _fsh, bool _destroyShaders)
|
||||
{
|
||||
BGFX_CHECK_MAIN_THREAD();
|
||||
return s_ctx->createProgram(_vsh, _fsh);
|
||||
ProgramHandle handle = s_ctx->createProgram(_vsh, _fsh);
|
||||
|
||||
if (_destroyShaders)
|
||||
{
|
||||
destroyVertexShader(_vsh);
|
||||
destroyFragmentShader(_fsh);
|
||||
}
|
||||
|
||||
return handle;
|
||||
}
|
||||
|
||||
void destroyProgram(ProgramHandle _handle)
|
||||
|
||||
Reference in New Issue
Block a user