icculus quake2 doxygen  1.0 dev
rw_win.h File Reference
#include <windows.h>
#include <ddraw.h>

Go to the source code of this file.

Classes

struct  swwstate_t
 

Functions

qboolean DIB_Init (unsigned char **ppbuffer, int *ppitch)
 
void DIB_Shutdown (void)
 
void DIB_SetPalette (const unsigned char *palette)
 
qboolean DDRAW_Init (unsigned char **ppbuffer, int *ppitch)
 
void DDRAW_Shutdown (void)
 
void DDRAW_SetPalette (const unsigned char *palette)
 

Variables

swwstate_t sww_state
 

Function Documentation

◆ DDRAW_Init()

qboolean DDRAW_Init ( unsigned char **  ppbuffer,
int ppitch 
)

Definition at line 42 of file rw_ddraw.c.

43 {
44  HRESULT ddrval;
45  DDSURFACEDESC ddsd;
46  DDSCAPS ddscaps;
47  PALETTEENTRY palentries[256];
48  int i;
49  extern cvar_t *sw_allow_modex;
50 
51  HRESULT (WINAPI *QDirectDrawCreate)( GUID FAR *lpGUID, LPDIRECTDRAW FAR * lplpDDRAW, IUnknown FAR * pUnkOuter );
52 
53 ri.Con_Printf( PRINT_ALL, "Initializing DirectDraw\n");
54 
55 
56  for ( i = 0; i < 256; i++ )
57  {
58  palentries[i].peRed = ( d_8to24table[i] >> 0 ) & 0xff;
59  palentries[i].peGreen = ( d_8to24table[i] >> 8 ) & 0xff;
60  palentries[i].peBlue = ( d_8to24table[i] >> 16 ) & 0xff;
61  }
62 
63  /*
64  ** load DLL and fetch pointer to entry point
65  */
66  if ( !sww_state.hinstDDRAW )
67  {
68  ri.Con_Printf( PRINT_ALL, "...loading DDRAW.DLL: ");
69  if ( ( sww_state.hinstDDRAW = LoadLibrary( "ddraw.dll" ) ) == NULL )
70  {
71  ri.Con_Printf( PRINT_ALL, "failed\n" );
72  goto fail;
73  }
74  ri.Con_Printf( PRINT_ALL, "ok\n" );
75  }
76 
77  if ( ( QDirectDrawCreate = ( HRESULT (WINAPI *)( GUID FAR *, LPDIRECTDRAW FAR *, IUnknown FAR * ) ) GetProcAddress( sww_state.hinstDDRAW, "DirectDrawCreate" ) ) == NULL )
78  {
79  ri.Con_Printf( PRINT_ALL, "*** DirectDrawCreate == NULL ***\n" );
80  goto fail;
81  }
82 
83  /*
84  ** create the direct draw object
85  */
86  ri.Con_Printf( PRINT_ALL, "...creating DirectDraw object: ");
87  if ( ( ddrval = QDirectDrawCreate( NULL, &sww_state.lpDirectDraw, NULL ) ) != DD_OK )
88  {
89  ri.Con_Printf( PRINT_ALL, "failed - %s\n", DDrawError( ddrval ) );
90  goto fail;
91  }
92  ri.Con_Printf( PRINT_ALL, "ok\n" );
93 
94  /*
95  ** see if linear modes exist first
96  */
97  sww_state.modex = false;
98 
99  ri.Con_Printf( PRINT_ALL, "...setting exclusive mode: ");
100  if ( ( ddrval = sww_state.lpDirectDraw->lpVtbl->SetCooperativeLevel( sww_state.lpDirectDraw,
101  sww_state.hWnd,
102  DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN ) ) != DD_OK )
103  {
104  ri.Con_Printf( PRINT_ALL, "failed - %s\n",DDrawError (ddrval) );
105  goto fail;
106  }
107  ri.Con_Printf( PRINT_ALL, "ok\n" );
108 
109  /*
110  ** try changing the display mode normally
111  */
112  ri.Con_Printf( PRINT_ALL, "...finding display mode\n" );
113  ri.Con_Printf( PRINT_ALL, "...setting linear mode: " );
114  if ( ( ddrval = sww_state.lpDirectDraw->lpVtbl->SetDisplayMode( sww_state.lpDirectDraw, vid.width, vid.height, 8 ) ) == DD_OK )
115  {
116  ri.Con_Printf( PRINT_ALL, "ok\n" );
117  }
118  /*
119  ** if no linear mode found, go for modex if we're trying 320x240
120  */
121  else if ( ( sw_mode->value == 0 ) && sw_allow_modex->value )
122  {
123  ri.Con_Printf( PRINT_ALL, "failed\n" );
124  ri.Con_Printf( PRINT_ALL, "...attempting ModeX 320x240: ");
125 
126  /*
127  ** reset to normal cooperative level
128  */
129  sww_state.lpDirectDraw->lpVtbl->SetCooperativeLevel( sww_state.lpDirectDraw,
130  sww_state.hWnd,
131  DDSCL_NORMAL );
132 
133  /*
134  ** set exclusive mode
135  */
136  if ( ( ddrval = sww_state.lpDirectDraw->lpVtbl->SetCooperativeLevel( sww_state.lpDirectDraw,
137  sww_state.hWnd,
138  DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN | DDSCL_NOWINDOWCHANGES | DDSCL_ALLOWMODEX ) ) != DD_OK )
139  {
140  ri.Con_Printf( PRINT_ALL, "failed SCL - %s\n",DDrawError (ddrval) );
141  goto fail;
142  }
143 
144  /*
145  ** change our display mode
146  */
147  if ( ( ddrval = sww_state.lpDirectDraw->lpVtbl->SetDisplayMode( sww_state.lpDirectDraw, vid.width, vid.height, 8 ) ) != DD_OK )
148  {
149  ri.Con_Printf( PRINT_ALL, "failed SDM - %s\n", DDrawError( ddrval ) );
150  goto fail;
151  }
152  ri.Con_Printf( PRINT_ALL, "ok\n" );
153 
154  sww_state.modex = true;
155  }
156  else
157  {
158  ri.Con_Printf( PRINT_ALL, "failed\n" );
159  goto fail;
160  }
161 
162  /*
163  ** create our front buffer
164  */
165  memset( &ddsd, 0, sizeof( ddsd ) );
166  ddsd.dwSize = sizeof( ddsd );
167  ddsd.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT;
168  ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_FLIP | DDSCAPS_COMPLEX;
169  ddsd.dwBackBufferCount = 1;
170 
171  ri.Con_Printf( PRINT_ALL, "...creating front buffer: ");
172  if ( ( ddrval = sww_state.lpDirectDraw->lpVtbl->CreateSurface( sww_state.lpDirectDraw, &ddsd, &sww_state.lpddsFrontBuffer, NULL ) ) != DD_OK )
173  {
174  ri.Con_Printf( PRINT_ALL, "failed - %s\n", DDrawError( ddrval ) );
175  goto fail;
176  }
177  ri.Con_Printf( PRINT_ALL, "ok\n" );
178 
179  /*
180  ** see if we're a ModeX mode
181  */
182  sww_state.lpddsFrontBuffer->lpVtbl->GetCaps( sww_state.lpddsFrontBuffer, &ddscaps );
183  if ( ddscaps.dwCaps & DDSCAPS_MODEX )
184  ri.Con_Printf( PRINT_ALL, "...using ModeX\n" );
185 
186  /*
187  ** create our back buffer
188  */
189  ddsd.ddsCaps.dwCaps = DDSCAPS_BACKBUFFER;
190 
191  ri.Con_Printf( PRINT_ALL, "...creating back buffer: " );
192  if ( ( ddrval = sww_state.lpddsFrontBuffer->lpVtbl->GetAttachedSurface( sww_state.lpddsFrontBuffer, &ddsd.ddsCaps, &sww_state.lpddsBackBuffer ) ) != DD_OK )
193  {
194  ri.Con_Printf( PRINT_ALL, "failed - %s\n", DDrawError( ddrval ) );
195  goto fail;
196  }
197  ri.Con_Printf( PRINT_ALL, "ok\n" );
198 
199  /*
200  ** create our rendering buffer
201  */
202  memset( &ddsd, 0, sizeof( ddsd ) );
203  ddsd.dwSize = sizeof( ddsd );
204  ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS;
205  ddsd.dwHeight = vid.height;
206  ddsd.dwWidth = vid.width;
207  ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY;
208 
209  ri.Con_Printf( PRINT_ALL, "...creating offscreen buffer: " );
210  if ( ( ddrval = sww_state.lpDirectDraw->lpVtbl->CreateSurface( sww_state.lpDirectDraw, &ddsd, &sww_state.lpddsOffScreenBuffer, NULL ) ) != DD_OK )
211  {
212  ri.Con_Printf( PRINT_ALL, "failed - %s\n", DDrawError( ddrval ) );
213  goto fail;
214  }
215  ri.Con_Printf( PRINT_ALL, "ok\n" );
216 
217  /*
218  ** create our DIRECTDRAWPALETTE
219  */
220  ri.Con_Printf( PRINT_ALL, "...creating palette: " );
221  if ( ( ddrval = sww_state.lpDirectDraw->lpVtbl->CreatePalette( sww_state.lpDirectDraw,
222  DDPCAPS_8BIT | DDPCAPS_ALLOW256,
223  palentries,
225  NULL ) ) != DD_OK )
226  {
227  ri.Con_Printf( PRINT_ALL, "failed - %s\n", DDrawError( ddrval ) );
228  goto fail;
229  }
230  ri.Con_Printf( PRINT_ALL, "ok\n" );
231 
232  ri.Con_Printf( PRINT_ALL, "...setting palette: " );
233  if ( ( ddrval = sww_state.lpddsFrontBuffer->lpVtbl->SetPalette( sww_state.lpddsFrontBuffer,
234  sww_state.lpddpPalette ) ) != DD_OK )
235  {
236  ri.Con_Printf( PRINT_ALL, "failed - %s\n", DDrawError( ddrval ) );
237  goto fail;
238  }
239  ri.Con_Printf( PRINT_ALL, "ok\n" );
240 
241  DDRAW_SetPalette( ( const unsigned char * ) sw_state.currentpalette );
242 
243  /*
244  ** lock the back buffer
245  */
246  memset( &ddsd, 0, sizeof( ddsd ) );
247  ddsd.dwSize = sizeof( ddsd );
248 
249 ri.Con_Printf( PRINT_ALL, "...locking backbuffer: " );
250  if ( ( ddrval = sww_state.lpddsOffScreenBuffer->lpVtbl->Lock( sww_state.lpddsOffScreenBuffer, NULL, &ddsd, DDLOCK_WAIT, NULL ) ) != DD_OK )
251  {
252  ri.Con_Printf( PRINT_ALL, "failed - %s\n", DDrawError( ddrval ) );
253  goto fail;
254  }
255 ri.Con_Printf( PRINT_ALL, "ok\n" );
256 
257  *ppbuffer = ddsd.lpSurface;
258  *ppitch = ddsd.lPitch;
259 
260  for ( i = 0; i < vid.height; i++ )
261  {
262  memset( *ppbuffer + i * *ppitch, 0, *ppitch );
263  }
264 
265  sww_state.palettized = true;
266 
267  return true;
268 fail:
269  ri.Con_Printf( PRINT_ALL, "*** DDraw init failure ***\n" );
270 
271  DDRAW_Shutdown();
272  return false;
273 }

