stereo

New Message Reply Date view Thread view Subject view Author view

Lea Wittie (lwittie++at++cs.uiowa.edu)
Tue, 17 Jun 1997 16:48:06 -0500 (CDT)


Hi,
        I was looking at Allan Schaffer's stereo.c and I was wondering if
he (or anyone else) could explain how these code bits worked:

static void
DrawChannel (pfChannel *channel, void *left)
{
                        ......

    /* which buffer to draw into ? */
    if(Shared->stereo) { /* if not stereo, draw to left all the time */
        if(*(int*)left) {
#ifdef IRISGL
            leftbuffer(1);
            rightbuffer(0);
#else
            glDrawBuffer(GL_BACK_LEFT);
#endif
        } else {
#ifdef IRISGL
            leftbuffer(0);
            rightbuffer(1);
#else
            glDrawBuffer(GL_BACK_RIGHT);
#endif
        }
    }
                        ......
}

        I don't understand what "if(*(int*)left)" does. Does it make left
into an integer or look to see if it's already one? I was also wondering if
this meant that the value of left switched between int to non-int every
time this function is called. If so, what causes this?

        Thanks a bunch for any help you can give,

-Lea Wittie
lwittie++at++cs.uiowa.edu
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
            Submissions: info-performer++at++sgi.com
        Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:55:28 PDT

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