Problem with GL calls in Performer 1.2

New Message Reply Date view Thread view Subject view Author view

Brian Loss (bfl++at++cs.duke.edu)
Mon, 27 Dec 93 10:38:29 -0500


I am porting an application from Performer 1.0 to Performer 1.2 and have run
into a slight problem. There is some code which draws a title screen which
includes a title and a status bar indicating how much of a load has been
completed. My problem is that the status bar does not show up properly. I
draw it by drawing a closed line and then a rectangle. The code to draw the
closed line works, but the code to draw the rectangle does not. Has anyone
encountered such a problem. Here is some code:

TPerfApp::DoTitle( const char *str, float status_bar )
        {
        Matrix m;
        int xo, yo, xs, ys, nidX, midY;
        Boolean zstatus;
        float v[2];

     // Figure out the center of the window
        pfGetPipeOrigin( fPipe, (long *) &xo, (long *) &yo );
        pfGetPipeSize( fPipe, (long *) &xs, (long *) &ys );
        midX = (xs / 2) + xo;
        midY = (ys / 2) + yo;

     // Save the projection and viewing matrices
        zstatus = getzbuffer( );
        zbuffer( FALSE );
        mmode( MPROJECTION );
        getmatrix( m );
        ortho2( xo, xs, yo, ys );
        mmode( MVIEWING );
        pfPushIdentMatrix( );

        cpack( TTLBKGD );
        clear( );
        cpack( TTLFRGD );

        fFonti24->Center( /* Print Title here */, midY + 200, midX ); );

        if (str)
                fFonti24->Center( str, midY - 180, midX );
        if (status_bar >= 0.0f)
                {
                cpack( 0xff0000ff );
                v[0] = 425.0f; v[1] = 150.0f;
                bgnclosedline( );
                v2f( v ); v[1] += 25.0f;
                v2f( v ); v[0] += 425.0f;
                v2f( v) ; v[1] -= 25.0f;
                v2f( v );
                endclosedline( );

                v[0] = 425.0f; v[1] = 150.0f;
                bgnpolygon( );
                v2f( v ); v[1] += 25.0f;
                v2f( v ); v[0] += status_bar*425.0f;
                v2f( v ); v[1] -= 25.0f;
                v2f( v );
                endpolygon( );
                }

        swapbuffers( );

     // Restore old projection and viewing matrices
        pfPopMatrix( );
        mmode( MPROJECTION );
        loadmatrix( m );
        mmode( MVIEWING );
        zbuffer( zstatus );
        } // end DoTitle

So, the code for the title and closed line work fine, but the code for the
polygon does not work. I'm confused. I also tried a tmesh instead of a
polygon and that didn't work either. Any help on this would be appreciated.
aTdHvAaNnKcSe.

Brian Loss
_________________________________________________________________

Department of Computer Science, Duke University, Durham, NC 27706
Internet: bfl++at++cs.duke.edu
UUCP: mcnc!duke!bfl
_________________________________________________________________


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:50:07 PDT

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