Angus Dorbie (dorbie++at++sgi.com)
Fri, 16 Jul 1999 14:17:14 -0700
You can see most of this done in perfly I lifted some of this from
there.
You need an overlay visual but once you have this do something like the
following in your draw callback. Note that it is only required once,
unless you get a resize,refresh or similar. Note some of this stuff like
the color map & check for overlay you wouldn't have to do every time.
/* get pipe window from channel */
pfPipeWindow *pw = pfGetChanPWin(chan);
/* confirm you have overlay in the pipe initialization functionthis with
*/
if (pfGetPWinOverlayWin(pw) ? 1 : 0);
/* get's the overlay window */
pfWindow *pwOver = pfGetPWinOverlayWin(pw);
/* Push state & Set up viewport ets if required */
/* clear to transparent */
pfClear(PFCL_COLOR, NULL);
/* make color map */
static pfVec3 clrs[1] = { {1.0f, 0.0f, 0.0f} }; /* red color */
pfuMapWinColors(pwOver, clrs, 1, 1); /* one color starting at 1 */
/* draw the red square here using OpenGL color index & other calls */
glIndexi(1);
glBegin();
glVertex3f(...);
glVertex3f(...);
glVertex3f(...);
glVertex3f(...);
glEnd();
/* pop state if required */
/* all done so go back to the pipe window */
pfSelectPWin(pw);
Cheers,Angus.
--
Never express yourself more clearly than you think.
Neils Bohr
For advanced 3D graphics Performer + OpenGL based examples and tutors:
http://www.dorbie.com/
This archive was generated by hypermail 2.0b2 on Fri Jul 16 1999 - 14:17:28 PDT