📄 ddrawp.h
字号:
/*==========================================================================;
*
* Copyright (C) 1994-2000 Microsoft Corporation. All Rights Reserved.
*
* File: ddraw.h
* Content: DirectDraw include file
*@@BEGIN_MSINTERNAL
* History:
* Date By Reason
* ==== == ======
* 24-dec-94 craige initial implementation
* 13-jan-95 craige updated
* 31-jan-95 craige and even more ongoing work...
* 01-mar-95 craige flags with Get/SetExclusiveMode
* 07-mar-95 craige FourCC code stuff
* 08-mar-95 craige blt/overlay stretch distinction, bunch of new APIs
* 11-mar-95 craige palette stuff
* 17-mar-95 craige COM interface
* 20-mar-95 craige Get/SetExclusiveMode->Get/SetExclusiveModeOwner,
* flags with CreateSurface and DuplicateSurface
* 28-mar-95 craige removed Get/SetColorKey, added FlipToGDISurface to
* IDirectDraw; switched to PALETTEENTRY from RGBQUAD
* 01-apr-95 craige happy fun joy updated header file THANK YOU ERIC
* 06-apr-95 craige added dwVidMemTotal, dwVidMemFree to DDCAPS
* 13-apr-95 craige EricEng's little contribution to our being late
* 15-apr-95 craige GetBltStatus, added flag to GetFlipStatus
* 12-may-95 craige added GUIDS;DirectDrawEnumerate
* 19-may-95 craige added DDSEMO_ALLOWREBOOT
* 23-may-95 craige have driver GetCaps return HEL caps; added Flush,
* GetBatchLimit, SetBatchLimit to IDirectDraw
* 24-may-95 kylej removed obsolete ZOrder variables
* 24-may-95 craige added Restore
* 28-may-95 craige added DDCAPS_COLORKEY_HWASSIST; Unicode support
* 04-jun-95 craige added IsLost
* 05-jun-95 craige removed GetVersion, FreeAllSurfaces, DefWindowProc;
* change GarbageCollect to Compact
* 06-jun-95 craige removed GetExclusiveModeOwner; added parm to
* SetExclusiveMode
* 15-jun-95 craige new surface interfaces: IDirectDrawSurfaceNotification,
* IDirectDrawSurfaceComposition
* 19-jun-95 craige rationalized INVALIDxxx to DDERR_INVALIDOBJECT
* 20-jun-95 kylej added DDERR_CANNOTDETACHSURFACE
* 21-jun-95 craige added DirectDrawClipper object; removed clipping
* info from surface object
* 24-jun-95 craige added DDBLTFAST_xxx flags
* 27-jun-95 craige removed Flush,Set/GetBatchLimit; added BltBatch
* 30-jun-95 kylej added DDERR_INCOMPATIBLEPRIMARY
* 30-jun-95 craige added dest align as well as src
* 01-jul-95 craige hide composition & streaming stuff; added DDERR_EXCEPTION
* 02-jul-95 craige hide clipper notification stuff; futzed with DDSCAPS
* position in structures
* 03-jul-95 kylej changed EnumSurfaces declaration
* 03-jul-95 craige added pUnkOuter to all Create fns; added object ptr
* to CreateSurface, removed lpClipList and lpDDSurface
* from surface desc.
* 05-jul-95 craige added Initialize members to all interfaces to allow
* for full COM integration
* 09-jul-95 craige added DDERR_LOCKEDSURFACES; changed SetExclusiveMode
* to SetCooperativeLevel
* 10-jul-95 kylej added mirroring caps and overlay FX flags
* 12-jul-95 craige added DDSCAPS_OWNDC
* 13-jul-95 craige changed Get/SetOverlayPosition to take LONGs
* 14-jul-95 craige added dwFlags to DDOVERLAYFX
* 15-jul-95 craige set DDCAPS_NOHARDWARE
* 15-jul-95 ericeng changed EnumSurface callback param order, BltBatch
* params, moved all Const var references to a consistent
* location, removed failure mode for height alignment
* 18-jul-95 craige removed Flush from surface object
* 27-jul-95 craige added DDCAPS_BLTCOLORFILL
* 31-jul-95 craige added DDCAPS_BANKSWITCHED, validation flags
* 02-aug-95 craige added dwMinOverlayStretch/dwMaxOverlayStretch to DDCAPS
* 10-aug-95 toddla added DDBLT_WAIT, DDBLTFAST_WAIT, DDLOCK_WAIT, DDFLIP_WAIT
* 13-aug-95 craige added dwCaps2 and reserved fields to DDCAPS; added
* DDCAPS2_CERTIFIED; named alpha caps properly;
* flags parm for Flip
* 13-aug-95 toddla added DDSCL_DONTHOOKHWND
* 19-aug-95 ericeng added DDCAPS2_LIVEVIDEO and DDCAPS2_HWCODEC
* 21-aug-95 craige mode X support
* 27-aug-95 craige bug 742: added DDPCAPS_256
* bug 738: use GUID instead of IID
* 22-sep-95 craige bug 1268,1269: getbltstatus/getflipstatus flags wrong
* 09-nov-95 colinmc added support for 1, 2 and 4 bit RGB and indexed
* palettes
* 27-nov-95 colinmc new member to return available vram of a given type
* (determined by DDSCAPS).
* 05-dec-95 colinmc changed DDSCAPS_TEXTUREMAP => DDSCAPS_TEXTURE for
* consistency with Direct3D
* 05-dec-95 colinmc added mip-map support
* 09-dec-95 colinmc added execute buffer support
* 13-dec-95 colinmc added shared back and z-buffer support
* 18-dec-95 colinmc added valid caps mask for surface caps
* 25-dec-95 craige changed IDirectDrawV2 to IDirectDraw2
* 31-dec-95 craige added CLSID_DirectDraw
* 04-jan-96 colinmc added explicit support for z-buffer clears
* 12-feb-96 kylej added Interface
* 23-feb-96 kylej added IDirectDrawSurface2 Interface
* 01-mar-96 kylej new ddcaps structure
* 06-mar-96 kylej changed HANDLEs to DWORDs
* 13-mar-96 kylej added DD_Surface_GetDDInterface in IDirectDrawSurface2
* 14-mar-96 colinmc added CLSID_DirectDrawClipper and added the clipper
* creation API function back in
* 21-mar-96 colinmc Bug 13316: Unitialized interfaces
* 24-mar-96 colinmc Bug 14321: Structure change to allow flippable mip
* map chains with a single call
* 26-mar-96 colinmc Bug 14470: Compressed surface support
* 15-apr-96 colinmc Bug 16855: Can't pass NULL to Initialize in C++
* 19-apr-96 colinmc Bug 18059: News caps bit to flag that you can't do
* 2D during 3D.
* 01-may-96 colinmc Bug 20005: InternalLock does not check for lost
* surfaces
* 25-jul-96 scottm Added DDCAPS2_AUTOFLIPOVERLAY,
* DDCAPS2_CANSMOOTHINTERLEAVED,DDCAPS2_CANSMOOTHNONINTERLEAVED
* 08-oct-96 ketand Added support for Interleaved Z (aka RGBZ surfaces)
* 15-nov-96 colinmc Finally retired DDSCAPS_3D and moved
* DDSCAPS_EXECUTEBUFFER to ddrawi.h so DDK users can
* see it.
* 08-dec-96 colinmc Initial AGP support
* 13-jan-97 jvanaken Basic support for IDirectDrawSurface3 interface
* 12-jan-97 colinmc More Win16 lock work
* 29-jan-97 smac Updated color control structure
* 29-jan-97 jeffno Mode13 support. New surface cap and enum/setmode flags
* 03-mar-97 jeffno Work item: Extended surface memory alignment
* 08-mar-97 colinmc Support for DMA model AGP cards
* 11-mar-97 smac Obsoleted dwMin/MaxLiveVideoStretch and dwMin/MaxHwCodecStretch fields
* 11-mar-97 jeffno Don't allow blts between surfaces from different ddraw gbls
* 22-mar-97 colinmc Bug 6673: Mechanism to let new applications run against
* old runtimes
* 23-mar-97 colinmc Bug 6673: Changed structure numbering scheme for
* consistency's sake
* 24-mar-97 jeffno Optimized Surfaces
* 16-sep-97 jeffno DirectDrawEnumerateEx
* 30-sep-97 jeffno IDirectDraw4
* 03-oct-97 jeffno DDSCAPS2 and DDSURFACEDESC2
* 31-oct-97 johnstep Persistent-content surfaces for Windows 9x
* 05-nov-97 jvanaken Support for AlphaBlt and SetSpriteDisplayList
* 07-nov-97 raymondc Borland compatibility
* 24-nov-97 t-craigs Added IDirectDrawPalette2
* 19-dec-97 jvanaken IDDS4::Unlock now takes a pointer to a rectangle.
*@@END_MSINTERNAL
*
***************************************************************************/
#ifndef __DDRAW_INCLUDED__
#define __DDRAW_INCLUDED__
/*
* If you wish an application built against the newest version of DirectDraw
* to run against an older DirectDraw run time then define DIRECTDRAW_VERSION
* to be the earlies version of DirectDraw you wish to run against. For,
* example if you wish an application to run against a DX 3 runtime define
* DIRECTDRAW_VERSION to be 0x0300.
*/
#ifndef DIRECTDRAW_VERSION
#define DIRECTDRAW_VERSION 0x0600
#endif /* DIRECTDRAW_VERSION */
#if defined( _WIN32 ) && !defined( _NO_COM )
#define COM_NO_WINDOWS_H
#include <objbase.h>
#else
#define IUnknown void
#if !defined( NT_BUILD_ENVIRONMENT ) && !defined(WINNT)
#define CO_E_NOTINITIALIZED 0x800401F0L
#endif
#endif
#define _FACDD 0x876
#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code )
#ifdef __cplusplus
extern "C" {
#endif
//
// For compilers that don't support nameless unions, do a
//
// #define NONAMELESSUNION
//
// before #include <ddraw.h>
//
#ifndef DUMMYUNIONNAMEN
#if defined(__cplusplus) || !defined(NONAMELESSUNION)
#define DUMMYUNIONNAMEN(n)
#else
#define DUMMYUNIONNAMEN(n) u##n
#endif
#endif
#ifndef MAKEFOURCC
#define MAKEFOURCC(ch0, ch1, ch2, ch3) \
((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \
((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
#endif //defined(MAKEFOURCC)
/*
* FOURCC codes for DX compressed-texture pixel formats
*/
#define FOURCC_DXT1 (MAKEFOURCC('D','X','T','1'))
#define FOURCC_DXT2 (MAKEFOURCC('D','X','T','2'))
#define FOURCC_DXT3 (MAKEFOURCC('D','X','T','3'))
#define FOURCC_DXT4 (MAKEFOURCC('D','X','T','4'))
#define FOURCC_DXT5 (MAKEFOURCC('D','X','T','5'))
/*
* GUIDS used by DirectDraw objects
*/
#if defined( _WIN32 ) && !defined( _NO_COM )
DEFINE_GUID( CLSID_DirectDraw, 0xD7B70EE0,0x4340,0x11CF,0xB0,0x63,0x00,0x20,0xAF,0xC2,0xCD,0x35 );
DEFINE_GUID( CLSID_DirectDrawClipper, 0x593817A0,0x7DB3,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xb9,0x33,0x56 );
DEFINE_GUID( IID_IDirectDraw, 0x6C14DB80,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
DEFINE_GUID( IID_IDirectDraw2, 0xB3A6F3E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56 );
DEFINE_GUID( IID_IDirectDraw4, 0x9c59509a,0x39bd,0x11d1,0x8c,0x4a,0x00,0xc0,0x4f,0xd9,0x30,0xc5 );
DEFINE_GUID( IID_IDirectDrawSurface, 0x6C14DB81,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
DEFINE_GUID( IID_IDirectDrawSurface2, 0x57805885,0x6eec,0x11cf,0x94,0x41,0xa8,0x23,0x03,0xc1,0x0e,0x27 );
DEFINE_GUID( IID_IDirectDrawSurface3, 0xDA044E00,0x69B2,0x11D0,0xA1,0xD5,0x00,0xAA,0x00,0xB8,0xDF,0xBB );
DEFINE_GUID( IID_IDirectDrawSurface4, 0x0B2B8630,0xAD35,0x11D0,0x8E,0xA6,0x00,0x60,0x97,0x97,0xEA,0x5B );
DEFINE_GUID( IID_IDirectDrawSurface5, 0xb0e83e4,0xf37f,0x11d2,0x8b,0x15,0x0,0xc0,0x4f,0x68,0x92,0x92);
//@@BEGIN_MSINTERNAL
DEFINE_GUID( CLSID_DirectDrawFactory2, 0xb9dc4790,0x4af1,0x11d1,0x8c,0x4c,0x00,0xc0,0x4f,0xd9,0x30,0xc5 );
DEFINE_GUID( IID_IDirectDrawFactory2, 0x89b2c488,0x4af4,0x11d1,0x8c,0x4c,0x00,0xc0,0x4f,0xd9,0x30,0xc5 );
DEFINE_GUID( GUID_DirectDrawSurfaceStream, 0xe043bc46,0x5317,0x11d1,0x8c,0x4d,0x00,0xc0,0x4f,0xd9,0x30,0xc5 );
DEFINE_GUID( GUID_DirectDrawPaletteStream, 0x730c7ffc,0x5347,0x11d1,0x8c,0x4d,0x00,0xc0,0x4f,0xd9,0x30,0xc5 );
DEFINE_GUID(IID_IDirectDrawOptSurface, 0x51191f1e, 0x4f2b, 0x11d1, 0x8c, 0xc3, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8);
DEFINE_GUID( IID_IDirectDrawPalette2, 0xc03c477e,0x6519,0x11d1,0x8c,0x52,0x00,0xc0,0x4f,0xd9,0x30,0xc5 );
//@@END_MSINTERNAL
//@@BEGIN_MSINTERNAL
#ifdef STREAMING
DEFINE_GUID( IID_IDirectDrawSurfaceStreaming, 0x6C14DB82,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
#endif
#ifdef COMPOSITION
DEFINE_GUID( IID_IDirectDrawSurfaceComposition, 0x6C14DB83,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
#endif
//@@END_MSINTERNAL
DEFINE_GUID( IID_IDirectDrawPalette, 0x6C14DB84,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
DEFINE_GUID( IID_IDirectDrawClipper, 0x6C14DB85,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
DEFINE_GUID( IID_IDirectDrawColorControl, 0x4B9F0EE0,0x0D7E,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8 );
DEFINE_GUID( IID_IDirectDrawGammaControl, 0x69C11C3E,0xB46B,0x11D1,0xAD,0x7A,0x00,0xC0,0x4F,0xC2,0x9B,0x4E );
#endif
/*============================================================================
*
* DirectDraw Structures
*
* Various structures used to invoke DirectDraw.
*
*==========================================================================*/
struct IDirectDraw;
struct IDirectDrawSurface;
//@@BEGIN_MSINTERNAL
#ifdef COMPOSITION
struct IDirectDrawSurfaceComposition;
#endif
#ifdef STREAMING
struct IDirectDrawSurfaceStreaming;
#endif
//@@END_MSINTERNAL
struct IDirectDrawPalette;
struct IDirectDrawClipper;
typedef struct IDirectDraw FAR *LPDIRECTDRAW;
typedef struct IDirectDraw2 FAR *LPDIRECTDRAW2;
typedef struct IDirectDraw4 FAR *LPDIRECTDRAW4;
typedef struct IDirectDrawSurface FAR *LPDIRECTDRAWSURFACE;
typedef struct IDirectDrawSurface2 FAR *LPDIRECTDRAWSURFACE2;
typedef struct IDirectDrawSurface3 FAR *LPDIRECTDRAWSURFACE3;
typedef struct IDirectDrawSurface4 FAR *LPDIRECTDRAWSURFACE4;
typedef struct IDirectDrawSurface5 FAR *LPDIRECTDRAWSURFACE5;
//@@BEGIN_MSINTERNAL
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -