HUD problems; how to use OpenGL?

New Message Reply Date view Thread view Subject view Author view

Sandeep S. Mulgund (ssm++at++crasun.cra.com)
Sat, 3 Aug 1996 15:28:44 -0400


I'm trying to use the example from the Performer FAQ to construct a HUD in a
C++ Performer application (based on libpf and OpenGL). I've pasted in the
relevant item from the FAQ below. However, the following commands are
getting me into trouble:

zfunction
zwritemask
ortho2

It seems that these functions are part of IrisGL, rather than OpenGL. The
program doesn't work at all with the ortho2(..) call. If I use gluOrtho2D,
the program starts OK, but bombs after a few seconds. By running gmemusage
in the background, I can see that if the zwritemask commands are enabled,
the application starts chewing up memory until the machine runs out and the
core dumps. What am I doing wrong here, and how can I implement a HUD
within a libpf/OpenGL application?

Thanks,

Sandeep Mulgund

>Subject: -20- How do I overlay graphics on top of my Performer scene?
>Date: 06 Oct 93 00:00:01 EST
>
> Typically this is done to implement a heads-up display (HUD).
>
> In the draw function callback, the basic algorithm is:
>
> save state with pfPushState()
> disable textures, fog, & lighting with pfBasicState()
> save & clear projection matrix
> ortho2()
> save & clear modelling matrix
> draw()
> restore modelling matrix
> restore projection matrix
> restore state with pfPopState()
>
> Or, you can draw your static info in the overlay planes and only
> redraw it when the window receives a REDRAW event (moved, resized,
> etc.). Changing between drawing to the overlays and drawing to
> regular bitplanes takes a big hit.
>
> For things that need to be updated real-time, draw() would consist
> of:
>
> zfunction(ZF_ALWAYS);
> zwritemask(0x0);
> draw HUD stuff
> zfunction(ZF_LEQUAL);
> zwritemask(0xffffffff);
>

=======================================================================
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:53:18 PDT

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