Allan Schaffer (allan++at++southpark.engr.sgi.com)
Sun, 26 Jul 1998 16:41:19 -0700 (PDT)
Yep, these problems are what indexed geostate's were made for.
Rather than directly specifying a particular geostate for a given
geoset, you can instead bind to an index in a list of geostates, and
then just change the list for each channel.
Check out the routines pfChannel::setGStateTable (or pfChanGStateTable),
pfGeoSet::setGStateIndex (or pfGSetGStateIndex), etc:
pfChannel::setGStateTable..
sets the pfChannel's pfGeoState table to gstable. If non-NULL,
gstable is made the global pfGeoState table with
pfGeoState::applyTable before the pfChannel's DRAW callback is
invoked. Any indexed pfGeoStates, either referenced by a
pfScene (- pfScene::setGStateIndex) or by scene pfGeoSets
(pfGeoSet::setGStateIndex) will be accessed through gstable.
Indexed pfGeoStates are useful for efficiently managing a single
database with multiple appearances, e.g., a normal vs. an
infrared view of a scene would utilize 2 pfGeoState tables, each
referencing a different set of pfGeoStates.
pfGeoSet::setGStateIndex...
A pfGeoSet may either directly reference or indirectly index a
pfGeoState with pfGeoSet::setGState and pfGeoSet::setGStateIndex
respectively. Indexed pfGeoStates use a global table of
pfGeoState pointers that is set by pfGeoState::applyTable. If
the global table is NULL or the pfGeoState index is out of the
range of the global table, no pfGeoState is applied, otherwise
the indexed pfGeoState is applied when pfGeoSet::draw is called.
Non-indexed pfGeoState references ignore the current pfGeoState
table. pfGetCurGStateTable returns the current pfGeoState table
and pfGetCurIndexedGState returns the indexth pfGeoState* in the
current pfGeoState table or NULL if the index cannot be properly
resolved.
Allan
--
Allan Schaffer allan++at++sgi.com
Silicon Graphics http://reality.sgi.com/allan
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:57:43 PDT