[1/3] d3d9: Add headers for IDirect3DSwapChain9Ex interface (try 2)
Michael Müller
michael at fds-team.de
Fri Aug 30 10:09:11 CDT 2013
Thanks for the feedback, try 2.
This patch implements the IDirect3DSwapChain9Ex interface as an
extension of IDirect3DSwapChain9 and thus fixes bug 34252 - "Silverlight
accelerated graphics cause a D3D critical section lockup" since
Silverlight does no longer try to create a Direct3D context in an
endless loop. The functions d3d9_swapchain_GetLastPresentCount and
d3d9_swapchain_GetPresentStatistics are just stubs so far.
Changelog:
* Implemented test to check if QueryInterface returns E_NOINTERFACE when
trying to request IDirect3DSwapChain9Ex for the non-extended version of
IDirect3D9.
* Using FIXMEs instead of WARNings
* Fixed coding style at some points
* Implemented the derived interface the correct way (hopefully)
---
include/d3d9.h | 77
+++++++++++++++++++++++++++++++++++++++++++++------
include/d3d9types.h | 10 +++++++
2 files changed, 79 insertions(+), 8 deletions(-)
-------------- next part --------------
From 792f3a34df7c56e9217e73dd3cbf989597d4bb54 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael at fds-team.de>
Date: Fri, 30 Aug 2013 14:45:51 +0200
Subject: d3d9: Add headers for IDirect3DSwapChain9Ex interface
---
include/d3d9.h | 77 +++++++++++++++++++++++++++++++++++++++++++++------
include/d3d9types.h | 10 +++++++
2 files changed, 79 insertions(+), 8 deletions(-)
diff --git a/include/d3d9.h b/include/d3d9.h
index 382b241..ce39c10 100644
--- a/include/d3d9.h
+++ b/include/d3d9.h
@@ -394,17 +394,17 @@ DECLARE_INTERFACE_(IDirect3DVolume9,IUnknown)
DECLARE_INTERFACE_(IDirect3DSwapChain9,IUnknown)
{
/*** IUnknown methods ***/
- STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+ STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IDirect3DSwapChain9 methods ***/
- STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion, DWORD dwFlags) PURE;
- STDMETHOD(GetFrontBufferData)(THIS_ struct IDirect3DSurface9* pDestSurface) PURE;
- STDMETHOD(GetBackBuffer)(THIS_ UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, struct IDirect3DSurface9** ppBackBuffer) PURE;
- STDMETHOD(GetRasterStatus)(THIS_ D3DRASTER_STATUS* pRasterStatus) PURE;
- STDMETHOD(GetDisplayMode)(THIS_ D3DDISPLAYMODE* pMode) PURE;
- STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9** ppDevice) PURE;
- STDMETHOD(GetPresentParameters)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters) PURE;
+ STDMETHOD(Present)(THIS_ CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion, DWORD dwFlags) PURE;
+ STDMETHOD(GetFrontBufferData)(THIS_ struct IDirect3DSurface9 *pDestSurface) PURE;
+ STDMETHOD(GetBackBuffer)(THIS_ UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, struct IDirect3DSurface9 **ppBackBuffer) PURE;
+ STDMETHOD(GetRasterStatus)(THIS_ D3DRASTER_STATUS *pRasterStatus) PURE;
+ STDMETHOD(GetDisplayMode)(THIS_ D3DDISPLAYMODE *pMode) PURE;
+ STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9 **ppDevice) PURE;
+ STDMETHOD(GetPresentParameters)(THIS_ D3DPRESENT_PARAMETERS *pPresentationParameters) PURE;
};
#undef INTERFACE
@@ -437,6 +437,67 @@ DECLARE_INTERFACE_(IDirect3DSwapChain9,IUnknown)
#endif
/*****************************************************************************
+ * IDirect3DSwapChain9Ex interface
+ */
+#define INTERFACE IDirect3DSwapChain9Ex
+DECLARE_INTERFACE_(IDirect3DSwapChain9Ex,IDirect3DSwapChain9)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+ /*** IDirect3DSwapChain9 methods ***/
+ STDMETHOD(Present)(THIS_ CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion, DWORD dwFlags) PURE;
+ STDMETHOD(GetFrontBufferData)(THIS_ struct IDirect3DSurface9 *pDestSurface) PURE;
+ STDMETHOD(GetBackBuffer)(THIS_ UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, struct IDirect3DSurface9 **ppBackBuffer) PURE;
+ STDMETHOD(GetRasterStatus)(THIS_ D3DRASTER_STATUS *pRasterStatus) PURE;
+ STDMETHOD(GetDisplayMode)(THIS_ D3DDISPLAYMODE *pMode) PURE;
+ STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9 **ppDevice) PURE;
+ STDMETHOD(GetPresentParameters)(THIS_ D3DPRESENT_PARAMETERS *pPresentationParameters) PURE;
+ /*** IDirect3DSwapChain9Ex methods ***/
+ STDMETHOD(GetLastPresentCount)(THIS_ UINT *pLastPresentCount) PURE;
+ STDMETHOD(GetPresentStats)(THIS_ D3DPRESENTSTATS *pPresentationStatistics) PURE;
+ STDMETHOD(GetDisplayModeEx)(THIS_ D3DDISPLAYMODEEX *pMode, D3DDISPLAYROTATION *pRotation) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DSwapChain9Ex_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DSwapChain9Ex_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirect3DSwapChain9Ex_Release(p) (p)->lpVtbl->Release(p)
+/*** IDirect3DSwapChain9 methods ***/
+#define IDirect3DSwapChain9Ex_Present(p,a,b,c,d,e) (p)->lpVtbl->Present(p,a,b,c,d,e)
+#define IDirect3DSwapChain9Ex_GetFrontBufferData(p,a) (p)->lpVtbl->GetFrontBufferData(p,a)
+#define IDirect3DSwapChain9EX_GetBackBuffer(p,a,b,c) (p)->lpVtbl->GetBackBuffer(p,a,b,c)
+#define IDirect3DSwapChain9EX_GetRasterStatus(p,a) (p)->lpVtbl->GetRasterStatus(p,a)
+#define IDirect3DSwapChain9Ex_GetDisplayMode(p,a) (p)->lpVtbl->GetDisplayMode(p,a)
+#define IDirect3DSwapChain9Ex_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a)
+#define IDirect3DSwapChain9Ex_GetPresentParameters(p,a) (p)->lpVtbl->GetPresentParameters(p,a)
+/*** IDirect3DSwapChain9Ex methods ***/
+#define IDirect3DSwapChain9Ex_GetLastPresentCount(p,a) (p)->lpVtbl->GetLastPresentCount(p,a)
+#define IDirect3DSwapChain9Ex_GetPresentStats(p,a) (p)->lpVtbl->GetPresentStats(p,a)
+#define IDirect3DSwapChain9Ex_GetDisplayModeEx(p,a,b) (p)->lpVtbl->GetDisplayModeEx(p,a,b)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DSwapChain9Ex_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3DSwapChain9Ex_AddRef(p) (p)->AddRef()
+#define IDirect3DSwapChain9Ex_Release(p) (p)->Release()
+/*** IDirect3DSwapChain9 methods ***/
+#define IDirect3DSwapChain9Ex_Present(p,a,b,c,d,e) (p)->Present(a,b,c,d,e)
+#define IDirect3DSwapChain9Ex_GetFrontBufferData(p,a) (p)->GetFrontBufferData(a)
+#define IDirect3DSwapChain9Ex_GetBackBuffer(p,a,b,c) (p)->GetBackBuffer(a,b,c)
+#define IDirect3DSwapChain9Ex_GetRasterStatus(p,a) (p)->GetRasterStatus(a)
+#define IDirect3DSwapChain9Ex_GetDisplayMode(p,a) (p)->GetDisplayMode(a)
+#define IDirect3DSwapChain9Ex_GetDevice(p,a) (p)->GetDevice(a)
+#define IDirect3DSwapChain9Ex_GetPresentParameters(p,a) (p)->GetPresentParameters(a)
+/*** IDirect3DSwapChain9Ex methods ***/
+#define IDirect3DSwapChain9Ex_GetLastPresentCount(p,a) (p)->GetLastPresentCount(a)
+#define IDirect3DSwapChain9Ex_GetPresentStats(p,a) (p)->GetPresentStats(a)
+#define IDirect3DSwapChain9Ex_GetDisplayModeEx(p,a,b) (p)->GetDisplayModeEx(a,b)
+#endif
+
+/*****************************************************************************
* IDirect3DResource9 interface
*/
#define INTERFACE IDirect3DResource9
diff --git a/include/d3d9types.h b/include/d3d9types.h
index cdd3ada..4cc1195 100644
--- a/include/d3d9types.h
+++ b/include/d3d9types.h
@@ -1559,6 +1559,16 @@ typedef enum _D3DCOMPOSERECTSOP{
D3DCOMPOSERECTS_NEG,
D3DCOMPOSERECTS_FORCE_DWORD = 0x7fffffff
} D3DCOMPOSERECTSOP;
+
+typedef struct _D3DPRESENTSTATS
+{
+ UINT PresentCount;
+ UINT PresentRefreshCount;
+ UINT SyncRefreshCount;
+ LARGE_INTEGER SyncQPCTime;
+ LARGE_INTEGER SyncGPUTime;
+} D3DPRESENTSTATS;
+
#endif /* D3D_DISABLE_9EX */
typedef enum _D3DSHADER_COMPARISON
--
1.7.9.5
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3744 bytes
Desc: S/MIME Kryptografische Unterschrift
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20130830/d826598c/attachment.bin>
More information about the wine-patches
mailing list