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.

218 lines
9.6 KiB

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