home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / l / l217 / 2.ddi / EXAMPLES / CH18EX06.PRO < prev    next >
Encoding:
Text File  |  1990-03-26  |  1.1 KB  |  40 lines

  1. /*
  2.    Copyright (c) 1986, 90 by Prolog Development Center
  3. */
  4. constants
  5. % To access your BGI drivers and fonts bgi_path may need to equal "..\\BGI".
  6.    bgi_path = ""
  7.  
  8. % To access the GRAPDECL.PRO file you may need to add a path: 
  9. % include "..\\programs\\GRAPDECL.PRO" 
  10. include "GRAPDECL.PRO" 
  11.  
  12. predicates
  13.    makeViewPort
  14.  
  15. goal
  16.    initGraph(detect, 0, New_Driver, New_Mode, bgi_path),
  17.    makeViewPort,
  18.    closegraph().
  19.  
  20. clauses
  21.    makeViewPort:-
  22.       detectGraph(_, G_Mode),
  23.       getMaxX(MaxX),getMaxY(MaxY),
  24.       setViewPort(0,0,MaxX,MaxY,1),
  25.       clearViewPort,
  26.       writef("Default Mode is % , resolution is % by %",
  27.               G_Mode,MaxX,MaxY),nl,
  28.       write("Press key"),readchar(_),nl,fail.
  29.  
  30.    makeViewPort:-
  31.       detectGraph(G_Driver, _),
  32.       getModeRange(G_Driver,Low,_),
  33.       setGraphMode(Low),
  34.       getMaxX(MaxX),getMaxY(MaxY),
  35.       setViewPort(0,0,MaxX,MaxY,1),
  36.       clearViewPort,
  37.       writef("Default Mode is % , resolution is % by %",
  38.               Low,MaxX,MaxY),nl,
  39.       write("Press key"),readchar(_), nl, fail.
  40.