home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / df3os2.zip / SCREEN.H < prev    next >
C/C++ Source or Header  |  1993-11-13  |  1KB  |  49 lines

  1. // ----------- screen.h
  2. //
  3. // modified for OS/2 operation - jw21sep93
  4.  
  5. #ifndef SCREEN_H
  6. #define SCREEN_H
  7.  
  8. #define INCL_BASE
  9. #define INCL_NOPMAPI
  10. #include <os2.h>
  11.  
  12. #include "dflatdef.h"
  13. #include "rectangl.h"
  14.  
  15. const char SPACECHAR = 0x20;
  16.  
  17. class Screen    
  18.     {
  19.     VIOMODEINFO   mi;
  20.  
  21.     unsigned height;
  22.     unsigned width;
  23.     // ---- compute video offset address
  24.     unsigned vad(int x, int y) { return y * (width*2) + x*2; }
  25. public:
  26.     Screen();
  27.     unsigned Height() { return height; }
  28.     unsigned Width()  { return width; }
  29.  
  30.     void         Scroll(Rect &rc, int d, int fg, int bg);
  31.     unsigned int GetVideoChar(int x, int y);
  32.     void         PutVideoChar(int x, int y, unsigned int c);
  33.     void         WriteVideoString(const char *s,int x,int y,int fg,int bg);
  34.  
  35.     void         GetBuffer(Rect &rc, char *bf);
  36.     void         PutBuffer(Rect &rc, char *bf);
  37.     };
  38.  
  39.  
  40. inline int clr(int fg, int bg)
  41.     {
  42.     return fg | (bg << 4);
  43.     }
  44.  
  45. #endif
  46.  
  47.  
  48.  
  49.