home *** CD-ROM | disk | FTP | other *** search
- #include "../../manic.h"
- #include "keyboard.h"
- #include "common.h"
- #include "../init.h"
-
- int vert_frequency;
- int frame_num;
-
- struct timeval tv;
-
- void
- mm_gfx_init (void)
- {
- int mode;
- vga_modeinfo *modeinfo;
-
- if (vga_init () != 0) {
- printf ("Error Initialising svgalib!\n");
- exit (1);
- }
-
- // vga_addtiming(11200,256,296,320,336,192,199,205,220,0x20);
-
- // mode=vga_addmode(256,192,256,256,1);
- // if(!vga_hasmode(mode)) {
- mode = G320x240x256;
- // vert_frequency=60;
- // } else {
- // vert_frequency=120;
- // }
-
- if (vga_setmode (mode) != 0) {
- printf ("Can't set mode.\n");
- exit (1);
- }
- if (gl_setcontextvga (mode) != 0) {
- printf ("Error setting context!\n");
- exit (1);
- }
- gl_getcontext (&physicalscreen);
- if (gl_setcontextvgavirtual (mode) != 0) {
- printf ("Error setting virtual context!\n");
- exit (1);
- }
-
- keyboard_init ();
-
- modeinfo = vga_getmodeinfo (mode);
-
- scrnwidth = modeinfo->width;
- scrnheight = modeinfo->height;
- xoffset = (scrnwidth - 256) / 2;
- yoffset = (scrnheight - 192) / 2;
-
- // gettimeofday(&tv,NULL);
- // frame_num=0;
- }
-