vkQuake2 doxygen  1.0 dev
rw_ddraw.c File Reference
#include <float.h>
#include "..\ref_soft\r_local.h"
#include "rw_win.h"

Go to the source code of this file.

Macros

#define INITGUID
 

Functions

static const char * DDrawError (int code)
 
qboolean DDRAW_Init (unsigned char **ppbuffer, int *ppitch)
 
void DDRAW_SetPalette (const unsigned char *pal)
 
void DDRAW_Shutdown (void)
 

Macro Definition Documentation

◆ INITGUID

#define INITGUID

Definition at line 32 of file rw_ddraw.c.

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 }

◆ DDRAW_SetPalette()

void DDRAW_SetPalette ( const unsigned char *  pal)

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().

◆ 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().

◆ DDrawError()

static const char * DDrawError ( int  code)
static

Definition at line 367 of file rw_ddraw.c.

368 {
369  switch(code) {
370  case DD_OK:
371  return "DD_OK";
372  case DDERR_ALREADYINITIALIZED:
373  return "DDERR_ALREADYINITIALIZED";
374  case DDERR_BLTFASTCANTCLIP:
375  return "DDERR_BLTFASTCANTCLIP";
376  case DDERR_CANNOTATTACHSURFACE:
377  return "DDER_CANNOTATTACHSURFACE";
378  case DDERR_CANNOTDETACHSURFACE:
379  return "DDERR_CANNOTDETACHSURFACE";
380  case DDERR_CANTCREATEDC:
381  return "DDERR_CANTCREATEDC";
382  case DDERR_CANTDUPLICATE:
383  return "DDER_CANTDUPLICATE";
384  case DDERR_CLIPPERISUSINGHWND:
385  return "DDER_CLIPPERUSINGHWND";
386  case DDERR_COLORKEYNOTSET:
387  return "DDERR_COLORKEYNOTSET";
388  case DDERR_CURRENTLYNOTAVAIL:
389  return "DDERR_CURRENTLYNOTAVAIL";
390  case DDERR_DIRECTDRAWALREADYCREATED:
391  return "DDERR_DIRECTDRAWALREADYCREATED";
392  case DDERR_EXCEPTION:
393  return "DDERR_EXCEPTION";
394  case DDERR_EXCLUSIVEMODEALREADYSET:
395  return "DDERR_EXCLUSIVEMODEALREADYSET";
396  case DDERR_GENERIC:
397  return "DDERR_GENERIC";
398  case DDERR_HEIGHTALIGN:
399  return "DDERR_HEIGHTALIGN";
400  case DDERR_HWNDALREADYSET:
401  return "DDERR_HWNDALREADYSET";
402  case DDERR_HWNDSUBCLASSED:
403  return "DDERR_HWNDSUBCLASSED";
404  case DDERR_IMPLICITLYCREATED:
405  return "DDERR_IMPLICITLYCREATED";
406  case DDERR_INCOMPATIBLEPRIMARY:
407  return "DDERR_INCOMPATIBLEPRIMARY";
408  case DDERR_INVALIDCAPS:
409  return "DDERR_INVALIDCAPS";
410  case DDERR_INVALIDCLIPLIST:
411  return "DDERR_INVALIDCLIPLIST";
412  case DDERR_INVALIDDIRECTDRAWGUID:
413  return "DDERR_INVALIDDIRECTDRAWGUID";
414  case DDERR_INVALIDMODE:
415  return "DDERR_INVALIDMODE";
416  case DDERR_INVALIDOBJECT:
417  return "DDERR_INVALIDOBJECT";
418  case DDERR_INVALIDPARAMS:
419  return "DDERR_INVALIDPARAMS";
420  case DDERR_INVALIDPIXELFORMAT:
421  return "DDERR_INVALIDPIXELFORMAT";
422  case DDERR_INVALIDPOSITION:
423  return "DDERR_INVALIDPOSITION";
424  case DDERR_INVALIDRECT:
425  return "DDERR_INVALIDRECT";
426  case DDERR_LOCKEDSURFACES:
427  return "DDERR_LOCKEDSURFACES";
428  case DDERR_NO3D:
429  return "DDERR_NO3D";
430  case DDERR_NOALPHAHW:
431  return "DDERR_NOALPHAHW";
432  case DDERR_NOBLTHW:
433  return "DDERR_NOBLTHW";
434  case DDERR_NOCLIPLIST:
435  return "DDERR_NOCLIPLIST";
436  case DDERR_NOCLIPPERATTACHED:
437  return "DDERR_NOCLIPPERATTACHED";
438  case DDERR_NOCOLORCONVHW:
439  return "DDERR_NOCOLORCONVHW";
440  case DDERR_NOCOLORKEY:
441  return "DDERR_NOCOLORKEY";
442  case DDERR_NOCOLORKEYHW:
443  return "DDERR_NOCOLORKEYHW";
444  case DDERR_NOCOOPERATIVELEVELSET:
445  return "DDERR_NOCOOPERATIVELEVELSET";
446  case DDERR_NODC:
447  return "DDERR_NODC";
448  case DDERR_NODDROPSHW:
449  return "DDERR_NODDROPSHW";
450  case DDERR_NODIRECTDRAWHW:
451  return "DDERR_NODIRECTDRAWHW";
452  case DDERR_NOEMULATION:
453  return "DDERR_NOEMULATION";
454  case DDERR_NOEXCLUSIVEMODE:
455  return "DDERR_NOEXCLUSIVEMODE";
456  case DDERR_NOFLIPHW:
457  return "DDERR_NOFLIPHW";
458  case DDERR_NOGDI:
459  return "DDERR_NOGDI";
460  case DDERR_NOHWND:
461  return "DDERR_NOHWND";
462  case DDERR_NOMIRRORHW:
463  return "DDERR_NOMIRRORHW";
464  case DDERR_NOOVERLAYDEST:
465  return "DDERR_NOOVERLAYDEST";
466  case DDERR_NOOVERLAYHW:
467  return "DDERR_NOOVERLAYHW";
468  case DDERR_NOPALETTEATTACHED:
469  return "DDERR_NOPALETTEATTACHED";
470  case DDERR_NOPALETTEHW:
471  return "DDERR_NOPALETTEHW";
472  case DDERR_NORASTEROPHW:
473  return "Operation could not be carried out because there is no appropriate raster op hardware present or available.\0";
474  case DDERR_NOROTATIONHW:
475  return "Operation could not be carried out because there is no rotation hardware present or available.\0";
476  case DDERR_NOSTRETCHHW:
477  return "Operation could not be carried out because there is no hardware support for stretching.\0";
478  case DDERR_NOT4BITCOLOR:
479  return "DirectDrawSurface is not in 4 bit color palette and the requested operation requires 4 bit color palette.\0";
480  case DDERR_NOT4BITCOLORINDEX:
481  return "DirectDrawSurface is not in 4 bit color index palette and the requested operation requires 4 bit color index palette.\0";
482  case DDERR_NOT8BITCOLOR:
483  return "DDERR_NOT8BITCOLOR";
484  case DDERR_NOTAOVERLAYSURFACE:
485  return "Returned when an overlay member is called for a non-overlay surface.\0";
486  case DDERR_NOTEXTUREHW:
487  return "Operation could not be carried out because there is no texture mapping hardware present or available.\0";
488  case DDERR_NOTFLIPPABLE:
489  return "DDERR_NOTFLIPPABLE";
490  case DDERR_NOTFOUND:
491  return "DDERR_NOTFOUND";
492  case DDERR_NOTLOCKED:
493  return "DDERR_NOTLOCKED";
494  case DDERR_NOTPALETTIZED:
495  return "DDERR_NOTPALETTIZED";
496  case DDERR_NOVSYNCHW:
497  return "DDERR_NOVSYNCHW";
498  case DDERR_NOZBUFFERHW:
499  return "Operation could not be carried out because there is no hardware support for zbuffer blitting.\0";
500  case DDERR_NOZOVERLAYHW:
501  return "Overlay surfaces could not be z layered based on their BltOrder because the hardware does not support z layering of overlays.\0";
502  case DDERR_OUTOFCAPS:
503  return "The hardware needed for the requested operation has already been allocated.\0";
504  case DDERR_OUTOFMEMORY:
505  return "DDERR_OUTOFMEMORY";
506  case DDERR_OUTOFVIDEOMEMORY:
507  return "DDERR_OUTOFVIDEOMEMORY";
508  case DDERR_OVERLAYCANTCLIP:
509  return "The hardware does not support clipped overlays.\0";
510  case DDERR_OVERLAYCOLORKEYONLYONEACTIVE:
511  return "Can only have ony color key active at one time for overlays.\0";
512  case DDERR_OVERLAYNOTVISIBLE:
513  return "Returned when GetOverlayPosition is called on a hidden overlay.\0";
514  case DDERR_PALETTEBUSY:
515  return "DDERR_PALETTEBUSY";
516  case DDERR_PRIMARYSURFACEALREADYEXISTS:
517  return "DDERR_PRIMARYSURFACEALREADYEXISTS";
518  case DDERR_REGIONTOOSMALL:
519  return "Region passed to Clipper::GetClipList is too small.\0";
520  case DDERR_SURFACEALREADYATTACHED:
521  return "DDERR_SURFACEALREADYATTACHED";
522  case DDERR_SURFACEALREADYDEPENDENT:
523  return "DDERR_SURFACEALREADYDEPENDENT";
524  case DDERR_SURFACEBUSY:
525  return "DDERR_SURFACEBUSY";
526  case DDERR_SURFACEISOBSCURED:
527  return "Access to surface refused because the surface is obscured.\0";
528  case DDERR_SURFACELOST:
529  return "DDERR_SURFACELOST";
530  case DDERR_SURFACENOTATTACHED:
531  return "DDERR_SURFACENOTATTACHED";
532  case DDERR_TOOBIGHEIGHT:
533  return "Height requested by DirectDraw is too large.\0";
534  case DDERR_TOOBIGSIZE:
535  return "Size requested by DirectDraw is too large, but the individual height and width are OK.\0";
536  case DDERR_TOOBIGWIDTH:
537  return "Width requested by DirectDraw is too large.\0";
538  case DDERR_UNSUPPORTED:
539  return "DDERR_UNSUPPORTED";
540  case DDERR_UNSUPPORTEDFORMAT:
541  return "FOURCC format requested is unsupported by DirectDraw.\0";
542  case DDERR_UNSUPPORTEDMASK:
543  return "Bitmask in the pixel format requested is unsupported by DirectDraw.\0";
544  case DDERR_VERTICALBLANKINPROGRESS:
545  return "Vertical blank is in progress.\0";
546  case DDERR_WASSTILLDRAWING:
547  return "DDERR_WASSTILLDRAWING";
548  case DDERR_WRONGMODE:
549  return "This surface can not be restored because it was created in a different mode.\0";
550  case DDERR_XALIGN:
551  return "Rectangle provided was not horizontally aligned on required boundary.\0";
552  default:
553  return "UNKNOWN\0";
554  }
555 }

