Be Aware

New Message Reply Date view Thread view Subject view Author view

Gan Wang (gan++at++cavalier.cambridge.com)
Sat, 23 Nov 1996 15:57:27 -0500


Be aware NOT to reply on unique tokens that Performer defines to be *unique*.
 That may otherwise create potential disasters for your applications. One
example is the slew of pffogtype tokens defined in OPENGL

#define PFFOG_VTX_LIN GL_LINEAR
#define PFFOG_PIX_LIN GL_LINEAR
#define PFFOG_VTX_EXP GL_EXP
#define PFFOG_PIX_EXP GL_EXP
#define PFFOG_VTX_EXP2 GL_EXP2
#define PFFOG_PIX_EXP2 GL_EXP2
#define PFFOG_PIX_SPLINE 1000 /* FG_PIX_SPLINE */

which are not unique despite of apparent unique definitions. If one relies on
the apparent uniqueness of these tokens in one's algorithm , it would readily
break the logic. For example, if one wants to cycle through all fog types and
relies on the current type to determine the next type, one would forever stay
on the first type:

   if (fogType == PFFOG_PIX_LIN)
      fogType = PFFOG_VTX_LIN; <-- this does not really change fogType
   else if (fogType == PFFOG_VTX_LIN)
      fogType = PFFOG_PIX_EXP;
   else if ...

[This would work OK in IRISGL because the defines are indeed unique there.]

An quick glance at some of the pfheaders, I saw other similar cases. So be
aware!

Gan

-- 

Gan Wang

Cambridge Research Associates Voice: 703-790-0505 ext.7210 1430 Spring Hill Road, Suite 200 Fax: 703-790-0370 McLean, VA 22102 E-mail: gan++at++cambridge.com ======================================================================= List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/ Submissions: info-performer++at++sgi.com Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:54:00 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.