From: Dick Rous (dick++at++sgi.com)
Date: 02/21/2005 01:00:59
When saving the image, you should also discriminate the pipe number in the
file name.
Like: sprintf(fname, "snap_%d_%d.rgb", frame_num,
pfGetId(pfGetChanPipe(channel)));
Dick.
-----Original Message-----
From: owner-info-performer++at++performer.engr.sgi.com
[mailto:owner-info-performer++at++performer.engr.sgi.com] On Behalf Of
faculaganymede
Sent: Friday, February 18, 2005 23:19
To: SGI Performer MailList
Subject: [info-performer] glDrawPixels n pfuSaveImage Conflicts
pfExperts,
It appears when I use glDrawPixels and pfuSaveImage in draw callback,
there's some conflicts. I get the same image on all frames - frame n is the
same as frame 0 (n=0:infinity);
Below is the DrawChannel callback function. Any idea?
// Draw process callback
static void DrawChannel (pfChannel *chan, void *) {
int g_width=500;
int g_height=500;
char *intensity_img;
static int frame_num=0;
char fname[256];
intensity_img=new char[500*500];
chan->clear();
pfDraw ();
glReadPixels( 0, 0, g_width, g_height, GL_RED, GL_UNSIGNED_BYTE,
intensity_img);
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
gluOrtho2D( 0.0, g_width, 0.0, g_height);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
glDrawPixels( g_width, g_height, GL_RED, GL_UNSIGNED_BYTE,
intensity_img);
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
glMatrixMode(GL_PROJECTION);
glPopMatrix();
sprintf(fname, "snap_%d.rgb", frame_num);
pfuSaveImage(fname, 0, 0, g_width, g_height, 0);
frame_num++;
if(intensity_img)
free(intensity_img);
}
=====
Thanks,
faculaganymede
__________________________________
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.
http://promotions.yahoo.com/new_mail
-----------------------------------------------------------------------
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
-----------------------------------------------------------------------
This archive was generated by hypermail 2b29 : Mon Feb 21 2005 - 00:58:17 PST