Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

217 lines
9.7 KiB

  1. // Header file for DirectDrawEx functionality
  2. #ifndef __DDRAWEXH__
  3. #define __DDRAWEXH__
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. #include <ddraw.h>
  8. // {4FD2A832-86C8-11d0-8FCA-00C04FD9189D}
  9. DEFINE_GUID(CLSID_DirectDrawFactory,
  10. 0x4fd2a832, 0x86c8, 0x11d0, 0x8f, 0xca, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0x9d);
  11. DEFINE_GUID(IID_IDirectDrawFactory,
  12. 0x4fd2a833, 0x86c8, 0x11d0, 0x8f, 0xca, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0x9d);
  13. #define DDSD_LPSURFACE 0x00000800l
  14. #ifndef DIRECTDRAW_VERSION
  15. //these are not included in DX3 include files, define them here
  16. //DEFINE_GUID( IID_IDirect3DRampDevice, 0xF2086B20,0x259F,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
  17. //DEFINE_GUID( IID_IDirect3DRGBDevice, 0xA4665C60,0x2673,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
  18. //DEFINE_GUID( IID_IDirect3DHALDevice, 0x84E63dE0,0x46AA,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
  19. DEFINE_GUID( IID_IDirectDrawSurface3,
  20. 0xDA044E00,0x69B2,0x11D0,0xA1,0xD5,0x00,0xAA,0x00,0xB8,0xDF,0xBB );
  21. typedef struct IDirectDrawSurface3 FAR *LPDIRECTDRAWSURFACE3;
  22. #undef INTERFACE
  23. #define INTERFACE IDirectDrawSurface3
  24. DECLARE_INTERFACE_( IDirectDrawSurface3, IUnknown )
  25. {
  26. /*** IUnknown methods ***/
  27. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
  28. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  29. STDMETHOD_(ULONG,Release) (THIS) PURE;
  30. /*** IDirectDrawSurface methods ***/
  31. STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE3) PURE;
  32. STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE;
  33. STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE3, LPRECT,DWORD, LPDDBLTFX) PURE;
  34. STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE;
  35. STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE3, LPRECT,DWORD) PURE;
  36. STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE3) PURE;
  37. STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK) PURE;
  38. STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK) PURE;
  39. STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE3, DWORD) PURE;
  40. STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS, LPDIRECTDRAWSURFACE3 FAR *) PURE;
  41. STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE;
  42. STDMETHOD(GetCaps)(THIS_ LPDDSCAPS) PURE;
  43. STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE;
  44. STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
  45. STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE;
  46. STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE;
  47. STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE;
  48. STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE;
  49. STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE;
  50. STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC) PURE;
  51. STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC) PURE;
  52. STDMETHOD(IsLost)(THIS) PURE;
  53. STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC,DWORD,HANDLE) PURE;
  54. STDMETHOD(ReleaseDC)(THIS_ HDC) PURE;
  55. STDMETHOD(Restore)(THIS) PURE;
  56. STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE;
  57. STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE;
  58. STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE;
  59. STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE;
  60. STDMETHOD(Unlock)(THIS_ LPVOID) PURE;
  61. STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE3,LPRECT,DWORD, LPDDOVERLAYFX) PURE;
  62. STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE;
  63. STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE3) PURE;
  64. /*** Added in the v2 interface ***/
  65. STDMETHOD(GetDDInterface)(THIS_ LPVOID FAR *) PURE;
  66. STDMETHOD(PageLock)(THIS_ DWORD) PURE;
  67. STDMETHOD(PageUnlock)(THIS_ DWORD) PURE;
  68. /*** Added in the v3 interface ***/
  69. STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC, DWORD ) PURE;
  70. };
  71. #endif
  72. #define DDSCAPS_DATAEXCHANGE (DDSCAPS_SYSTEMMEMORY|DDSCAPS_VIDEOMEMORY)
  73. #undef INTERFACE
  74. #define INTERFACE IDirectDrawFactory
  75. DECLARE_INTERFACE_(IDirectDrawFactory, IUnknown)
  76. {
  77. /*** IUnknown methods ***/
  78. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
  79. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  80. STDMETHOD_(ULONG,Release) (THIS) PURE;
  81. /*** IDirectDrawFactory methods ***/
  82. STDMETHOD(CreateDirectDraw) (THIS_ GUID * pGUID, HWND hWnd, DWORD dwCoopLevelFlags, DWORD dwReserved, IUnknown *pUnkOuter, IDirectDraw **ppDirectDraw) PURE;
  83. STDMETHOD(DirectDrawEnumerate) (THIS_ LPDDENUMCALLBACK lpCallback, LPVOID lpContext) PURE;
  84. };
  85. // {618F8AD4-8B7A-11d0-8FCC-00C04FD9189D}
  86. DEFINE_GUID(IID_IDirectDraw3,
  87. 0x618f8ad4, 0x8b7a, 0x11d0, 0x8f, 0xcc, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0x9d);
  88. typedef struct IDirectDraw3 FAR *LPDIRECTDRAW3;
  89. #undef INTERFACE
  90. #define INTERFACE IDirectDraw3
  91. DECLARE_INTERFACE_(IDirectDraw3, IUnknown)
  92. {
  93. /*** IUnknown methods ***/
  94. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
  95. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  96. STDMETHOD_(ULONG,Release) (THIS) PURE;
  97. /*** IDirectDraw methods ***/
  98. STDMETHOD(Compact)(THIS) PURE;
  99. STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR * ) PURE;
  100. STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR*, IUnknown FAR * ) PURE;
  101. STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC, LPDIRECTDRAWSURFACE FAR *, IUnknown FAR *) PURE;
  102. STDMETHOD(DuplicateSurface)( THIS_ LPDIRECTDRAWSURFACE, LPDIRECTDRAWSURFACE FAR * ) PURE;
  103. STDMETHOD(EnumDisplayModes)( THIS_ DWORD, LPDDSURFACEDESC, LPVOID, LPDDENUMMODESCALLBACK ) PURE;
  104. STDMETHOD(EnumSurfaces)(THIS_ DWORD, LPDDSURFACEDESC, LPVOID,LPDDENUMSURFACESCALLBACK ) PURE;
  105. STDMETHOD(FlipToGDISurface)(THIS) PURE;
  106. STDMETHOD(GetCaps)( THIS_ LPDDCAPS, LPDDCAPS) PURE;
  107. STDMETHOD(GetDisplayMode)( THIS_ LPDDSURFACEDESC) PURE;
  108. STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD, LPDWORD ) PURE;
  109. STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE FAR *) PURE;
  110. STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD) PURE;
  111. STDMETHOD(GetScanLine)(THIS_ LPDWORD) PURE;
  112. STDMETHOD(GetVerticalBlankStatus)(THIS_ LPBOOL ) PURE;
  113. STDMETHOD(Initialize)(THIS_ GUID FAR *) PURE;
  114. STDMETHOD(RestoreDisplayMode)(THIS) PURE;
  115. STDMETHOD(SetCooperativeLevel)(THIS_ HWND, DWORD) PURE;
  116. STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD,DWORD, DWORD, DWORD) PURE;
  117. STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE;
  118. /*** Added in the v2 interface ***/
  119. STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS, LPDWORD, LPDWORD) PURE;
  120. /*** IDirectDraw3 methods ***/
  121. STDMETHOD(GetSurfaceFromDC) (THIS_ HDC, IDirectDrawSurface **) PURE;
  122. };
  123. #if !defined(__cplusplus) || defined(CINTERFACE)
  124. #define IDirectDraw3_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
  125. #define IDirectDraw3_AddRef(p) (p)->lpVtbl->AddRef(p)
  126. #define IDirectDraw3_Release(p) (p)->lpVtbl->Release(p)
  127. #define IDirectDraw3_Compact(p) (p)->lpVtbl->Compact(p)
  128. #define IDirectDraw3_CreateClipper(p, a, b, c) (p)->lpVtbl->CreateClipper(p, a, b, c)
  129. #define IDirectDraw3_CreatePalette(p, a, b, c, d) (p)->lpVtbl->CreatePalette(p, a, b, c, d)
  130. #define IDirectDraw3_CreateSurface(p, a, b, c) (p)->lpVtbl->CreateSurface(p, a, b, c)
  131. #define IDirectDraw3_DuplicateSurface(p, a, b) (p)->lpVtbl->DuplicateSurface(p, a, b)
  132. #define IDirectDraw3_EnumDisplayModes(p, a, b, c, d) (p)->lpVtbl->EnumDisplayModes(p, a, b, c, d)
  133. #define IDirectDraw3_EnumSurfaces(p, a, b, c, d) (p)->lpVtbl->EnumSurfaces(p, a, b, c, d)
  134. #define IDirectDraw3_FlipToGDISurface(p) (p)->lpVtbl->FlipToGDISurface(p)
  135. #define IDirectDraw3_GetCaps(p, a, b) (p)->lpVtbl->GetCaps(p, a, b)
  136. #define IDirectDraw3_GetDisplayMode(p, a) (p)->lpVtbl->GetDisplayMode(p, a)
  137. #define IDirectDraw3_GetFourCCCodes(p, a, b) (p)->lpVtbl->GetFourCCCodes(p, a, b)
  138. #define IDirectDraw3_GetGDISurface(p, a) (p)->lpVtbl->GetGDISurface(p, a)
  139. #define IDirectDraw3_GetMonitorFrequency(p, a) (p)->lpVtbl->GetMonitorFrequency(p, a)
  140. #define IDirectDraw3_GetScanLine(p, a) (p)->lpVtbl->GetScanLine(p, a)
  141. #define IDirectDraw3_GetVerticalBlankStatus(p, a) (p)->lpVtbl->GetVerticalBlankStatus(p, a)
  142. #define IDirectDraw3_Initialize(p, a) (p)->lpVtbl->Initialize(p, a)
  143. #define IDirectDraw3_RestoreDisplayMode(p) (p)->lpVtbl->RestoreDisplayMode(p)
  144. #define IDirectDraw3_SetCooperativeLevel(p, a, b) (p)->lpVtbl->SetCooperativeLevel(p, a, b)
  145. #define IDirectDraw3_SetDisplayMode(p, a, b, c, d, e) (p)->lpVtbl->SetDisplayMode(p, a, b, c, d, e)
  146. #define IDirectDraw3_WaitForVerticalBlank(p, a, b) (p)->lpVtbl->WaitForVerticalBlank(p, a, b)
  147. #define IDirectDraw3_GetAvailableVidMem(p, a, b, c) (p)->lpVtbl->GetAvailableVidMem(p, a, b, c)
  148. #define IDirectDraw3_GetSurfaceFromDC(p, a, b) (p)->lpVtbl->GetSurfaceFromDC(p, a, b)
  149. #endif
  150. /*===========================================================================
  151. *
  152. *
  153. * DIRECTDRAWEX RETURN CODES
  154. *
  155. * The return values from DirectDrawEx Commands and Surface that return an
  156. * HRESULT are codes from DirectDrawEx concerning the results of the action
  157. * requested by DirectDrawEx.
  158. *
  159. *==========================================================================*/
  160. /*
  161. * An attempt was made to load ddraw.dll
  162. */
  163. #define DDERR_LOADFAILED MAKE_DDHRESULT( 901 )
  164. /*
  165. * Unable to determine module/os version number
  166. */
  167. #define DDERR_BADVERSIONINFO MAKE_DDHRESULT( 902 )
  168. /*
  169. * Unable to determine address of ddraw.dll exported symbol (DirectDrawCreate or
  170. * DirectDrawEnumerate).
  171. */
  172. #define DDERR_BADPROCADDRESS MAKE_DDHRESULT( 903 )
  173. /*
  174. * Legacy usage: do not use QI() to create D3D device objects from surface objects.
  175. * Use IDirect3D2::CreateDevice()
  176. */
  177. #define DDERR_LEGACYUSAGE MAKE_DDHRESULT( 904 )
  178. #ifdef __cplusplus
  179. }
  180. #endif
  181. #endif // __DDRAWEXH__