#include <float.h>
#include "..\ref_soft\r_local.h"
#include "rw_win.h"
Go to the source code of this file.
◆ INITGUID
◆ DDRAW_Init()
qboolean DDRAW_Init |
( |
unsigned char ** |
ppbuffer, |
|
|
int * |
ppitch |
|
) |
| |
Definition at line 42 of file rw_ddraw.c.
47 PALETTEENTRY palentries[256];
51 HRESULT (WINAPI *QDirectDrawCreate)( GUID FAR *lpGUID, LPDIRECTDRAW FAR * lplpDDRAW, IUnknown FAR *
pUnkOuter );
56 for (
i = 0;
i < 256;
i++ )
77 if ( ( QDirectDrawCreate = (
HRESULT (WINAPI *)( GUID FAR *, LPDIRECTDRAW FAR *, IUnknown FAR * ) ) GetProcAddress(
sww_state.
hinstDDRAW,
"DirectDrawCreate" ) ) ==
NULL )
102 DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN ) ) != DD_OK )
138 DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN | DDSCL_NOWINDOWCHANGES | DDSCL_ALLOWMODEX ) ) != DD_OK )
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;
183 if ( ddscaps.dwCaps & DDSCAPS_MODEX )
189 ddsd.ddsCaps.dwCaps = DDSCAPS_BACKBUFFER;
202 memset( &ddsd, 0,
sizeof( ddsd ) );
203 ddsd.dwSize =
sizeof( ddsd );
204 ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS;
207 ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY;
222 DDPCAPS_8BIT | DDPCAPS_ALLOW256,
246 memset( &ddsd, 0,
sizeof( ddsd ) );
247 ddsd.dwSize =
sizeof( ddsd );
257 *ppbuffer = ddsd.lpSurface;
258 *ppitch = ddsd.lPitch;
262 memset( *ppbuffer +
i * *ppitch, 0, *ppitch );
Referenced by SWimp_InitGraphics().
◆ DDRAW_SetPalette()
void DDRAW_SetPalette |
( |
const unsigned char * |
pal | ) |
|
Definition at line 288 of file rw_ddraw.c.
290 PALETTEENTRY palentries[256];
296 for (
i = 0;
i < 256;
i++, pal += 4 )
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;
308 palentries ) != DD_OK )
Referenced by DDRAW_Init(), and SWimp_SetPalette().
◆ DDRAW_Shutdown()
◆ DDrawError()
static const char * DDrawError |
( |
int |
code | ) |
|
|
static |
Definition at line 367 of file rw_ddraw.c.
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";
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";
430 case DDERR_NOALPHAHW:
431 return "DDERR_NOALPHAHW";
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";
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";
457 return "DDERR_NOFLIPHW";
459 return "DDERR_NOGDI";
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";
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";
551 return "Rectangle provided was not horizontally aligned on required boundary.\0";
Referenced by DDRAW_Init().