/**** Note that svgalib mut be installed & the program compiled
with -lvga option ****/
#include < stdio.h>
#include < stdlib.h>
#include < vga.h>
int main ()
{
int i, j, k;
char alph ;
vga_setmode(24) ;
vga_setrgbcolor( 255, 255, 255) ;
do
{
alph = vga_getkey() ;
if ( alph == 'r' )
vga_setrgbcolor( 255, 0 ,0 ) ;
if ( alph == 'g' )
vga_setrgbcolor( 0, 255, 0 ) ;
for( j= 0; j < 20 ; j++)
{
for k =0 ; k < 100; k++ )
vga_drawpixel ( k, j ) ;
}
}
while ( alph != 'Q' ) ;
vga_ setmode (TEXT) ;
return 0 ;
}
/************************/
Return to Previous Page.