home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_122 / 5.ddi / CLIBSRC2.ZIP / TEXTMODE.C < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  2.6 KB  |  73 lines

  1. /*-----------------------------------------------------------------------*
  2.  * filename - textmode.c
  3.  *
  4.  * function(s)
  5.  *        textmode - changes the current video mode to newmode
  6.  *-----------------------------------------------------------------------*/
  7.  
  8. /*
  9.  *      C/C++ Run Time Library - Version 5.0
  10.  *
  11.  *      Copyright (c) 1987, 1992 by Borland International
  12.  *      All Rights Reserved.
  13.  *
  14.  */
  15.  
  16.  
  17. /*---------------------------------------------------------------------*
  18.  
  19. Name            textmode - changes the current video mode to newmode
  20.  
  21. Usage           void textmode(int newmode);
  22.  
  23. Prototype in    conio.h
  24.  
  25. Description     textmode selects a specific text mode.
  26.  
  27.                 You can give the text mode (the argument mode) by
  28.                 using a symbolic constant from the enumeration
  29.                 type text_modes (defined in CONIO.H); if you use
  30.                 these constants, you must #include <conio.h>
  31.  
  32.                 The text_mode type constants, their numeric
  33.                 values, and the modes they specify are given in
  34.                 the following table.
  35.  
  36.                 ------------------------------------------------
  37.                  Symbolic       Numeric         Text mode
  38.                  constant       value
  39.                 ------------------------------------------------
  40.  
  41.                  LAST           -1      Previous text mode
  42.                  BW40            0      Black & white, 40 columns
  43.                  C40             1      Color, 40 columns
  44.                  BW80            2      Black & white, 80 columns
  45.                  C80             3      Color, 80 columns
  46.                  MONO            7      Monochrome, 80 columns
  47.                  C4350           64     Color, 43 lines/EGA, 50 lines/VGA
  48.  
  49.                 When textmode is called, the current window is
  50.                 reset to the entire screen, and the current text
  51.                 attributes are reset to normal, corresponding to
  52.                 a call to normvideo.
  53.  
  54.                 Specifying LAST to textmode causes the most-
  55.                 recently-selected text mode to be reselected.
  56.                 This feature is really only useful when you want
  57.                 to return to text mode after using a graphics
  58.                 mode.
  59.  
  60. Return value    None
  61.  
  62. *---------------------------------------------------------------------*/
  63.  
  64. #include <_video.h>
  65. #include <conio.h>
  66.  
  67. void textmode( int newmode )
  68.   {
  69.   if( newmode == LASTMODE )  newmode = _video.currmode;
  70.   _crtinit( newmode );
  71.   _video.attribute = _video.normattr;
  72.   }
  73.