home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c065 / 1.ddi / CLIB1.ZIP / TEXTMODE.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-06-07  |  2.5 KB  |  74 lines

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