Referenced by DDRAW_Init().

DDrawError
static const char * DDrawError(int code)
Definition: rw_ddraw.c:367
viddef_t::buffer
pixel_t * buffer
Definition: r_local.h:94
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
i
int i
Definition: q_shared.c:305
swwstate_t::lpddsOffScreenBuffer
LPDIRECTDRAWSURFACE lpddsOffScreenBuffer
Definition: rw_win.h:46
cvar_s
Definition: q_shared.h:324
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:202
PRINT_ALL
#define PRINT_ALL
Definition: qcommon.h:751
swwstate_t::palettized
qboolean palettized
Definition: rw_win.h:49
viddef_t::width
unsigned width
Definition: vid.h:29
DDRAW_SetPalette
void DDRAW_SetPalette(const unsigned char *pal)
Definition: rw_ddraw.c:288
viddef_t::height
unsigned height
Definition: vid.h:29
cvar_s::value
float value
Definition: q_shared.h:331
swwstate_t::modex
qboolean modex
Definition: rw_win.h:50
NULL
#define NULL
Definition: q_shared.h:67
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:119
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
swstate_s::currentpalette
byte currentpalette[1024]
Definition: r_local.h:884
sw_state
swstate_t sw_state
Definition: r_main.c:49
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:52
vid
viddef_t vid
Definition: r_main.c:24