mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-20 05:43:12 +01:00
Added extra error checking when creating frame buffer.
This commit is contained in:
@@ -2656,6 +2656,11 @@ again:
|
||||
FrameBufferHandle createFrameBuffer(uint8_t _num, TextureHandle* _handles, bool _destroyTextures)
|
||||
{
|
||||
BGFX_CHECK_MAIN_THREAD();
|
||||
BX_CHECK(_num != 0, "Number of frame buffer attachments can't be 0.");
|
||||
BX_CHECK(_num <= BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS, "Number of frame buffer attachments is larger than allowed %d (max: %d)."
|
||||
, _num
|
||||
, BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS
|
||||
);
|
||||
BX_CHECK(NULL != _handles, "_handles can't be NULL");
|
||||
FrameBufferHandle handle = s_ctx->createFrameBuffer(_num, _handles);
|
||||
if (_destroyTextures)
|
||||
|
||||
Reference in New Issue
Block a user