Re: [info-performer] Overlay for HUD

Date view Thread view Subject view Author view

From: jcasilla (jcasilla++at++isoco.com)
Date: 02/09/2004 23:51:42


Simon.Mills++at++esa.int wrote:
> It only makes sense to use the overlay planes if the HUD is static and will
> not change frame to frame. Changing to and from overlay planes usually incurs
> some overhead. For your application it looks like it will be best to use post
> draw callbacks.
>
> Regards, Simon
> _______________________________________________________________________

Hi,

Yes, the HUD has dynamic elements so I'm using postdraw callbacks. I
want to base the code in the Velab hud classes and Aqua demo, that is,
inheriting a class from pfChannel to get the hud in a separate channel.

Although drawing text is working well, when I try to draw some lines
with opengl calls in the draw method nothing seems to be drawn. ¿Do I
have to set up a special channel configuration for this?

Basically, the calls in the draw method are as follow:

        pfPushState();
        pfBasicState();
        glDrawBuffer(GL_BACK);

        // 2D OpenGL calls

        pfPopState();

This works well when drawing text, but not with geometry. The channel
set up is as follow:

        chan->makeOrtho(0.0, 1.0, 0.0, 1.0);
        chan->setNearFar(0.5, 2.0);
        xyz.set(0, -1.0, 0);
        hpr.set(0, 0, 0);
        chan->setView(xyz, hpr);
        chan->setTravFunc(PFTRAV_CULL, (pfChanFuncType)MyCull);
        chan->setTravFunc(PFTRAV_DRAW, (pfChanFuncType)MyDraw);

Perhaps I'm missing some openGL set up staff like in text.C demo, but
having a look at velab hud code it seems that no special openGL set up
is needed.

Any help with this will be greatly appreciated.

Regards,

-- 
-------------------------------------------------------------------------
Joaquín Casillas Meléndez, R+D Engineer at iSOCO
Intelligent Software Components, S.A. http://www.isoco.com
Addr: Profesor Beltrán Báguena, 4, oficina 107, 46009 Valencia
Voice: +34 96 346 71 43 Fax: +34 96 346 71 42


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Mon Feb 09 2004 - 23:53:08 PST