mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-17 20:52:36 +01:00
Added error when bgfx::init is called without bgfx::setPlatformData.
This commit is contained in:
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;
|
||||
|
||||
Reference in New Issue
Block a user