home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 14 / CDACTUAL.iso / cdactual / demobin / share / program / Pascal / TURTLE10.ZIP / SVGA.INI < prev    next >
Encoding:
Text File  |  1992-12-14  |  3.1 KB  |  70 lines

  1. {------------------------------------------------------------------------}
  2. { PROJECT   : Turtle graphics using BGI                                  }
  3. { MODULE    : SVGA.INC                                                   }
  4. {------------------------------------------------------------------------}
  5. { GOAL      : initialisation module for SVGA driver                      }
  6. { VERSION   : 1.0                                                        }
  7. {------------------------------------------------------------------------}
  8. { REVISIONS :                                                            }
  9. {------------------------------------------------------------------------}
  10. { AUTHOR    : Jordan Powell Hargrave                                     }
  11. {------------------------------------------------------------------------}
  12. { CAVEAT   :  This module is a portion of copywrited code by J.P.Hargrave}
  13. {          :  for SVGA BGI drivers. The full package is available  from  }
  14. {          :  anonymous FTP sites. SVGABG40.ZIP at garbo.uwasa.fi        }
  15. {          :  registration iwith the author is required to use this code }
  16. {          :  and the SVGA.BGI driver .                                  }
  17. {          :  acopy of the regsitration form is enclosed in file         }
  18. {          :   REGSVGA.DOC                                               }
  19.  
  20. {===============================*===========================================*
  21. | Jordan Powell Hargrave    |   Internet:    jh5y@andrew.cmu.edu        |
  22. | 1000 Morewood Ave, Box #3277  |     Bitnet:    jh5y%andrew.cmu.edu@cmccvb  |
  23. | Pittsburgh, PA 15213        |       UUCP:    uunet!andrew.cmu.edu!jh5y   |
  24. | (412) 268-4488         | Compuserve:   [72510,1143]            |
  25. *===============================*===========================================}
  26.  
  27. {$F+}
  28. function DetectVGA256 : integer;
  29. begin
  30.     DetectVGA256 := 4;  { 1024*768*25}
  31. end; { DetectVGA256 }
  32. {$F-}
  33.  
  34. var
  35.   AutoDetectPointer : pointer;
  36.  
  37. procedure Initialize;
  38. { Initialize graphics and report any errors that may occur }
  39. var
  40.   InGraphicsMode : boolean; { Flags initialization of graphics mode }
  41.   PathToDriver   : string;  { Stores the DOS path to *.BGI & *.CHR }
  42.   UseWhichDriver : integer;
  43.   GraphDriver,GraphMode,ErrorCode: integer;
  44. begin
  45.   { when using Crt and graphics, turn off Crt's memory-mapped writes }
  46.   DirectVideo := False;
  47.   PathToDriver := '';
  48.   AutoDetectPointer := @DetectVGA256;
  49.   GraphDriver := InstallUserDriver('Svga256',AutoDetectPointer);
  50.   GraphDriver := Detect;
  51.   InitGraph(GraphDriver, GraphMode, PathToDriver);
  52.   ErrorCode := GraphResult;             { preserve error return }
  53.  if ErrorCode <> grOK then             { error? }
  54.    begin
  55.       Writeln('Graphics error: ', GraphErrorMsg(ErrorCode));
  56.       if ErrorCode = grFileNotFound then  { Can't find driver file }
  57.       begin
  58.         Writeln('Enter full path to BGI driver or type <Ctrl-Break> to quit:');
  59.         Readln(PathToDriver);
  60.         Writeln;
  61.       end
  62.       else
  63.        begin
  64.         Write (' press enter to leave...');
  65.         Readln;
  66.         Halt(1);
  67.        end                          { Some other error: terminate }
  68.     end;
  69. end; { Initialize }
  70.