On Tue, Apr 15, 2008 at 12:46 PM, Art Tevs <[EMAIL PROTECTED]> wrote:

> > OSG manages this by using
> > osg::State which maintains a
> > stack of StateSet that are currently applied, and
> > stacks for the individual
> > modes and attributes that are applied.  When a
> > stateset is popped the
> > modes/attributes that were applied by the parent
> > StateSet are applied.
> This means that the parent StateSet has to contain
> some stateattribute which restores the applied state
> in the previous state.
>

No, please read my complete reply.  The key part is about what happens when
the stack is empty.  Please go look at the code in osg::State as well.



>
>
> Ok, I need this behaviour for the following thing:
> I am currently preparing a patch for the FBOs and
> MRTs. Here I would like to move the glDrawBuffers call
> from the RenderStage to the FBO, since I would like to
> use FBOs without camera's, hence on its own. This
> would be also more general approach, then this one,
> which we currently have.
>
> Now the problem is, that in FrameBufferObject::apply()
> method I would like to set the draw buffers
> accordingly. However, I have no idea how to restore
> the opengl's state back?!?!?!


Default constructed FBO??



>
> If there would be something like ::disapply() method,
> I would be able to restore the drawbuffers by
> resetting them to the value as they were before.
>
> Since there is no such call, I have to set the
> drawbuffers to some default value, for which there is
> no real default value exists????
>
> So any ideas how to manage this?
>

Arggg, either rely on the default constrcted state attribute mechanism or
just place a StateSet above your whole scene.

Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to