> 
> Hi,
> I am wondering if you could shed some light onto a tetris game programming
> problem that I am experiencing.
> 
> Using svgalib I have the following program loop:-
> 
>       drawScreen();
>       int count = 0;
> 
>       if(count > 19){
>               shiftTetrisBlocks();
>               count = 0;
>       }
> 
>       for(;;){
>               drawScreen();
>               lookForUserEvents();
>               usleep(50000);
>               count++;
>       }
> 
> Just wondering if you could see a problem in this logic. The keys respond as
> they should but I cannot get program to draw stuff onto the screen. Any
> ideas? if the logic looks ok, then how can i debug svga programs?
> 
> thanks,
> 
> Chris Gottlieb
> 


should this be:

        drawScreen();
        int count = 0;
 
        for(;;){

                if(count > 19){
                        shiftTetrisBlocks();
                        count = 0;
                }
 
                drawScreen();
                lookForUserEvents();
                usleep(50000);
                count++;
        }

Other people on this mailing list have already discussed how to debug
svgalib programs using gdb. Try searching the mailing list archive at
http://www.svgalib.org (in particular look for a msg from russell.marks
with the subject 'Re: debugging svgalib programs')

Personally I send stuff to a file which I can then look at from another
virtual console or even another machine.

Regards
Sergio

Reply via email to