Referenced by SWimp_InitGraphics().

◆ DDRAW_SetPalette()

void DDRAW_SetPalette ( const unsigned char *  palette)

Definition at line 288 of file rw_ddraw.c.

289 {
290  PALETTEENTRY palentries[256];
291  int i;
292 
293  if (!sww_state.lpddpPalette)
294  return;
295 
296  for ( i = 0; i < 256; i++, pal += 4 )
297  {
298  palentries[i].peRed = pal[0];
299  palentries[i].peGreen = pal[1];
300  palentries[i].peBlue = pal[2];
301  palentries[i].peFlags = PC_RESERVED | PC_NOCOLLAPSE;
302  }
303 
304  if ( sww_state.lpddpPalette->lpVtbl->SetEntries( sww_state.lpddpPalette,
305  0,
306  0,
307  256,
308  palentries ) != DD_OK )
309  {
310  ri.Con_Printf( PRINT_ALL, "DDRAW_SetPalette() - SetEntries failed\n" );
311  }
312 }

Referenced by DDRAW_Init(), and SWimp_SetPalette().

◆ DDRAW_Shutdown()

void DDRAW_Shutdown ( void  )

Definition at line 317 of file rw_ddraw.c.

318 {
320  {
321  ri.Con_Printf( PRINT_ALL, "...releasing offscreen buffer\n");
325  }
326 
328  {
329  ri.Con_Printf( PRINT_ALL, "...releasing back buffer\n");
332  }
333 
335  {
336  ri.Con_Printf( PRINT_ALL, "...releasing front buffer\n");
339  }
340 
342  {
343  ri.Con_Printf( PRINT_ALL, "...releasing palette\n");
344  sww_state.lpddpPalette->lpVtbl->Release ( sww_state.lpddpPalette );
346  }
347 
348  if ( sww_state.lpDirectDraw )
349  {
350  ri.Con_Printf( PRINT_ALL, "...restoring display mode\n");
351  sww_state.lpDirectDraw->lpVtbl->RestoreDisplayMode( sww_state.lpDirectDraw );
352  ri.Con_Printf( PRINT_ALL, "...restoring normal coop mode\n");
353  sww_state.lpDirectDraw->lpVtbl->SetCooperativeLevel( sww_state.lpDirectDraw, sww_state.hWnd, DDSCL_NORMAL );
354  ri.Con_Printf( PRINT_ALL, "...releasing lpDirectDraw\n");
355  sww_state.lpDirectDraw->lpVtbl->Release( sww_state.lpDirectDraw );
357  }
358 
359  if ( sww_state.hinstDDRAW )
360  {
361  ri.Con_Printf( PRINT_ALL, "...freeing library\n");
362  FreeLibrary( sww_state.hinstDDRAW );
364  }
365 }

