From: DANIEL BASS (BASSD++at++aaicorp.com)
Date: 06/12/2002 07:52:44
It's not really necessary to do your own GL state push/pop as you can
use glPushAttrib() and glPopAttrib() to save and restore the state you
are affecting, but you gotta peruse that GL manpage to find out
exactly
which bits to use. Of course, all that pushing and popping can be a
performance issue, depends on how often (per frame) you are trying to
save/restore state. OTOH, if you are not doing it often (like once per
frame)
just pushing/popping everything does make it a lot simpler.
Also, remember that most all of your GL callbacks have to be in the
DRAW process, where you have a valid GL state.
--daniel
>>> "Dorosky, Christopher G" <christopher.g.dorosky++at++lmco.com> 06/12/02
09:56AM >>>
Down this road lies madness, until you get it right.
My solution, was to write a glState class, with a push, and pop.
Before doing GL anything, I would call state->push(), which
push every single GL state I could think of onto an internal stack,
state->clear() which made sure bizarre options were turned off,
and that all matrices were the identity, etc.
Then I do the GL stuff
Then I do a state->pop() and restore whatever performer was doing.
Just be aware that you can have 9 out of 10 things right, and still
get no picture, until you manage to fix that last thing.
You would think pfPushState and pfPopState would help, and I may
even call them in my push and pop, but they certainly don't do it all.
Chris
-----Original Message-----
From: David Geldreich [mailto:David.Geldreich++at++sophia.inria.fr]
Sent: Wednesday, June 12, 2002 3:55 AM
To: info-performer++at++sgi.com
Subject: [info-performer] Mixing OpenGL and Performer
Hello pfers,
perhaps is it a RTFM question, but I would like to mix OpenGL code
to
the performer pipeline in
order to be able to use nVidia Geforce shaders capabilities. Is there a
good
way of doing it ? Which
are the pitfalls (save/restoring contexts, projection, transformation
matrices, ...) I would have to
take care about ?
Thanks in advance.
This archive was generated by hypermail 2b29 : Wed Jun 12 2002 - 08:01:22 PDT