| version 1.2, 2003/06/22 18:40:34 |
version 1.3, 2003/06/27 02:18:30 |
|
|
| * |
* |
| */ |
*/ |
| |
|
| /* $Platon: games/_shared/my-graph.c,v 1.1.1.1 2003/05/11 18:50:40 nepto Exp $ */ |
/* $Platon: games/_shared/my-graph.c,v 1.2 2003/06/22 18:40:34 nepto Exp $ */ |
| |
|
| #include <stdio.h> |
#include <stdio.h> |
| #include <stdlib.h> |
#include <stdlib.h> |
|
|
| # include "fontlib.c" |
# include "fontlib.c" |
| #endif |
#endif |
| |
|
| |
#if PLATON_SYSTEM_WIN32 |
| |
# include <winbgim.h> |
| |
#endif |
| |
|
| #if PLATON_SYSTEM_MSDOS |
#if PLATON_SYSTEM_MSDOS |
| # include <graphics.h> |
# include <graphics.h> |
| #endif |
#endif |
| |
|
| #include "my-graph.h" |
#include "my-graph.h" |
| |
|
| #if PLATON_SYSTEM_MSDOS |
#if PLATON_SYSTEM_MSDOS || PLATON_SYSTEM_WIN32 |
| |
|
| int my_graph_init(int pagging) /* {{{ */ |
int my_graph_init(int pagging) /* {{{ */ |
| { |
{ |
| |
#if PLATON_SYSTEM_WIN32 |
| |
int gdriver = 9 /* VGAMAX */, gmode = 2, errorcode; |
| |
#else /* PLATON_SYSTEM_MSDOS */ |
| /* request auto detection */ |
/* request auto detection */ |
| int gdriver = 9 /* DETECT */, gmode = 2, errorcode; |
int gdriver = 9 /* DETECT */, gmode = 2, errorcode; |
| |
#endif |
| |
|
| |
#if PLATON_SYSTEM_MSDOS /* Win32 does not link EGAVGA.BGI into executable */ |
| /* register a driver that was added into graphics.lib |
/* register a driver that was added into graphics.lib |
| For information on adding the driver, see the |
For information on adding the driver, see the |
| BGIOBJ section of UTIL.DOC */ |
BGIOBJ section of UTIL.DOC */ |
| Line 45 int my_graph_init(int pagging) /* {{{ */ |
|
| Line 55 int my_graph_init(int pagging) /* {{{ */ |
|
| printf("Graphics error: %s\n", grapherrormsg(errorcode)); |
printf("Graphics error: %s\n", grapherrormsg(errorcode)); |
| return -1; |
return -1; |
| } |
} |
| |
#endif |
| |
|
| /* initialize graphics and local variables */ |
/* initialize graphics and local variables */ |
| initgraph(&gdriver, &gmode, NULL); |
initgraph(&gdriver, &gmode, NULL); |
| /* read result of initialization */ |
/* read result of initialization */ |
| Line 68 void my_graph_close(void) /* {{{ */ |
|
| Line 80 void my_graph_close(void) /* {{{ */ |
|
| closegraph(); |
closegraph(); |
| } /* }}} */ |
} /* }}} */ |
| |
|
| #endif /* #if PLATON_SYSTEM_MSDOS */ |
#endif /* #if PLATON_SYSTEM_MSDOS || PLATON_SYSTEM_WIN32 */ |
| |
|
| #if PLATON_SYSTEM_SVGALIB |
#if PLATON_SYSTEM_SVGALIB |
| |
|