1 #ifndef __DDRAWEXH__ 2 #define __DDRAWEXH__ 3 4 #ifdef __cplusplus 5 extern "C" { 6 #endif 7 8 #include <ddraw.h> 9 DEFINE_GUID(CLSID_DirectDrawFactory, 0x4FD2A832, 0x86C8, 0x11D0, 0x8F, 0xCA, 0x00, 0xC0, 0x4F, 0xD9, 0x18, 0x9D); 10 DEFINE_GUID(IID_IDirectDrawFactory, 0x4FD2A833, 0x86C8, 0x11D0, 0x8F, 0xCA, 0x00, 0xC0, 0x4F, 0xD9, 0x18, 0x9D); 11 DEFINE_GUID(IID_IDirectDraw3, 0x618F8AD4, 0x8B7A, 0x11D0, 0x8F, 0xCC, 0x00, 0xC0, 0x4F, 0xD9, 0x18, 0x9D); 12 13 #define DDSCAPS_DATAEXCHANGE (DDSCAPS_SYSTEMMEMORY|DDSCAPS_VIDEOMEMORY) 14 #define DDERR_LOADFAILED MAKE_DDHRESULT( 901 ) 15 #define DDERR_BADVERSIONINFO MAKE_DDHRESULT( 902 ) 16 #define DDERR_BADPROCADDRESS MAKE_DDHRESULT( 903 ) 17 #define DDERR_LEGACYUSAGE MAKE_DDHRESULT( 904 ) 18 19 typedef struct IDirectDraw3 *LPDIRECTDRAW3; 20 21 #ifndef DIRECTDRAW_VERSION 22 #define DDSD_LPSURFACE 0x00000800 23 24 DEFINE_GUID( IID_IDirectDrawSurface3, 0xDA044E00,0x69B2,0x11D0,0xA1,0xD5,0x00,0xAA,0x00,0xB8,0xDF,0xBB ); 25 typedef struct IDirectDrawSurface3 *LPDIRECTDRAWSURFACE3; 26 #if defined( _WIN32 ) && !defined( _NO_COM ) 27 #undef INTERFACE 28 #define INTERFACE IDirectDrawSurface3 29 DECLARE_INTERFACE_( IDirectDrawSurface3, IUnknown ) 30 { 31 STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; 32 STDMETHOD_(ULONG,AddRef) (THIS) PURE; 33 STDMETHOD_(ULONG,Release) (THIS) PURE; 34 STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE3) PURE; 35 STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE; 36 STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE3, LPRECT,DWORD, LPDDBLTFX) PURE; 37 STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE; 38 STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE3, LPRECT,DWORD) PURE; 39 STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE3) PURE; 40 STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK) PURE; 41 STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK) PURE; 42 STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE3, DWORD) PURE; 43 STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS, LPDIRECTDRAWSURFACE3*) PURE; 44 STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE; 45 STDMETHOD(GetCaps)(THIS_ LPDDSCAPS) PURE; 46 STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER *) PURE; 47 STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; 48 STDMETHOD(GetDC)(THIS_ HDC *) PURE; 49 STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE; 50 STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE; 51 STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE *) PURE; 52 STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE; 53 STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC) PURE; 54 STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC) PURE; 55 STDMETHOD(IsLost)(THIS) PURE; 56 STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC,DWORD,HANDLE) PURE; 57 STDMETHOD(ReleaseDC)(THIS_ HDC) PURE; 58 STDMETHOD(Restore)(THIS) PURE; 59 STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE; 60 STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; 61 STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE; 62 STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE; 63 STDMETHOD(Unlock)(THIS_ LPVOID) PURE; 64 STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE3,LPRECT,DWORD, LPDDOVERLAYFX) PURE; 65 STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE; 66 STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE3) PURE; 67 STDMETHOD(GetDDInterface)(THIS_ LPVOID *) PURE; 68 STDMETHOD(PageLock)(THIS_ DWORD) PURE; 69 STDMETHOD(PageUnlock)(THIS_ DWORD) PURE; 70 STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC, DWORD ) PURE; 71 }; 72 #endif 73 #endif 74 75 #if defined( _WIN32 ) && !defined( _NO_COM ) 76 #undef INTERFACE 77 #define INTERFACE IDirectDrawFactory 78 79 DECLARE_INTERFACE_(IDirectDrawFactory, IUnknown) 80 { 81 STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; 82 STDMETHOD_(ULONG,AddRef) (THIS) PURE; 83 STDMETHOD_(ULONG,Release) (THIS) PURE; 84 STDMETHOD(CreateDirectDraw) (THIS_ GUID * pGUID, HWND hWnd, DWORD dwCoopLevelFlags, DWORD dwReserved, IUnknown *pUnkOuter, IDirectDraw **ppDirectDraw) PURE; 85 STDMETHOD(DirectDrawEnumerate) (THIS_ LPDDENUMCALLBACK lpCallback, LPVOID lpContext) PURE; 86 }; 87 #endif 88 89 #if defined( _WIN32 ) && !defined( _NO_COM ) 90 #undef INTERFACE 91 #define INTERFACE IDirectDraw3 92 DECLARE_INTERFACE_(IDirectDraw3,IUnknown) 93 { 94 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; 95 STDMETHOD_(ULONG,AddRef)(THIS) PURE; 96 STDMETHOD_(ULONG,Release)(THIS) PURE; 97 STDMETHOD(Compact)(THIS) PURE; 98 STDMETHOD(CreateClipper)(THIS_ DWORD dwFlags, LPDIRECTDRAWCLIPPER *lplpDDClipper, IUnknown *pUnkOuter) PURE; 99 STDMETHOD(CreatePalette)(THIS_ DWORD dwFlags, LPPALETTEENTRY lpColorTable, LPDIRECTDRAWPALETTE *lplpDDPalette, IUnknown *pUnkOuter) PURE; 100 STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc, LPDIRECTDRAWSURFACE *lplpDDSurface, IUnknown *pUnkOuter) PURE; 101 STDMETHOD(DuplicateSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDSurface, LPDIRECTDRAWSURFACE *lplpDupDDSurface) PURE; 102 STDMETHOD(EnumDisplayModes)(THIS_ DWORD dwFlags, LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID lpContext, LPDDENUMMODESCALLBACK lpEnumModesCallback) PURE; 103 STDMETHOD(EnumSurfaces)(THIS_ DWORD dwFlags, LPDDSURFACEDESC lpDDSD, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback) PURE; 104 STDMETHOD(FlipToGDISurface)(THIS) PURE; 105 STDMETHOD(GetCaps)(THIS_ LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDHELCaps) PURE; 106 STDMETHOD(GetDisplayMode)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc) PURE; 107 STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD lpNumCodes, LPDWORD lpCodes) PURE; 108 STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE *lplpGDIDDSurface) PURE; 109 STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD lpdwFrequency) PURE; 110 STDMETHOD(GetScanLine)(THIS_ LPDWORD lpdwScanLine) PURE; 111 STDMETHOD(GetVerticalBlankStatus)(THIS_ BOOL *lpbIsInVB) PURE; 112 STDMETHOD(Initialize)(THIS_ GUID *lpGUID) PURE; 113 STDMETHOD(RestoreDisplayMode)(THIS) PURE; 114 STDMETHOD(SetCooperativeLevel)(THIS_ HWND hWnd, DWORD dwFlags) PURE; 115 STDMETHOD(SetDisplayMode)(THIS_ DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags) PURE; 116 STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD dwFlags, HANDLE hEvent) PURE; 117 STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS lpDDCaps, LPDWORD lpdwTotal, LPDWORD lpdwFree) PURE; 118 STDMETHOD(GetSurfaceFromDC)(THIS_ HDC hdc, LPDIRECTDRAWSURFACE *pSurf) PURE; 119 }; 120 #if !defined(__cplusplus) || defined(CINTERFACE) 121 #define IDirectDraw3_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) 122 #define IDirectDraw3_AddRef(p) (p)->lpVtbl->AddRef(p) 123 #define IDirectDraw3_Release(p) (p)->lpVtbl->Release(p) 124 #define IDirectDraw3_Compact(p) (p)->lpVtbl->Compact(p) 125 #define IDirectDraw3_CreateClipper(p,a,b,c) (p)->lpVtbl->CreateClipper(p,a,b,c) 126 #define IDirectDraw3_CreatePalette(p,a,b,c,d) (p)->lpVtbl->CreatePalette(p,a,b,c,d) 127 #define IDirectDraw3_CreateSurface(p,a,b,c) (p)->lpVtbl->CreateSurface(p,a,b,c) 128 #define IDirectDraw3_DuplicateSurface(p,a,b) (p)->lpVtbl->DuplicateSurface(p,a,b) 129 #define IDirectDraw3_EnumDisplayModes(p,a,b,c,d) (p)->lpVtbl->EnumDisplayModes(p,a,b,c,d) 130 #define IDirectDraw3_EnumSurfaces(p,a,b,c,d) (p)->lpVtbl->EnumSurfaces(p,a,b,c,d) 131 #define IDirectDraw3_FlipToGDISurface(p) (p)->lpVtbl->FlipToGDISurface(p) 132 #define IDirectDraw3_GetCaps(p,a,b) (p)->lpVtbl->GetCaps(p,a,b) 133 #define IDirectDraw3_GetDisplayMode(p,a) (p)->lpVtbl->GetDisplayMode(p,a) 134 #define IDirectDraw3_GetFourCCCodes(p,a,b) (p)->lpVtbl->GetFourCCCodes(p,a,b) 135 #define IDirectDraw3_GetGDISurface(p,a) (p)->lpVtbl->GetGDISurface(p,a) 136 #define IDirectDraw3_GetMonitorFrequency(p,a) (p)->lpVtbl->GetMonitorFrequency(p,a) 137 #define IDirectDraw3_GetScanLine(p,a) (p)->lpVtbl->GetScanLine(p,a) 138 #define IDirectDraw3_GetVerticalBlankStatus(p,a) (p)->lpVtbl->GetVerticalBlankStatus(p,a) 139 #define IDirectDraw3_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) 140 #define IDirectDraw3_RestoreDisplayMode(p) (p)->lpVtbl->RestoreDisplayMode(p) 141 #define IDirectDraw3_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b) 142 #define IDirectDraw3_SetDisplayMode(p,a,b,c,d,e) (p)->lpVtbl->SetDisplayMode(p,a,b,c,d,e) 143 #define IDirectDraw3_WaitForVerticalBlank(p,a,b) (p)->lpVtbl->WaitForVerticalBlank(p,a,b) 144 #define IDirectDraw3_GetAvailableVidMem(p,a,b,c) (p)->lpVtbl->GetAvailableVidMem(p,a,b,c) 145 #define IDirectDraw3_GetSurfaceFromDC(p,a,b) (p)->lpVtbl->GetSurfaceFromDC(p,a,b) 146 #else 147 #define IDirectDraw3_QueryInterface(p,a,b) (p)->QueryInterface(a,b) 148 #define IDirectDraw3_AddRef(p) (p)->AddRef() 149 #define IDirectDraw3_Release(p) (p)->Release() 150 #define IDirectDraw3_Compact(p) (p)->Compact() 151 #define IDirectDraw3_CreateClipper(p,a,b,c) (p)->CreateClipper(a,b,c) 152 #define IDirectDraw3_CreatePalette(p,a,b,c,d) (p)->CreatePalette(a,b,c,d) 153 #define IDirectDraw3_CreateSurface(p,a,b,c) (p)->CreateSurface(a,b,c) 154 #define IDirectDraw3_DuplicateSurface(p,a,b) (p)->DuplicateSurface(a,b) 155 #define IDirectDraw3_EnumDisplayModes(p,a,b,c,d) (p)->EnumDisplayModes(a,b,c,d) 156 #define IDirectDraw3_EnumSurfaces(p,a,b,c,d) (p)->EnumSurfaces(a,b,c,d) 157 #define IDirectDraw3_FlipToGDISurface(p) (p)->FlipToGDISurface() 158 #define IDirectDraw3_GetCaps(p,a,b) (p)->GetCaps(a,b) 159 #define IDirectDraw3_GetDisplayMode(p,a) (p)->GetDisplayMode(a) 160 #define IDirectDraw3_GetFourCCCodes(p,a,b) (p)->GetFourCCCodes(a,b) 161 #define IDirectDraw3_GetGDISurface(p,a) (p)->GetGDISurface(a) 162 #define IDirectDraw3_GetMonitorFrequency(p,a) (p)->GetMonitorFrequency(a) 163 #define IDirectDraw3_GetScanLine(p,a) (p)->GetScanLine(a) 164 #define IDirectDraw3_GetVerticalBlankStatus(p,a) (p)->GetVerticalBlankStatus(a) 165 #define IDirectDraw3_Initialize(p,a) (p)->Initialize(a) 166 #define IDirectDraw3_RestoreDisplayMode(p) (p)->RestoreDisplayMode() 167 #define IDirectDraw3_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b) 168 #define IDirectDraw3_SetDisplayMode(p,a,b,c,d,e) (p)->SetDisplayMode(a,b,c,d,e) 169 #define IDirectDraw3_WaitForVerticalBlank(p,a,b) (p)->WaitForVerticalBlank(a,b) 170 #define IDirectDraw3_GetAvailableVidMem(p,a,b,c) (p)->GetAvailableVidMem(a,b,c) 171 #define IDirectDraw3_GetSurfaceFromDC(p,a,b) (p)->GetSurfaceFromDC(a,b) 172 #endif 173 #endif 174 175 #ifdef __cplusplus 176 } 177 #endif 178 #endif 179