Hi,
here's a sample code bit from one of my apps.

inline void drawScreen()
{
        RectangleType r;
        UInt16 error;
        UInt32 i,j;
        WinHandle oldh;
        
        oldh=WinSetDrawWindow(buffer);
        //The walls are already gone!
        
        //Do parametric walls, but only if needed
        if(wallparams.verticala || wallparams.verticalb ||
wallparams.horizontala || wallparams.horizontalb)
        {
                r.extent.x= 160/40;//Out of loop for speed boost
                r.extent.y= 160/40;
                for(i=0;i<=40;i++)
                {
                        for(j=0;j<=31;j++)
                        {
                                if(walls[i+1][j+1]==1)
                                {
                                        r.topLeft.x=4*i;
                                        r.topLeft.y=4*j;
                                        WinDrawRectangleFrame(1,&r);
                                }
                        }
                }
        }
        
        //Do balls
        if(hires)
        {
                WinPushDrawState();
                WinSetCoordinateSystem(kDensityDouble);//let this be 5 as
the thingy looks better then
                for(j=0; j<numofballs; j++)
                {       
                        circleMidpoint(2*(fxtof(x[j]) + 3),2*(fxtof(y[j]) +
3),5 ,degrees);
                }
                WinPopDrawState();
        }
        else
        {
                for(j=0; j<numofballs; j++)
                {       
                        circleMidpoint(fxtoi(x[j]) + 3,fxtoi(y[j]) +
3,3,degrees);
                }
        }
        
        if(enginestate!=STATE_GAME ||(paused && enginestate==STATE_GAME))
        {
                for(j=0;j<10;j++)
                {
                        if(textparams[j].active)
                        {
                                if(paused && enginestate==STATE_GAME)
                                {
        
WinDrawChars(textparams[j].text,StrLen(textparams[j].text),textparams[j].pos
ition.topLeft.x,textparams[j].position.topLeft.y);

                                }
                                else
                                {
        
WinPaintChars(textparams[j].text,StrLen(textparams[j].text),textparams[j].po
sition.topLeft.x,textparams[j].position.topLeft.y);
                                }
                        }
                }
        }
        //Double Buffer deaktivieren
        WinSetDrawWindow(oldh);
        WinCopyRectangle(buffer,oldh,&bounds,0,0,0);
}

All the best
Tam


-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/

Reply via email to