[info-performer] [Fwd: Related to: Class method call on draw process for HUD]

New Message Reply Date view Thread view Subject view Author view

From: Marc Mendez (mmendez++at++silicon-worlds.fr)
Date: 10/31/2002 07:43:11


Related to the question of Denis Taniguchi, we are facing about the same
problem:
we d like to provide our application special scene graph node we d be
able to insert.

For example, a trail could be displayed in a pfTrailNode object.
If I write the following:

class pfTrailNode : public pfNode
{
public:
    pfTrailNode(void);
    ........................................
    virtual int draw(void);
    ........................................
private:
    ........................................
};

How could I tell Performer to draw it every frame __WITHOUT__ calling
myobj->draw() in the draw loop ???

I ve seen examples in the Programming in C++ with Performer chapter of
theprogramming guide, but it reveals some undocumented function calls:
app() in the Rotor example.
Is there some example of new scene graph node definitions ?

pfRegards,
    Marc.

MLM Veraart wrote:

>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
>-----------------------------------------------------------------------
>
>
>
>

-- 
Marc Mendez
Silicon Worlds SA

12, rue de Chatillon 75014 Paris Tel : +33 (01) 53 90 11 13 Fax : +33 (01) 53 90 11 12

Without C, we would only have Basi, Pasal and Obol. Anonymous. Computers are useless. They can only give you answers. P. Picasso.


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Thu Oct 31 2002 - 07:51:36 PST

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