Added GL2Extensions::isDrawBuffersSupported() and usage of this in FrameBufferObject.cpp to prevent crash under GLES2 when users attempt to use MRT when it's not supported

This commit is contained in:
Robert Osfield
2013-07-24 13:02:32 +00:00
parent 9b733baf02
commit 75fd039dba
2 changed files with 8 additions and 2 deletions

View File

@@ -530,6 +530,8 @@ class OSG_EXPORT GL2Extensions : public osg::Referenced
void setShaderAtomicCounterSupported(bool flag) { _isShaderAtomicCountersSupported = flag; }
bool isShaderAtomicCounterSupported() const {return _isShaderAtomicCountersSupported; }
bool isDrawBuffersSupported() const { return _glDrawBuffers!=0; }
/** Function to call to get the extension of a specified context.
* If the Exentsion object for that context has not yet been created then
* and the 'createIfNotInitalized' flag been set to false then returns NULL.