Re: programming problem...

Search this archive.

From: Sergio Masci (sergio@titan.demon.co.uk)
Date: Sat 15 Jul 2000 - 20:12:15 IDT


> 
> 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


This archive was generated by hypermail 2.1.4 : Wed 21 Jan 2004 - 22:10:23 IST