Commit aa109490 authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

Added some basic IDirectDraw7 interface support, fixed argument count

of IDirectDraw{4,7}_SetDisplayMode defines.
parent e4ab07e0
......@@ -44,6 +44,7 @@ DEFAULT_DEBUG_CHANNEL(ddraw);
struct ICOM_VTABLE(IDirectDraw) dga_ddvt;
struct ICOM_VTABLE(IDirectDraw2) dga_dd2vt;
struct ICOM_VTABLE(IDirectDraw4) dga_dd4vt;
struct ICOM_VTABLE(IDirectDraw7) dga_dd7vt;
#define DDPRIVATE(x) dga_dd_private *ddpriv = ((dga_dd_private*)(x)->d->private)
#define DPPRIVATE(x) dga_dp_private *dppriv = ((dga_dp_private*)(x)->private)
......@@ -412,14 +413,23 @@ HRESULT WINAPI DGA_IDirectDraw2Impl_QueryInterface(
return S_OK;
}
if ( IsEqualGUID( &IID_IDirectDraw4, refiid ) ) {
IDirectDraw2Impl *dd = HeapAlloc(GetProcessHeap(),0,sizeof(*dd));
ICOM_VTBL(dd) = &dga_dd2vt;dd->ref = 1;dd->d = This->d;This->d++;
IDirectDraw4Impl *dd = HeapAlloc(GetProcessHeap(),0,sizeof(*dd));
ICOM_VTBL(dd) = &dga_dd4vt;dd->ref = 1;dd->d = This->d;This->d++;
*obj = dd;
IDirectDraw2_AddRef(iface);
IDirectDraw4_AddRef(iface);
TRACE(" Creating IDirectDraw4 interface (%p)\n", *obj);
return S_OK;
}
if ( IsEqualGUID( &IID_IDirectDraw7, refiid ) ) {
IDirectDraw4Impl *dd = HeapAlloc(GetProcessHeap(),0,sizeof(*dd));
ICOM_VTBL(dd) = &dga_dd7vt;dd->ref = 1;dd->d = This->d;This->d++;
*obj = dd;
IDirectDraw7_AddRef(iface);
FIXME(" Creating IDirectDraw7 interface (by using DirectDraw4 impl.) (%p)\n", *obj);
return S_OK;
}
FIXME("(%p):interface for IID %s _NOT_ found!\n",This,debugstr_guid(refiid));
return OLE_E_ENUM_NOMORE;
}
......@@ -660,3 +670,45 @@ ICOM_VTABLE(IDirectDraw4) dga_dd4vt =
IDirectDraw4Impl_GetDeviceIdentifier
};
#undef XCAST
#if !defined(__STRICT_ANSI__) && defined(__GNUC__)
# define XCAST(fun) (typeof(dga_dd7vt.fn##fun))
#else
# define XCAST(fun) (void*)
#endif
ICOM_VTABLE(IDirectDraw7) dga_dd7vt =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
XCAST(QueryInterface)DGA_IDirectDraw2Impl_QueryInterface,
XCAST(AddRef)IDirectDraw2Impl_AddRef,
XCAST(Release)DGA_IDirectDraw2Impl_Release,
XCAST(Compact)IDirectDraw2Impl_Compact,
XCAST(CreateClipper)IDirectDraw2Impl_CreateClipper,
XCAST(CreatePalette)DGA_IDirectDraw2Impl_CreatePalette,
XCAST(CreateSurface)DGA_IDirectDraw2Impl_CreateSurface,
XCAST(DuplicateSurface)IDirectDraw2Impl_DuplicateSurface,
XCAST(EnumDisplayModes)DGA_IDirectDraw2Impl_EnumDisplayModes,
XCAST(EnumSurfaces)IDirectDraw2Impl_EnumSurfaces,
XCAST(FlipToGDISurface)IDirectDraw2Impl_FlipToGDISurface,
XCAST(GetCaps)DGA_IDirectDraw2Impl_GetCaps,
XCAST(GetDisplayMode)DGA_IDirectDraw2Impl_GetDisplayMode,
XCAST(GetFourCCCodes)IDirectDraw2Impl_GetFourCCCodes,
XCAST(GetGDISurface)IDirectDraw2Impl_GetGDISurface,
XCAST(GetMonitorFrequency)IDirectDraw2Impl_GetMonitorFrequency,
XCAST(GetScanLine)IDirectDraw2Impl_GetScanLine,
XCAST(GetVerticalBlankStatus)IDirectDraw2Impl_GetVerticalBlankStatus,
XCAST(Initialize)IDirectDraw2Impl_Initialize,
XCAST(RestoreDisplayMode)DGA_IDirectDraw2Impl_RestoreDisplayMode,
XCAST(SetCooperativeLevel)IDirectDraw2Impl_SetCooperativeLevel,
XCAST(SetDisplayMode)DGA_IDirectDrawImpl_SetDisplayMode,
XCAST(WaitForVerticalBlank)IDirectDraw2Impl_WaitForVerticalBlank,
XCAST(GetAvailableVidMem)DGA_IDirectDraw2Impl_GetAvailableVidMem,
XCAST(GetSurfaceFromDC)IDirectDraw4Impl_GetSurfaceFromDC,
XCAST(RestoreAllSurfaces)IDirectDraw4Impl_RestoreAllSurfaces,
XCAST(TestCooperativeLevel)IDirectDraw4Impl_TestCooperativeLevel,
XCAST(GetDeviceIdentifier)IDirectDraw4Impl_GetDeviceIdentifier,
IDirectDraw7Impl_StartModeTest,
IDirectDraw7Impl_EvaluateMode
};
#undef XCAST
......@@ -528,6 +528,24 @@ HRESULT WINAPI IDirectDraw4Impl_GetDeviceIdentifier(
return DD_OK;
}
HRESULT WINAPI IDirectDraw7Impl_StartModeTest(
LPDIRECTDRAW7 iface,LPSIZE lpModesToTest,DWORD dwNumEntries,DWORD dwFlags
) {
FIXME("(%p)->(%p,%ld,0x%08lx),empty stub!\n",iface,
lpModesToTest,dwNumEntries,dwFlags
);
return DD_OK;
}
HRESULT WINAPI IDirectDraw7Impl_EvaluateMode(
LPDIRECTDRAW7 iface,DWORD dwFlags, DWORD *pSecondsUntilTimeout
) {
FIXME("(%p)->(0x%08lx,%p),empty stub!\n",iface,
dwFlags,pSecondsUntilTimeout
);
return DD_OK;
}
HRESULT common_off_screen_CreateSurface(
IDirectDraw2Impl* This,IDirectDrawSurfaceImpl* lpdsf
) {
......
......@@ -906,10 +906,19 @@ static HRESULT WINAPI Xlib_IDirectDraw2Impl_QueryInterface(
dd->ref = 1;ICOM_VTBL(dd) = &xlib_dd4vt;dd->d = This->d;This->d->ref++;
*obj = dd;
IDirectDraw2_AddRef(iface);
IDirectDraw4_AddRef(iface);
TRACE(" Creating IDirectDraw4 interface (%p)\n", *obj);
return S_OK;
}
if ( IsEqualGUID( &IID_IDirectDraw7, refiid ) ) {
IDirectDraw4Impl *dd = HeapAlloc(GetProcessHeap(),0,sizeof(*dd));
dd->ref = 1;ICOM_VTBL(dd) = &xlib_dd7vt;dd->d = This->d;This->d->ref++;
*obj = dd;
IDirectDraw7_AddRef(iface);
FIXME(" Creating IDirectDraw7 interface by reusing DirectDraw4!(%p)\n", *obj);
return S_OK;
}
#ifdef HAVE_OPENGL
if ( IsEqualGUID( &IID_IDirect3D, refiid ) )
return create_direct3d(obj,This);
......@@ -1266,7 +1275,7 @@ ICOM_VTABLE(IDirectDraw4) xlib_dd4vt = {
XCAST(Initialize)IDirectDraw2Impl_Initialize,
XCAST(RestoreDisplayMode)IDirectDraw2Impl_RestoreDisplayMode,
XCAST(SetCooperativeLevel)Xlib_IDirectDraw2Impl_SetCooperativeLevel,
XCAST(SetDisplayMode)Xlib_IDirectDrawImpl_SetDisplayMode,
XCAST(SetDisplayMode)Xlib_IDirectDraw2Impl_SetDisplayMode,
XCAST(WaitForVerticalBlank)IDirectDraw2Impl_WaitForVerticalBlank,
XCAST(GetAvailableVidMem)Xlib_IDirectDraw2Impl_GetAvailableVidMem,
IDirectDraw4Impl_GetSurfaceFromDC,
......@@ -1275,3 +1284,44 @@ ICOM_VTABLE(IDirectDraw4) xlib_dd4vt = {
IDirectDraw4Impl_GetDeviceIdentifier
};
#undef XCAST
#if !defined(__STRICT_ANSI__) && defined(__GNUC__)
# define XCAST(fun) (typeof(xlib_dd7vt.fn##fun))
#else
# define XCAST(fun) (void*)
#endif
ICOM_VTABLE(IDirectDraw7) xlib_dd7vt = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
XCAST(QueryInterface)Xlib_IDirectDraw2Impl_QueryInterface,
XCAST(AddRef)IDirectDraw2Impl_AddRef,
XCAST(Release)Xlib_IDirectDraw2Impl_Release,
XCAST(Compact)IDirectDraw2Impl_Compact,
XCAST(CreateClipper)IDirectDraw2Impl_CreateClipper,
XCAST(CreatePalette)Xlib_IDirectDraw2Impl_CreatePalette,
XCAST(CreateSurface)Xlib_IDirectDraw2Impl_CreateSurface,
XCAST(DuplicateSurface)IDirectDraw2Impl_DuplicateSurface,
XCAST(EnumDisplayModes)Xlib_IDirectDraw2Impl_EnumDisplayModes,
XCAST(EnumSurfaces)IDirectDraw2Impl_EnumSurfaces,
XCAST(FlipToGDISurface)IDirectDraw2Impl_FlipToGDISurface,
XCAST(GetCaps)Xlib_IDirectDraw2Impl_GetCaps,
XCAST(GetDisplayMode)IDirectDraw2Impl_GetDisplayMode,
XCAST(GetFourCCCodes)Xlib_IDirectDraw2Impl_GetFourCCCodes,
XCAST(GetGDISurface)IDirectDraw2Impl_GetGDISurface,
XCAST(GetMonitorFrequency)IDirectDraw2Impl_GetMonitorFrequency,
XCAST(GetScanLine)IDirectDraw2Impl_GetScanLine,
XCAST(GetVerticalBlankStatus)IDirectDraw2Impl_GetVerticalBlankStatus,
XCAST(Initialize)IDirectDraw2Impl_Initialize,
XCAST(RestoreDisplayMode)IDirectDraw2Impl_RestoreDisplayMode,
XCAST(SetCooperativeLevel)Xlib_IDirectDraw2Impl_SetCooperativeLevel,
XCAST(SetDisplayMode)Xlib_IDirectDraw2Impl_SetDisplayMode,
XCAST(WaitForVerticalBlank)IDirectDraw2Impl_WaitForVerticalBlank,
XCAST(GetAvailableVidMem)Xlib_IDirectDraw2Impl_GetAvailableVidMem,
XCAST(GetSurfaceFromDC)IDirectDraw4Impl_GetSurfaceFromDC,
XCAST(RestoreAllSurfaces)IDirectDraw4Impl_RestoreAllSurfaces,
XCAST(TestCooperativeLevel)IDirectDraw4Impl_TestCooperativeLevel,
XCAST(GetDeviceIdentifier)IDirectDraw4Impl_GetDeviceIdentifier,
IDirectDraw7Impl_StartModeTest,
IDirectDraw7Impl_EvaluateMode,
};
#undef XCAST
......@@ -189,6 +189,13 @@ extern HRESULT WINAPI IDirectDraw4Impl_GetDeviceIdentifier(LPDIRECTDRAW4 iface,
DWORD dwFlags
);
extern HRESULT WINAPI IDirectDraw7Impl_StartModeTest(
LPDIRECTDRAW7 iface,LPSIZE modetotest,DWORD num,DWORD flags
);
extern HRESULT WINAPI IDirectDraw7Impl_EvaluateMode(
LPDIRECTDRAW7 iface,DWORD flags,DWORD *seconduntiltimeout
);
/*****************************************************************************
* IDirectDrawPalette implementation structure
*/
......
......@@ -40,8 +40,9 @@ typedef int XvImage;
#include "wine_gl.h"
extern ICOM_VTABLE(IDirectDraw) xlib_ddvt;
extern ICOM_VTABLE(IDirectDraw2) xlib_dd2vt;
extern ICOM_VTABLE(IDirectDraw2) xlib_dd2vt;
extern ICOM_VTABLE(IDirectDraw4) xlib_dd4vt;
extern ICOM_VTABLE(IDirectDraw7) xlib_dd7vt;
extern ICOM_VTABLE(IDirectDrawPalette) xlib_ddpalvt;
extern ICOM_VTABLE(IDirectDrawSurface4) xlib_dds4vt;
......
......@@ -1373,7 +1373,7 @@ ICOM_DEFINE(IDirectDraw4,IDirectDraw2)
#define IDirectDraw4_Initialize(p,a) ICOM_CALL1(Initialize,p,a)
#define IDirectDraw4_RestoreDisplayMode(p) ICOM_CALL (RestoreDisplayMode,p)
#define IDirectDraw4_SetCooperativeLevel(p,a,b) ICOM_CALL2(SetCooperativeLevel,p,a,b)
#define IDirectDraw4_SetDisplayMode(p,a,b,c) ICOM_CALL3(SetDisplayMode,p,a,b,c)
#define IDirectDraw4_SetDisplayMode(p,a,b,c,d,e) ICOM_CALL5(SetDisplayMode,p,a,b,c,d,e)
#define IDirectDraw4_WaitForVerticalBlank(p,a,b) ICOM_CALL2(WaitForVerticalBlank,p,a,b)
/*** IDirectDraw2 methods ***/
#define IDirectDraw4_GetAvailableVidMem(p,a,b,c) ICOM_CALL3(GetAvailableVidMem,p,a,b,c)
......@@ -1451,7 +1451,7 @@ ICOM_DEFINE(IDirectDraw7,IUnknown)
#define IDirectDraw7_Initialize(p,a) ICOM_CALL1(Initialize,p,a)
#define IDirectDraw7_RestoreDisplayMode(p) ICOM_CALL (RestoreDisplayMode,p)
#define IDirectDraw7_SetCooperativeLevel(p,a,b) ICOM_CALL2(SetCooperativeLevel,p,a,b)
#define IDirectDraw7_SetDisplayMode(p,a,b,c) ICOM_CALL3(SetDisplayMode,p,a,b,c)
#define IDirectDraw7_SetDisplayMode(p,a,b,c,d,e) ICOM_CALL5(SetDisplayMode,p,a,b,c,d,e)
#define IDirectDraw7_WaitForVerticalBlank(p,a,b) ICOM_CALL2(WaitForVerticalBlank,p,a,b)
/*** added in IDirectDraw2 ***/
#define IDirectDraw7_GetAvailableVidMem(p,a,b,c) ICOM_CALL3(GetAvailableVidMem,p,a,b,c)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment