mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 02:25:37 -05:00
Bail out if only one renderer is present, but fails to initialize.
This commit is contained in:
parent
b2405e5221
commit
051164a091
1 changed files with 11 additions and 6 deletions
17
src/bgfx.cpp
17
src/bgfx.cpp
|
@ -1721,6 +1721,8 @@ namespace bgfx
|
|||
|
||||
RendererContextI* rendererCreate(RendererType::Enum _type)
|
||||
{
|
||||
RendererType::Enum last = RendererType::Count;
|
||||
|
||||
if (RendererType::Count == _type)
|
||||
{
|
||||
again:
|
||||
|
@ -1823,14 +1825,17 @@ again:
|
|||
}
|
||||
|
||||
RendererContextI* renderCtx = s_rendererCreator[_type].createFn();
|
||||
|
||||
if (NULL == renderCtx)
|
||||
if (last != _type)
|
||||
{
|
||||
s_rendererCreator[_type].supported = false;
|
||||
goto again;
|
||||
}
|
||||
if (NULL == renderCtx)
|
||||
{
|
||||
s_rendererCreator[_type].supported = false;
|
||||
last = _type;
|
||||
goto again;
|
||||
}
|
||||
|
||||
s_rendererDestroyFn = s_rendererCreator[_type].destroyFn;
|
||||
s_rendererDestroyFn = s_rendererCreator[_type].destroyFn;
|
||||
}
|
||||
|
||||
return renderCtx;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue