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