Referenced by DDRAW_Init(), and SWimp_Shutdown().

◆ DIB_Init()

qboolean DIB_Init ( unsigned char **  ppbuffer,
int ppitch 
)

Definition at line 88 of file rw_dib.c.

89 {
90  dibinfo_t dibheader;
91  BITMAPINFO *pbmiDIB = ( BITMAPINFO * ) &dibheader;
92  int i;
93 
94  memset( &dibheader, 0, sizeof( dibheader ) );
95 
96  /*
97  ** grab a DC
98  */
99  if ( !sww_state.hDC )
100  {
101  if ( ( sww_state.hDC = GetDC( sww_state.hWnd ) ) == NULL )
102  return false;
103  }
104 
105  /*
106  ** figure out if we're running in an 8-bit display mode
107  */
108  if ( GetDeviceCaps( sww_state.hDC, RASTERCAPS ) & RC_PALETTE )
109  {
110  sww_state.palettized = true;
111 
112  // save system colors
113  if ( !s_systemcolors_saved )
114  {
116  s_systemcolors_saved = true;
117  }
118  }
119  else
120  {
121  sww_state.palettized = false;
122  }
123 
124  /*
125  ** fill in the BITMAPINFO struct
126  */
127  pbmiDIB->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
128  pbmiDIB->bmiHeader.biWidth = vid.width;
129  pbmiDIB->bmiHeader.biHeight = vid.height;
130  pbmiDIB->bmiHeader.biPlanes = 1;
131  pbmiDIB->bmiHeader.biBitCount = 8;
132  pbmiDIB->bmiHeader.biCompression = BI_RGB;
133  pbmiDIB->bmiHeader.biSizeImage = 0;
134  pbmiDIB->bmiHeader.biXPelsPerMeter = 0;
135  pbmiDIB->bmiHeader.biYPelsPerMeter = 0;
136  pbmiDIB->bmiHeader.biClrUsed = 256;
137  pbmiDIB->bmiHeader.biClrImportant = 256;
138 
139  /*
140  ** fill in the palette
141  */
142  for ( i = 0; i < 256; i++ )
143  {
144  dibheader.acolors[i].rgbRed = ( d_8to24table[i] >> 0 ) & 0xff;
145  dibheader.acolors[i].rgbGreen = ( d_8to24table[i] >> 8 ) & 0xff;
146  dibheader.acolors[i].rgbBlue = ( d_8to24table[i] >> 16 ) & 0xff;
147  }
148 
149  /*
150  ** create the DIB section
151  */
152  sww_state.hDIBSection = CreateDIBSection( sww_state.hDC,
153  pbmiDIB,
154  DIB_RGB_COLORS,
156  NULL,
157  0 );
158 
159  if ( sww_state.hDIBSection == NULL )
160  {
161  ri.Con_Printf( PRINT_ALL, "DIB_Init() - CreateDIBSection failed\n" );
162  goto fail;
163  }
164 
165  if ( pbmiDIB->bmiHeader.biHeight > 0 )
166  {
167  // bottom up
168  *ppbuffer = sww_state.pDIBBase + ( vid.height - 1 ) * vid.width;
169  *ppitch = -vid.width;
170  }
171  else
172  {
173  // top down
174  *ppbuffer = sww_state.pDIBBase;
175  *ppitch = vid.width;
176  }
177 
178  /*
179  ** clear the DIB memory buffer
180  */
181  memset( sww_state.pDIBBase, 0xff, vid.width * vid.height );
182 
183  if ( ( sww_state.hdcDIBSection = CreateCompatibleDC( sww_state.hDC ) ) == NULL )
184  {
185  ri.Con_Printf( PRINT_ALL, "DIB_Init() - CreateCompatibleDC failed\n" );
186  goto fail;
187  }
189  {
190  ri.Con_Printf( PRINT_ALL, "DIB_Init() - SelectObject failed\n" );
191  goto fail;
192  }
193 
194  return true;
195 
196 fail:
197  DIB_Shutdown();
198  return false;
199 
200 }

