DDrawEx.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:10k
源码类别:

模拟服务器

开发平台:

C/C++

  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.  
  90. // {618F8AD4-8B7A-11d0-8FCC-00C04FD9189D}
  91. DEFINE_GUID(IID_IDirectDraw3, 
  92. 0x618f8ad4, 0x8b7a, 0x11d0, 0x8f, 0xcc, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0x9d);
  93. typedef struct IDirectDraw3 FAR *LPDIRECTDRAW3;
  94. #undef INTERFACE
  95. #define INTERFACE IDirectDraw3
  96. DECLARE_INTERFACE_(IDirectDraw3, IUnknown)
  97. {
  98.     /*** IUnknown methods ***/
  99.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
  100.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  101.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  102.     /*** IDirectDraw methods ***/
  103.     STDMETHOD(Compact)(THIS) PURE;
  104.     STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR * ) PURE;
  105.     STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR*, IUnknown FAR * ) PURE;
  106.     STDMETHOD(CreateSurface)(THIS_  LPDDSURFACEDESC, LPDIRECTDRAWSURFACE FAR *, IUnknown FAR *) PURE;
  107.     STDMETHOD(DuplicateSurface)( THIS_ LPDIRECTDRAWSURFACE, LPDIRECTDRAWSURFACE FAR * ) PURE;
  108.     STDMETHOD(EnumDisplayModes)( THIS_ DWORD, LPDDSURFACEDESC, LPVOID, LPDDENUMMODESCALLBACK ) PURE;
  109.     STDMETHOD(EnumSurfaces)(THIS_ DWORD, LPDDSURFACEDESC, LPVOID,LPDDENUMSURFACESCALLBACK ) PURE;
  110.     STDMETHOD(FlipToGDISurface)(THIS) PURE;
  111.     STDMETHOD(GetCaps)( THIS_ LPDDCAPS, LPDDCAPS) PURE;
  112.     STDMETHOD(GetDisplayMode)( THIS_ LPDDSURFACEDESC) PURE;
  113.     STDMETHOD(GetFourCCCodes)(THIS_  LPDWORD, LPDWORD ) PURE;
  114.     STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE FAR *) PURE;
  115.     STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD) PURE;
  116.     STDMETHOD(GetScanLine)(THIS_ LPDWORD) PURE;
  117.     STDMETHOD(GetVerticalBlankStatus)(THIS_ LPBOOL ) PURE;
  118.     STDMETHOD(Initialize)(THIS_ GUID FAR *) PURE;
  119.     STDMETHOD(RestoreDisplayMode)(THIS) PURE;
  120.     STDMETHOD(SetCooperativeLevel)(THIS_ HWND, DWORD) PURE;
  121.     STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD,DWORD, DWORD, DWORD) PURE;
  122.     STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE;
  123.     /*** Added in the v2 interface ***/
  124.     STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS, LPDWORD, LPDWORD) PURE;
  125.     /*** IDirectDraw3 methods ***/
  126.     STDMETHOD(GetSurfaceFromDC) (THIS_ HDC, IDirectDrawSurface **) PURE;
  127. };
  128. #if !defined(__cplusplus) || defined(CINTERFACE)
  129. #define IDirectDraw3_QueryInterface(p, a, b)         (p)->lpVtbl->QueryInterface(p, a, b)
  130. #define IDirectDraw3_AddRef(p)                       (p)->lpVtbl->AddRef(p)
  131. #define IDirectDraw3_Release(p)                      (p)->lpVtbl->Release(p)
  132. #define IDirectDraw3_Compact(p)                      (p)->lpVtbl->Compact(p)
  133. #define IDirectDraw3_CreateClipper(p, a, b, c)       (p)->lpVtbl->CreateClipper(p, a, b, c)
  134. #define IDirectDraw3_CreatePalette(p, a, b, c, d)    (p)->lpVtbl->CreatePalette(p, a, b, c, d)
  135. #define IDirectDraw3_CreateSurface(p, a, b, c)       (p)->lpVtbl->CreateSurface(p, a, b, c)
  136. #define IDirectDraw3_DuplicateSurface(p, a, b)       (p)->lpVtbl->DuplicateSurface(p, a, b)
  137. #define IDirectDraw3_EnumDisplayModes(p, a, b, c, d) (p)->lpVtbl->EnumDisplayModes(p, a, b, c, d)
  138. #define IDirectDraw3_EnumSurfaces(p, a, b, c, d)     (p)->lpVtbl->EnumSurfaces(p, a, b, c, d)
  139. #define IDirectDraw3_FlipToGDISurface(p)             (p)->lpVtbl->FlipToGDISurface(p)
  140. #define IDirectDraw3_GetCaps(p, a, b)                (p)->lpVtbl->GetCaps(p, a, b)
  141. #define IDirectDraw3_GetDisplayMode(p, a)            (p)->lpVtbl->GetDisplayMode(p, a)
  142. #define IDirectDraw3_GetFourCCCodes(p, a, b)         (p)->lpVtbl->GetFourCCCodes(p, a, b)
  143. #define IDirectDraw3_GetGDISurface(p, a)             (p)->lpVtbl->GetGDISurface(p, a)
  144. #define IDirectDraw3_GetMonitorFrequency(p, a)       (p)->lpVtbl->GetMonitorFrequency(p, a)
  145. #define IDirectDraw3_GetScanLine(p, a)               (p)->lpVtbl->GetScanLine(p, a)
  146. #define IDirectDraw3_GetVerticalBlankStatus(p, a)    (p)->lpVtbl->GetVerticalBlankStatus(p, a)
  147. #define IDirectDraw3_Initialize(p, a)                (p)->lpVtbl->Initialize(p, a)
  148. #define IDirectDraw3_RestoreDisplayMode(p)           (p)->lpVtbl->RestoreDisplayMode(p)
  149. #define IDirectDraw3_SetCooperativeLevel(p, a, b)    (p)->lpVtbl->SetCooperativeLevel(p, a, b)
  150. #define IDirectDraw3_SetDisplayMode(p, a, b, c, d, e) (p)->lpVtbl->SetDisplayMode(p, a, b, c, d, e)
  151. #define IDirectDraw3_WaitForVerticalBlank(p, a, b)   (p)->lpVtbl->WaitForVerticalBlank(p, a, b)
  152. #define IDirectDraw3_GetAvailableVidMem(p, a, b, c)  (p)->lpVtbl->GetAvailableVidMem(p, a, b, c)
  153. #define IDirectDraw3_GetSurfaceFromDC(p, a, b)       (p)->lpVtbl->GetSurfaceFromDC(p, a, b)
  154. #endif
  155.  
  156. /*===========================================================================
  157.  *
  158.  *
  159.  * DIRECTDRAWEX RETURN CODES
  160.  *
  161.  * The return values from DirectDrawEx Commands and Surface that return an
  162.  * HRESULT are codes from DirectDrawEx concerning the results of the action
  163.  * requested by DirectDrawEx.
  164.  *
  165.  *==========================================================================*/
  166. /*
  167.  * An attempt was made to load ddraw.dll
  168.  */
  169. #define DDERR_LOADFAILED                        MAKE_DDHRESULT( 901 )
  170. /*
  171.  * Unable to determine module/os version number
  172.  */
  173. #define DDERR_BADVERSIONINFO                    MAKE_DDHRESULT( 902 )
  174. /*
  175.  * Unable to determine address of ddraw.dll exported symbol (DirectDrawCreate or
  176.  * DirectDrawEnumerate).
  177.  */
  178. #define DDERR_BADPROCADDRESS                    MAKE_DDHRESULT( 903 )
  179. /*
  180.  * Legacy usage: do not use QI() to create D3D device objects from surface objects.  
  181.  * Use IDirect3D2::CreateDevice()
  182.  */
  183. #define DDERR_LEGACYUSAGE                       MAKE_DDHRESULT( 904 )
  184. #ifdef __cplusplus
  185. }
  186. #endif
  187. #endif // __DDRAWEXH__