Bug 1150 : Functionality similar to: glPushAttrib(GL.GL_ALL_ATTRIB_BITS)
Last modified: 2009-02-20 11:07



Assigned To:

Attachment Type Created Size Actions

Description:   Opened: 2009-02-05 06:24
A functionality I would find very useful would be to replicate the OpenGL
"glPushAttrib(GL.GL_ALL_ATTRIB_BITS)" call for processing.

This is of course an advanced feature, and one that is from my knowledge of
the Processing source code difficult to implement.

It's usefulness is primarily in the context of combining multiple sketches,
where any calls that alter the state of the processing core can be easily

I am looking into how this may be implemented into the processing core
myself, but thought it'd also be worthwhile posting the suggestion here.

Thank you for Processing!
Additional Comment #1 From fry 2009-02-05 06:28
*** Bug 1151 has been marked as a duplicate of this bug. ***
Additional Comment #2 From fry 2009-02-05 06:34
Have you tried pushStyle and popStyle?
Additional Comment #3 From onar3d 2009-02-05 07:13
(In reply to comment #2)
> Additional Comment #2 From fry 2009-02-05 06:34 [reply] Have you tried
pushStyle and popStyle?

Thank you for the quick reply!

Indeed the functionality I refer to is in the spirit of push/popStyle, I should have
mentioned that. I have however found that these methods do not affect calls
to "pointLight" and "directionalLight". I've been under the impression that
push/popStyle were limited to 2D drawing state, and did not apply to the
P3D/OpenGL modes.

I'm not certain whether there are more calls than the two above mentioned ones
which alter state without being affected by push/popStyle.

These calls are of course easily reversed, but if it is not too expensive
computationally, it'd be useful with a method which guarantees that it stores/reverts
all state.

Note that I have not discussed this feature in the forum before submitting, only
researched whether it is possible on my own. I apologise if I have been too speedy
with filing an enhancement request; I see now that my request would have been
more usefully formulated if I had first posted it in the forums.

Thank you!
Additional Comment #4 From fry 2009-02-20 11:07
Unfortunately you can't disable lights using the current lighting model, so
there's not much additional that we could handle outside of push/popStyle()
and push/popMatrix().