On Fri, Jan 8, 2010 at 9:50 PM, Dominic Stalder
<[email protected]>wrote:
> Hi there
>
> I would like to read the OpenGL extensions with isGLExtensionSupported(),
> but for this I need a draw context. I registred a DrawCallback Class, see
> below. I need to call the operator() method only once, but because this
> method is const, I cannot write to the member variable bool first. How can I
> resolve this problem?
>
> class GameViewOSGDrawCallback : public osg::Camera::DrawCallback
> {
> private:
> GameViewOSG *parent;
> bool first;
>
> public:
> GameViewOSGDrawCallback(GameViewOSG* parent=0);
>
> virtual void operator()(const osg::Camera&) const;
> };
>
> You might look at using an Operation on the graphics context, which has a
"one-shot" mode that is more convenient and efficient than a boolean in a
callback. Take a look at the Operation class in osg/OperationThread and
osg::GraphicsContext::add(Operation*).
Tim
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org