/* PIX.C -- Sets random pixels. * * Compile and link with the VMODE.OBJ file or the GAMELIB.LIB file. * * by Gary Neal, Jr. */ #include /* Needed for the rand() function */ #include /* Console specific input/output */ #include "vmode.h" /* Video mode functions */ int main(void) { while (kbhit()) getch(); /* Clear the keyboard */ SetVideoMode(VGA256); /* Switch to VGA mode 13H */ while (!kbhit()) SetPixel(rand()%ScreenWidth, rand()%ScreenHeight, rand()%ScreenColors); while (kbhit()) getch(); /* Clear the keyboard */ SetVideoMode(TEXT_MODE); /* Return to text mode */ return 0; /* Return with success */ }