| verzia 1.13, 2002/12/19 00:16:44 |
verzia 1.14, 2002/12/23 02:40:05 |
|
|
| #include "cpdf.h" |
#include "cpdf.h" |
| #include "svga.h" |
#include "svga.h" |
| |
|
| /* $Platon: cpdf/cpdf.c,v 1.12 2002/11/30 19:38:09 lynx Exp $ */ |
/* $Platon: cpdf/cpdf.c,v 1.13 2002/12/19 00:16:44 lynx Exp $ */ |
| static struct option lopt[] = { |
static struct option lopt[] = { |
| |
|
| {"mode", required_argument, 0, 'm'}, |
{"mode", required_argument, 0, 'm'}, |
| Riadok 78 int main(int argc, char **argv) |
|
| Riadok 78 int main(int argc, char **argv) |
|
| printf("Using %s mode\n", vga_getmodename(mode)); |
printf("Using %s mode\n", vga_getmodename(mode)); |
| vga_init(); |
vga_init(); |
| vga_setmode(mode); |
vga_setmode(mode); |
| gl_setcontextvga(mode); |
gl_setcontextvga(mode); |
| physicalscreen = gl_allocatecontext(); |
physicalscreen = gl_allocatecontext(); |
| gl_getcontext(physicalscreen); |
gl_getcontext(physicalscreen); |
| gl_setcontextvgavirtual(mode); |
gl_setcontextvgavirtual(mode); |
| virtualscreen = gl_allocatecontext(); |
virtualscreen = gl_allocatecontext(); |
| gl_getcontext(virtualscreen); |
gl_getcontext(virtualscreen); |
| gl_setcontext(virtualscreen); |
gl_setcontext(virtualscreen); |
| gl_clearscreen(0xFFFFFFFF); |
gl_clearscreen(0xFFFFFFFF); |
| { |
{ |
| char *i; |
char *i; |
| i = vga_getmodename(mode) + 1; |
i = vga_getmodename(mode) + 1; |
| screen.x = (int) strtoul(i,NULL,10); |
screen.x = (int) strtoul(i, NULL, 10); |
| i = (char *) memchr(i,'x',sizeof(G1280x1024x16M32)) + 1; |
i = (char *) memchr(i, 'x', sizeof(G1280x1024x16M32)) + 1; |
| screen.y = (int) strtoul(i,NULL,10); |
screen.y = (int) strtoul(i, NULL, 10); |
| i = (char *) memchr(i,'x',sizeof(G1280x1024x16M32)) + 1; |
i = (char *) memchr(i, 'x', sizeof(G1280x1024x16M32)) + 1; |
| if(*i == '2' && *(i + 1) == '\0') |
if (*i == '2' && *(i + 1) == '\0') |
| screen.color = 2; |
screen.color = 2; |
| if(*i == '1' && *(i + 1) == '6' && *(i + 2) == '\0') |
if (*i == '1' && *(i + 1) == '6' && *(i + 2) == '\0') |
| screen.color = 16; |
screen.color = 16; |
| if(!strncmp(i,"256",3)) |
if (!strncmp(i, "256", 3)) |
| screen.color = 256; |
screen.color = 256; |
| if(!strncmp(i,"32K",3)) |
if (!strncmp(i, "32K", 3)) |
| screen.color = K32; |
screen.color = K32; |
| if(!strncmp(i,"64K",3)) |
if (!strncmp(i, "64K", 3)) |
| screen.color = K64; |
screen.color = K64; |
| if(!strncmp(i,"16M",3)) |
if (!strncmp(i, "16M", 3)) |
| screen.color = M16; |
screen.color = M16; |
| } |
} |
| #endif |
#endif |
| parse_pdf(); |
parse_pdf(); |
| current_page = p; |
current_page = p; |
| loop(); |
loop(); |
| vga_setmode(TEXT); |
vga_setmode(TEXT); |
| fclose(fp); |
fclose(fp); |
| exit(0); |
exit(0); |
| } |
} |
| |
|
| void loop(void) |
void loop(void) |
| { |
{ |
| while(1) { |
while (1) { |
| render(); |
render(); |
| switch(getchar()) { |
switch (getchar()) { |
| case 32: |
case 32: |
| return; |
return; |
| continue; |
continue; |
| |
} |
| } |
} |
| } |
return; |
| return; |
|
| } |
} |