mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2025-04-24 13:03:27 -04:00
Added error when bgfx::init is called without bgfx::setPlatformData.
This commit is contained in:
parent
c9baf22e5e
commit
2aa7c9a14a
1 changed files with 15 additions and 1 deletions
16
src/bgfx.cpp
16
src/bgfx.cpp
|
@ -2373,7 +2373,21 @@ namespace bgfx
|
|||
|
||||
bool init(RendererType::Enum _type, uint16_t _vendorId, uint16_t _deviceId, CallbackI* _callback, bx::AllocatorI* _allocator)
|
||||
{
|
||||
BX_CHECK(NULL == s_ctx, "bgfx is already initialized.");
|
||||
if (NULL != s_ctx)
|
||||
{
|
||||
BX_CHECK(false, "bgfx is already initialized.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (NULL == g_platformData.ndt
|
||||
&& NULL == g_platformData.nwh
|
||||
&& NULL == g_platformData.context
|
||||
&& NULL == g_platformData.backBuffer
|
||||
&& NULL == g_platformData.backBufferDS)
|
||||
{
|
||||
BX_CHECK(false, "bgfx platform data like window handle or backbuffer must be set.");
|
||||
return false;
|
||||
}
|
||||
|
||||
memset(&g_caps, 0, sizeof(g_caps) );
|
||||
g_caps.maxViews = BGFX_CONFIG_MAX_VIEWS;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue