home *** CD-ROM | disk | FTP | other *** search
/ Cutting-Edge 3D Game Programming with C++ / CE3DC++.ISO / BOOK / CHAP14 / FASTWIN.HPP < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-15  |  1012 b   |  47 lines

  1. //
  2. // File name: FastWin.HPP
  3. //
  4. // Description: The CreateDIBSection object.
  5. //
  6. // Author: John De Goes
  7. //
  8. // Project:
  9. //
  10. // Target:
  11. //
  12.  
  13. #ifndef FASTWINHPP
  14. #define FASTWINHPP
  15.  
  16. #include <Math.H>
  17. #include <Windows.H>
  18. #include <WindowsX.H>
  19.  
  20. class FastWin {
  21. protected:
  22.  
  23.  struct MyBITMAPINFO {
  24.    BITMAPINFOHEADER bmiHeader;
  25.    RGBQUAD          bmiColors [ 256 ];
  26.  } *BMInfo;
  27.  
  28.  struct MyLOGPALETTE {
  29.    WORD         palVersion;
  30.    WORD         palNumEntries;
  31.    PALETTEENTRY palPalEntry [ 256 ];
  32.  } *PalInfo;
  33.  
  34.  HBITMAP    BMHan;     // A handle to the bitmap
  35.  BYTE       *Bits;     // A pointer to variable to receive a pointer to the bitmap's bit values
  36.  
  37. public:
  38.   FastWin () : BMInfo ( NULL ), Bits ( NULL ), PalInfo ( NULL ) { }
  39.   ~FastWin () { delete BMInfo; delete PalInfo; DeleteObject ( BMHan ); }
  40.   void FastWin::Init ( DWORD Width, DWORD Height, RGBQUAD *Pal = NULL );
  41.   operator unsigned char * () { return Bits; }
  42.   void Show ();
  43.   void Colors ();
  44. };
  45.  
  46. #endif
  47.