From: Yair Kurzion (yair++at++polygon.engr.sgi.com)
Date: 11/13/2003 08:11:56
Hello Michael !
> I got a problem using passthrough data for the draw-callback. What I want to
> do is to pass it a class that is to handle the drawing of overlays using
> gl-functions. This class internally stores some pointers to all objects that
> should be drawn (like text, images and so on).
>
> For passing the data to the draw callback, I defined a structure that
> contains an object of my overlay-class and an interger (test-)value. I
> allocate memory once using allocChanData(sizeof(PassData)). Before every
> call to pfFrame(), I then copy my overlay-object into the PassData-structure
> (at that time, it contains valid pointers to the sub-objects), and call
> passChanData(). But when I check the values of the pointers in the draw
> callback, they are totally different and the overlay drawing doesn't work.
> The integer test-value is passed correctly.
Sounds like your sub-objects are not allocated from the shared arena. The
DRAW process doesn't share address space with the APP or CULL processes.
The only shared addresses are the shared arena.
To verify this quickly, try running in single process mode:
pfMultiprocess(PFMP_APPCULLDRAW)
In the mode, your pointers should work fine.
> The strange thing is that the same code is working perfectly when compiled
> with the MS VC 7 compiler and executed on a Windows machine, but produces
> the described errors when compiled with gcc 3.2.3 so maybe this is a
> compiler-specific problem?
The windows version of Performer is single-process. Therefore, there is only
one address space and your DRAW callbacks can see memory that the APP process
allocates (even if it isn't on the shared arena).
-yair
--
\_________ \_____ \__ \__ \_____
\_________ \_____ \__ \__ \_____ Yair Kurzion
\__ \__ \____\__ \__ yair++at++sgi.com
\__ \__ \__ (650) 933-6502
\__ \__ \__
\__ \__ \__
This archive was generated by hypermail 2b29 : Thu Nov 13 2003 - 08:26:18 PST