Referenced by SWimp_InitGraphics().

◆ DIB_SetPalette()

void DIB_SetPalette ( const unsigned char *  palette)

Definition at line 215 of file rw_dib.c.

216 {
217  const unsigned char *pal = _pal;
218  LOGPALETTE *pLogPal = ( LOGPALETTE * ) &s_ipal;
219  RGBQUAD colors[256];
220  int i;
221  int ret;
222  HDC hDC = sww_state.hDC;
223 
224  /*
225  ** set the DIB color table
226  */
227  if ( sww_state.hdcDIBSection )
228  {
229  for ( i = 0; i < 256; i++, pal += 4 )
230  {
231  colors[i].rgbRed = pal[0];
232  colors[i].rgbGreen = pal[1];
233  colors[i].rgbBlue = pal[2];
234  colors[i].rgbReserved = 0;
235  }
236 
237  colors[0].rgbRed = 0;
238  colors[0].rgbGreen = 0;
239  colors[0].rgbBlue = 0;
240 
241  colors[255].rgbRed = 0xff;
242  colors[255].rgbGreen = 0xff;
243  colors[255].rgbBlue = 0xff;
244 
245  if ( SetDIBColorTable( sww_state.hdcDIBSection, 0, 256, colors ) == 0 )
246  {
247  ri.Con_Printf( PRINT_ALL, "DIB_SetPalette() - SetDIBColorTable failed\n" );
248  }
249  }
250 
251  /*
252  ** for 8-bit color desktop modes we set up the palette for maximum
253  ** speed by going into an identity palette mode.
254  */
255  if ( sww_state.palettized )
256  {
257  int i;
258  HPALETTE hpalOld;
259 
260  if ( SetSystemPaletteUse( hDC, SYSPAL_NOSTATIC ) == SYSPAL_ERROR )
261  {
262  ri.Sys_Error( ERR_FATAL, "DIB_SetPalette() - SetSystemPaletteUse() failed\n" );
263  }
264 
265  /*
266  ** destroy our old palette
267  */
268  if ( sww_state.hPal )
269  {
270  DeleteObject( sww_state.hPal );
271  sww_state.hPal = 0;
272  }
273 
274  /*
275  ** take up all physical palette entries to flush out anything that's currently
276  ** in the palette
277  */
278  pLogPal->palVersion = 0x300;
279  pLogPal->palNumEntries = 256;
280 
281  for ( i = 0, pal = _pal; i < 256; i++, pal += 4 )
282  {
283  pLogPal->palPalEntry[i].peRed = pal[0];
284  pLogPal->palPalEntry[i].peGreen = pal[1];
285  pLogPal->palPalEntry[i].peBlue = pal[2];
286  pLogPal->palPalEntry[i].peFlags = PC_RESERVED | PC_NOCOLLAPSE;
287  }
288  pLogPal->palPalEntry[0].peRed = 0;
289  pLogPal->palPalEntry[0].peGreen = 0;
290  pLogPal->palPalEntry[0].peBlue = 0;
291  pLogPal->palPalEntry[0].peFlags = 0;
292  pLogPal->palPalEntry[255].peRed = 0xff;
293  pLogPal->palPalEntry[255].peGreen = 0xff;
294  pLogPal->palPalEntry[255].peBlue = 0xff;
295  pLogPal->palPalEntry[255].peFlags = 0;
296 
297  if ( ( sww_state.hPal = CreatePalette( pLogPal ) ) == NULL )
298  {
299  ri.Sys_Error( ERR_FATAL, "DIB_SetPalette() - CreatePalette failed(%x)\n", GetLastError() );
300  }
301 
302  if ( ( hpalOld = SelectPalette( hDC, sww_state.hPal, FALSE ) ) == NULL )
303  {
304  ri.Sys_Error( ERR_FATAL, "DIB_SetPalette() - SelectPalette failed(%x)\n",GetLastError() );
305  }
306 
307  if ( sww_state.hpalOld == NULL )
308  sww_state.hpalOld = hpalOld;
309 
310  if ( ( ret = RealizePalette( hDC ) ) != pLogPal->palNumEntries )
311  {
312  ri.Sys_Error( ERR_FATAL, "DIB_SetPalette() - RealizePalette set %d entries\n", ret );
313  }
314  }
315 }

