RE: [info-performer] glRasterPos2i()

Date view Thread view Subject view Author view

From: Dick Rous (dick++at++sgi.com)
Date: 12/10/2003 00:12:11


You need to set up the proper projection and modelview matrix.
To safely save/restore Performer and OpenGL state, specify the
following in a DRAW callback:

        
        pfPushState(); // Push Performer state.
        pfBasicState(); // Set default state.
        glMatrixMode(GL_PROJECTION); // Push projection matrix, set
identity.
        glPushMatrix();
        glLoadIdentity();
        glOrtho(0.0, 1280.0, 0.0, 1024.0, -100.0, 100.0);
        glMatrixMode(GL_MODELVIEW); // Push modelview matrix, set identity.
        glPushMatrix();
        glLoadIdentity();

        glRasterPos3f(0.0f, 1024.0f, 0.0f); // Draw image.
        glDrawPixels(xSize,
                     ySize,
                     GL_RGBA,
                     GL_UNSIGNED_BYTE,
                     image);
 
        glMatrixMode(GL_PROJECTION); // Restore OpenGL matrices.
        glPopMatrix();
        glLoadIdentity();
        glMatrixMode(GL_MODELVIEW);
        glPopMatrix();
        pfPopState(); // Restore Performer state.

Hope this helps,

Dick.

> -----Original Message-----
> From: faculaganymede [mailto:faculaganymede++at++yahoo.com]
> Sent: Wednesday, 10 December, 2003 02:42
> To: SGI Performer MailList
> Subject: [info-performer] glRasterPos2i()
>
>
> Hi all,
>
> I have a glRasterPos2i() question.
>
> In my channel draw callback function, I am doing a
> glReadPixels() and glDrawPixels(). I tried
> positioning the current raster position before
> glDrawPixels() using glRasterPos2i(x, y). But,
> whenever I set x and y to a value other than 0, the
> current raster position starts to move relative to the
> eye point at run-time, i.e. the pixel area drawn by
> glDrawPixles are moving, even though x and y are
> constant. Does anyone know why this happens?
>
>
> =====
> Thanks,
> faculaganymede
>
> __________________________________
> Do you Yahoo!?
> New Yahoo! Photos - easier uploading and sharing.
> http://photos.yahoo.com/
>
> --------------------------------------------------------------
> ---------
> 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
> --------------------------------------------------------------
> ---------
> Download OpenGL Performer 3.1 Early-Access Alphas:
> ftp://download.sgi.com/pub/access/projects/performer/download/3.1EA/
> --------------------------------------------------------------
> ---------
>


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Dec 10 2003 - 00:12:25 PST