rw_win.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. Copyright (C) 1997-2001 Id Software, Inc.
  3. This program is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU General Public License
  5. as published by the Free Software Foundation; either version 2
  6. of the License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. See the GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  14. */
  15. #ifndef __RW_WIN_H__
  16. #define __RW_WIN_H__
  17. #include <windows.h>
  18. #include <ddraw.h>
  19. typedef struct
  20. {
  21. HINSTANCE hInstance;
  22. void *wndproc;
  23. HDC hDC; // global DC we're using
  24. HWND hWnd; // HWND of parent window
  25. HDC hdcDIBSection; // DC compatible with DIB section
  26. HBITMAP hDIBSection; // DIB section
  27. unsigned char *pDIBBase; // DIB base pointer, NOT used directly for rendering!
  28. HPALETTE hPal; // palette we're using
  29. HPALETTE hpalOld; // original system palette
  30. COLORREF oldsyscolors[20]; // original system colors
  31. HINSTANCE hinstDDRAW; // library instance for DDRAW.DLL
  32. LPDIRECTDRAW lpDirectDraw; // pointer to DirectDraw object
  33. LPDIRECTDRAWSURFACE lpddsFrontBuffer; // video card display memory front buffer
  34. LPDIRECTDRAWSURFACE lpddsBackBuffer; // system memory backbuffer
  35. LPDIRECTDRAWSURFACE lpddsOffScreenBuffer; // system memory backbuffer
  36. LPDIRECTDRAWPALETTE lpddpPalette; // DirectDraw palette
  37. qboolean palettized; // true if desktop is paletted
  38. qboolean modex;
  39. qboolean initializing;
  40. } swwstate_t;
  41. extern swwstate_t sww_state;
  42. /*
  43. ** DIB code
  44. */
  45. qboolean DIB_Init( unsigned char **ppbuffer, int *ppitch );
  46. void DIB_Shutdown( void );
  47. void DIB_SetPalette( const unsigned char *palette );
  48. qboolean DDRAW_Init( unsigned char **ppbuffer, int *ppitch );
  49. void DDRAW_Shutdown( void );
  50. void DDRAW_SetPalette( const unsigned char *palette );
  51. #endif