home *** CD-ROM | disk | FTP | other *** search
/ RISCWORLD 7 / RISCWORLD_VOL7.iso / Software / Issue4 / IYONIX / MANICMINER / SOURCE.ZIP / manicminer-1.6.3 / gfxlibs / svgalib / c / init < prev    next >
Encoding:
Text File  |  2000-12-01  |  1.1 KB  |  58 lines

  1. #include "../../manic.h"
  2. #include "keyboard.h"
  3. #include "common.h"
  4. #include "../init.h"
  5.  
  6. int vert_frequency;
  7. int frame_num;
  8.  
  9. struct timeval tv;
  10.  
  11. void
  12. mm_gfx_init (void)
  13. {
  14.   int mode;
  15.   vga_modeinfo *modeinfo;
  16.  
  17.   if (vga_init () != 0) {
  18.     printf ("Error Initialising svgalib!\n");
  19.     exit (1);
  20.   }
  21.  
  22. //        vga_addtiming(11200,256,296,320,336,192,199,205,220,0x20);
  23.  
  24. //        mode=vga_addmode(256,192,256,256,1);
  25. //        if(!vga_hasmode(mode)) {
  26.   mode = G320x240x256;
  27. //            vert_frequency=60;
  28. //        } else {
  29. //            vert_frequency=120;
  30. //        }
  31.  
  32.   if (vga_setmode (mode) != 0) {
  33.     printf ("Can't set mode.\n");
  34.     exit (1);
  35.   }
  36.   if (gl_setcontextvga (mode) != 0) {
  37.     printf ("Error setting context!\n");
  38.     exit (1);
  39.   }
  40.   gl_getcontext (&physicalscreen);
  41.   if (gl_setcontextvgavirtual (mode) != 0) {
  42.     printf ("Error setting virtual context!\n");
  43.     exit (1);
  44.   }
  45.  
  46.   keyboard_init ();
  47.  
  48.   modeinfo = vga_getmodeinfo (mode);
  49.  
  50.   scrnwidth = modeinfo->width;
  51.   scrnheight = modeinfo->height;
  52.   xoffset = (scrnwidth - 256) / 2;
  53.   yoffset = (scrnheight - 192) / 2;
  54.  
  55. //        gettimeofday(&tv,NULL);
  56. //        frame_num=0;
  57. }
  58.