Hugo Eide Gunnarsen (hugogu++at++hugogu.oslo.sgi.com)
Wed, 19 Nov 1997 14:40:30 +0100
The problem is that since I'm not sure if this is the correct way to do
this, nor if it can be done in any other ways, and the fact that when
I tried to extend this by adding a pointer to a list of "movie" objects
(each containing an pointer to a buffer that is updated when a new frame
from the move is ready, the pfTexture that I'm using, and the image
sizes) then I got a NULL pointer, and I also noticed that the pointer
value itself was changing all time (I guess that this has to do with
a cyclic buffer that i used to give data to the APP, CULL and DRAW without
overwriting the wrong values on the way).
However, my data is a texture image, so it will only be used in the
pfDraw phase (right before to download the new textures), and in the
movie update process that is sproced to keep loading and updating the
image.
I have looked at face-space source code, and it seems like that code is
using a passthrough data to do this, and I also noticed that they uses
pfCalloc instead of pfMalloc.
Here is aprox. the code that I'm trying to get to work, but it does not
because of the
memory-allocation-on-shared-arena-mixed-with-cyclic-buffer-swapping-feature.
typedef struct _MovieS {
unsigned int *image;
int w,h;
} MovieS;
MovieS **mv;
mv=(MovieS *)pfMalloc(sizeof(MovieS *)*10,arena);
mv[0]=(MovieS *)pfMalloc(sizeof(MovieS),arena);
mv[0].w=320;
mv[0].h=240;
pfChanData(sd->pf_chan,(void *)sd,sizeof(mv));
pfChanTravFunc(sd->pf_chan,PFTRAV_DRAW,Draw);
LOOP
void Draw(pfChannel *c,void *d) {
MovieS **mv;
printf("Size : %ix%i\n",mv[0].w,mv[0].h);
pfDraw();
}
When the program is running, it is printing
Size : 0x0
instead of
Size : 320x240
as I would like to have.
I'm not sure if this is understandable, since I'm not sure about this
myself, but what I'm trying to do, is to have one process updating the
image, and the subload the textures (and that have to be done in the
draw process ???).
So what should I do ?
I know that a plain new/malloc does not work
I know that if I put everything inside a shared structure (without any
other structures) it will work
I know that if I have a structure allocated after pfConfig is called,
it does not work.
I think that performer now will copy my image data from process to process
(and that must add some overhead ?).
Thanks for trying to understand my problem (I would REALLY like to avoid
putting everyting inside my shared structure (at level 1 at least).
--Hugo Eide Gunnarsen Mob: +47 92887631 If it ain't broke, hugogu++at++oslo.sgi.com Work: +47 67114631 it doesn't have Silicon Graphics AS Direct: +47 67114600 enough features yet.
No fortune generated, out of luck.
======================================================================= List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/ Submissions: info-performer++at++sgi.com Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:56:13 PDT