Re: [info-performer] Class method call on draw process for HUD

New Message Reply Date view Thread view Subject view Author view

From: MLM Veraart (veraart++at++fel.tno.nl)
Date: 10/31/2002 03:32:33


Denis Taniguchi wrote:
>
> Hi all,
>
> We developed a HUD that works fine, using the already well known GL calls in
> the draw process, and so forth.
> But now, it would be interesting if we could manage to build a class
> "pfHUD", and for example, having a Draw method which we would call from the
> Draw process. In other words we would like to encapsulate the GL calls made
> on the Draw process in a class method.
> As long as I tried, simply defining a class and calling it on draw or
> pos-draw is not the right way.
> Did anyone already do this? Any ideas, tips, sample codes will be
> appreciated.
> Regards!
>
> Denis Taniguchi
> Yokohama National University - Dept. Information Media and Environment
> Sciences

Hello,

It probably has to do with the multi process stuff.

Define a pointer to the class in your Shared memory struct.

In the class definition use

class MyClass
{
    PFSTRUCT_DECLARE

public:
    // the rest of the class
    void draw(pfChannel* chan);
};

This will ensure your class will be in shared memory when allocated.

Allocate the instance with

Shared->myclass = new MyClass();

Mario

-----------------------------------------------------------------------
   List Archives, Info, FAQ: http://www.sgi.com/software/performer/
   Open Development Project: http://oss.sgi.com/projects/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 2b29 : Mon Nov 04 2002 - 13:30:47 PST

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