Referenced by SWimp_SetPalette().

◆ DIB_Shutdown()

void DIB_Shutdown ( void  )

Definition at line 320 of file rw_dib.c.

321 {
324 
325  if ( sww_state.hPal )
326  {
327  DeleteObject( sww_state.hPal );
328  sww_state.hPal = 0;
329  }
330 
331  if ( sww_state.hpalOld )
332  {
333  SelectPalette( sww_state.hDC, sww_state.hpalOld, FALSE );
334  RealizePalette( sww_state.hDC );
336  }
337 
338  if ( sww_state.hdcDIBSection )
339  {
341  DeleteDC( sww_state.hdcDIBSection );
343  }
344 
345  if ( sww_state.hDIBSection )
346  {
347  DeleteObject( sww_state.hDIBSection );
350  }
351 
352  if ( sww_state.hDC )
353  {
354  ReleaseDC( sww_state.hWnd, sww_state.hDC );
355  sww_state.hDC = 0;
356  }
357 }

Referenced by DIB_Init(), and SWimp_Shutdown().

Variable Documentation

◆ sww_state

DDrawError
static const char * DDrawError(int code)
Definition: rw_ddraw.c:367
viddef_t::buffer
pixel_t * buffer
Definition: r_local.h:88
s_ipal
static identitypalette_t s_ipal
Definition: rw_dib.c:78
ri
refimport_t ri
Definition: r_main.c:25
DDRAW_Shutdown
void DDRAW_Shutdown(void)
Definition: rw_ddraw.c:317
swwstate_t::lpddsFrontBuffer
LPDIRECTDRAWSURFACE lpddsFrontBuffer
Definition: rw_win.h:44
viddef_t::width
int width
Definition: vid.h:29
i
int i
Definition: q_shared.c:305
previously_selected_GDI_obj
static HGDIOBJ previously_selected_GDI_obj
Definition: rw_dib.c:35
swwstate_t::pDIBBase
unsigned char * pDIBBase
Definition: rw_win.h:35
viddef_t::height
int height
Definition: vid.h:29
swwstate_t::lpddsOffScreenBuffer
LPDIRECTDRAWSURFACE lpddsOffScreenBuffer
Definition: rw_win.h:46
cvar_s
Definition: q_shared.h:317
swwstate_t::hinstDDRAW
HINSTANCE hinstDDRAW
Definition: rw_win.h:41
refimport_t::Con_Printf
void(* Con_Printf)(int print_level, char *str,...)
Definition: ref.h:228
PRINT_ALL
#define PRINT_ALL
Definition: qcommon.h:743
swwstate_t::hPal
HPALETTE hPal
Definition: rw_win.h:37
swwstate_t::palettized
qboolean palettized
Definition: rw_win.h:49
HDC
HDC(WINAPI *qwglGetCurrentDC)(VOID)
refimport_t::Sys_Error
void(* Sys_Error)(int err_level, char *str,...)
Definition: ref.h:220
DDRAW_SetPalette
void DDRAW_SetPalette(const unsigned char *pal)
Definition: rw_ddraw.c:288
DIB_SaveSystemColors
static void DIB_SaveSystemColors(void)
Definition: rw_dib.c:369
cvar_s::value
float value
Definition: q_shared.h:324
swwstate_t::modex
qboolean modex
Definition: rw_win.h:50
NULL
#define NULL
Definition: q_shared.h:60
DIB_Shutdown
void DIB_Shutdown(void)
Definition: rw_dib.c:320
DIB_RestoreSystemColors
static void DIB_RestoreSystemColors(void)
Definition: rw_dib.c:363
ERR_FATAL
#define ERR_FATAL
Definition: qcommon.h:735
dibinfo::acolors
RGBQUAD acolors[256]
Definition: rw_dib.c:68
swwstate_t::lpddpPalette
LPDIRECTDRAWPALETTE lpddpPalette
Definition: rw_win.h:47
d_8to24table
unsigned d_8to24table[256]
Definition: r_main.c:27
sw_allow_modex
cvar_t * sw_allow_modex
Definition: r_main.c:113
swwstate_t::hpalOld
HPALETTE hpalOld
Definition: rw_win.h:38
swwstate_t::hdcDIBSection
HDC hdcDIBSection
Definition: rw_win.h:33
dibinfo
Definition: rw_dib.c:65
swwstate_t::lpDirectDraw
LPDIRECTDRAW lpDirectDraw
Definition: rw_win.h:42
sww_state
swwstate_t sww_state
Definition: rw_imp.c:38
swwstate_t::hWnd
HWND hWnd
Definition: rw_win.h:31
swwstate_t::hDC
HDC hDC
Definition: rw_win.h:30
swstate_s::currentpalette
byte currentpalette[1024]
Definition: r_local.h:823
sw_state
swstate_t sw_state
Definition: r_main.c:43
s_systemcolors_saved
static qboolean s_systemcolors_saved
Definition: rw_dib.c:33
HRESULT
HRESULT(WINAPI *pDirectSoundCreate)(GUID FAR *lpGUID
pUnkOuter
LPDIRECTSOUND FAR IUnknown FAR * pUnkOuter
Definition: snd_win.c:28
swwstate_t::lpddsBackBuffer
LPDIRECTDRAWSURFACE lpddsBackBuffer
Definition: rw_win.h:45
sw_mode
static cvar_t * sw_mode
Definition: vid_menu.c:40
swwstate_t::hDIBSection
HBITMAP hDIBSection
Definition: rw_win.h:34
vid
viddef_t vid
Definition: r_main.c:24