Category : C Source Code
Archive   : LSPD05-2.ZIP
Filename : 176.C

 
Output of file : 176.C contained in archive : LSPD05-2.ZIP
/* Light Speed Reference Example Program */
/* Saving/loading areas */
#include "lspeed.h"

main()
{
/* Set graphics, register font */
set640x350();
registernicefont();

/* Draw some lines */
ega_putline(0, 0, 100, 50, LS_WHITE);
ega_putline(100, 0, 0, 50, LS_YELLOW);

/* Tell the user what is happening */
ega_writetext(10, 100, LS_WHITE, LS_BLACK, NICE_FONT,
"Saving data...");

/* Save the file */
switch(ega_capture_area_byte("areatest.img", 0, 0, 100, 50))
{
/* Test return */
case 0 : /* All ok */
break;
case -1 : /* Impossible! */
printf("Not in graphics - system error!\n");
exit(1);
case -2 : /* Could not use file */
set80x25();
printf("Error - could not create AREATEST.IMG!\n");
exit(1);
}

/* Clear screen */
ega_clearpage();

/* Write loading message */
ega_writetext(10, 10, LS_YELLOW, LS_BLACK, NICE_FONT,
"Screen cleared - press a key to load data!");

/* Get a key, load data */
getxch();
ega_clearpage(); /* Clear off message too */
switch(ega_restore_area_byte("areatest.img", 0, 0, 100, 50, 0, 0))
{
/* Test return */
case 0 : /* All ok */
break;
case -1 : /* Impossible! */
printf("Not in graphics - system error!\n");
exit(1);
case -2 : /* Could not use file */
set80x25();
printf("Error - could not load AREATEST.IMG!\n");
exit(1);
}

/* Wait for key, exit */
ega_writetext(10, 100, LS_WHITE, LS_BLACK, NICE_FONT,
"Image loaded - press a key...");
getxch();
set80x25();
}


  3 Responses to “Category : C Source Code
Archive   : LSPD05-2.ZIP
Filename : 176.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/