From f373bcf23d01bf7ef7905f398c2a18e77b90e033 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 4 Feb 2016 17:36:33 +0000 Subject: [PATCH] Added osg::resizeGLObjectBuffers(..) and osg::releaseGLObjects(..) functions to make it easier to call these methods on objects which ref_ptr<> or C pointers are held for. --- include/osg/Object | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/osg/Object b/include/osg/Object index 3ff78a374..aee80a8be 100644 --- a/include/osg/Object +++ b/include/osg/Object @@ -374,6 +374,14 @@ protected: }; +inline void resizeGLObjectBuffers(osg::Object* object, unsigned int maxSize) { if (object) object->resizeGLObjectBuffers(maxSize); } + +template void resizeGLObjectBuffers(const osg::ref_ptr& object, unsigned int maxSize) { if (object.valid()) object->resizeGLObjectBuffers(maxSize); } + +inline void releaseGLObjects(osg::Object* object, osg::State* state = 0) { if (object) object->releaseGLObjects(state); } + +template void releaseGLObjects(const osg::ref_ptr& object, osg::State* state = 0) { if (object.valid()) object->releaseGLObjects(state); } + } #endif