From 78cb2bb14ad188d3423869f59d1ff0b49cb23cae Mon Sep 17 00:00:00 2001 From: bkaradzic Date: Wed, 2 Jan 2013 21:55:19 -0800 Subject: [PATCH] Better error handling for createUniform. --- src/bgfx_p.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/bgfx_p.h b/src/bgfx_p.h index ef20a2d4..c7845401 100644 --- a/src/bgfx_p.h +++ b/src/bgfx_p.h @@ -2018,7 +2018,12 @@ namespace bgfx UniformHandle createUniform(const char* _name, UniformType::Enum _type, uint16_t _num) { - BX_CHECK(PredefinedUniform::Count == nameToPredefinedUniformEnum(_name), "%s is predefined uniform name.", _name); + BX_WARN(PredefinedUniform::Count == nameToPredefinedUniformEnum(_name), "%s is predefined uniform name.", _name); + if (PredefinedUniform::Count != nameToPredefinedUniformEnum(_name) ) + { + UniformHandle handle = BGFX_INVALID_HANDLE; + return handle; + } UniformHandle handle = { m_uniformHandle.alloc() };