home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / Samples / CSAPE32.ARJ / SOURCE / OWLSCR / PCMGRAPH.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-06-22  |  1.4 KB  |  63 lines

  1. /*
  2.     pcmgraph.c
  3.  
  4.     % pc_ModeGraphics, pc_SetModeGraphics
  5.  
  6.     5/16/88  by Ted.
  7.  
  8.     OWL-PC 1.2
  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.      3/28/90 jmd    ansi-fied
  18.      6/22/90 ted    added "void"s to no-parameter function per ansii.
  19. */
  20.  
  21. #include "pcpriv.h"
  22.  
  23. /* -------------------------------------------------------------------------- */
  24. static int gmodepref[] = {
  25.     0x12,            /* vga */
  26.     0x0F,            /* color ega */
  27.     0x10,            /* mono ega */
  28.     0x11,            /* mcga hires 2-color */
  29.     PCMODE_CPQ40,    /* compaq plasma hires */
  30.     PCMODE_HERC0,    /* herc */
  31.     0x06            /* cga */
  32. };
  33. #define NUMPREFS    (sizeof(gmodepref) / sizeof(int))
  34. /* -------------------------------------------------------------------------- */
  35.  
  36. boolean pc_ModeGraphics(dig_struct *digp)
  37. {
  38.     int i;
  39.  
  40.     for (i=0; i<NUMPREFS; i++) {
  41.         if (pc_OpenMode(digp, gmodepref[i])) {
  42.             return(TRUE);
  43.         }
  44.     }
  45.     return(FALSE);
  46. }
  47. /* -------------------------------------------------------------------------- */
  48.  
  49. int pc_SetModeGraphics(void)
  50. {
  51.     int i;
  52.  
  53.     for (i=0; i<NUMPREFS; i++) {
  54.         if (pc_ModeSupport(gmodepref[i])) {
  55.             pc_SetMode(gmodepref[i]);
  56.             return(gmodepref[i]);
  57.         }
  58.     }
  59.     return(0);
  60. }
  61. /* -------------------------------------------------------------------------- */
  62.  
  63.