home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c185 / 2.ddi / OWLSRC.EXE / CSCAPE / SOURCE / PCMGRAPH.C < prev    next >
Encoding:
C/C++ Source or Header  |  1989-09-06  |  1.3 KB  |  61 lines

  1. /*
  2.     pcmgraph.c
  3.  
  4.     % pc_ModeGraphics, pc_SetModeGraphics
  5.  
  6.     5/16/88  by Ted.
  7.  
  8.     OWL 1.1
  9.     Copyright (c) 1988, by Oakland Group, Inc.
  10.     ALL RIGHTS RESERVED.
  11.  
  12.     Revision History:
  13.     -----------------
  14.      3/23/89 ted    Got rid of pc_SetModeText.
  15.      3/23/89 ted    renamed from pcdefmod.c
  16. */
  17.  
  18. #include "pcpriv.h"
  19.  
  20. /* -------------------------------------------------------------------------- */
  21. static int gmodepref[] = {
  22.     0x12,            /* vga */
  23.     0x0F,            /* color ega */
  24.     0x10,            /* mono ega */
  25.     0x11,            /* mcga hires 2-color */
  26.     PCMODE_CPQ40,    /* compaq plasma hires */
  27.     PCMODE_HERC0,    /* herc */
  28.     0x06            /* cga */
  29. };
  30. #define NUMPREFS    (sizeof(gmodepref) / sizeof(int))
  31. /* -------------------------------------------------------------------------- */
  32.  
  33. boolean pc_ModeGraphics(digp)
  34.     dig_struct *digp;
  35. {
  36.     int i;
  37.  
  38.     for (i=0; i<NUMPREFS; i++) {
  39.         if (pc_OpenMode(digp, gmodepref[i])) {
  40.             return(TRUE);
  41.         }
  42.     }
  43.     return(FALSE);
  44. }
  45. /* -------------------------------------------------------------------------- */
  46.  
  47. int pc_SetModeGraphics()
  48. {
  49.     int i;
  50.  
  51.     for (i=0; i<NUMPREFS; i++) {
  52.         if (pc_ModeSupport(gmodepref[i])) {
  53.             pc_SetMode(gmodepref[i]);
  54.             return(gmodepref[i]);
  55.         }
  56.     }
  57.     return(0);
  58. }
  59. /* -------------------------------------------------------------------------- */
  60.  
  61.