ddrawex: Implement a wrapper around IDirectDraw.
This allows us to cleanly implement the differences between ddraw.dll and ddrawex.dll without private functions and if checks if an object was created by ddraw or ddrawex. A similar wrapper will be added for IDirectDrawSurface.
This commit is contained in:
parent
8eff8acc46
commit
efcecb9b99
|
@ -6,6 +6,7 @@ MODULE = ddrawex.dll
|
||||||
IMPORTS = dxguid uuid ddraw ole32 advapi32 kernel32
|
IMPORTS = dxguid uuid ddraw ole32 advapi32 kernel32
|
||||||
|
|
||||||
C_SRCS = \
|
C_SRCS = \
|
||||||
|
ddraw.c \
|
||||||
main.c \
|
main.c \
|
||||||
regsvr.c
|
regsvr.c
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -55,7 +55,7 @@ typedef struct
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* DirectDrawFactopry implementation
|
* DirectDrawFactory implementation
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
@ -63,4 +63,23 @@ typedef struct
|
||||||
LONG ref;
|
LONG ref;
|
||||||
} IDirectDrawFactoryImpl;
|
} IDirectDrawFactoryImpl;
|
||||||
|
|
||||||
|
HRESULT WINAPI IDirectDrawFactoryImpl_CreateDirectDraw(IDirectDrawFactory* iface,
|
||||||
|
GUID * pGUID, HWND hWnd, DWORD dwCoopLevelFlags, DWORD dwReserved, IUnknown *pUnkOuter,
|
||||||
|
IDirectDraw **ppDirectDraw);
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* IDirectDraw wrapper implementation
|
||||||
|
******************************************************************************/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
const IDirectDrawVtbl *IDirectDraw_Vtbl;
|
||||||
|
const IDirectDraw2Vtbl *IDirectDraw2_Vtbl;
|
||||||
|
const IDirectDraw3Vtbl *IDirectDraw3_Vtbl;
|
||||||
|
const IDirectDraw4Vtbl *IDirectDraw4_Vtbl;
|
||||||
|
LONG ref;
|
||||||
|
|
||||||
|
/* The interface we're forwarding to */
|
||||||
|
IDirectDraw4 *parent;
|
||||||
|
} IDirectDrawImpl;
|
||||||
|
|
||||||
#endif /* __WINE_DLLS_DDRAWEX_DDRAWEX_PRIVATE_H */
|
#endif /* __WINE_DLLS_DDRAWEX_DDRAWEX_PRIVATE_H */
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
#include "initguid.h"
|
#include "initguid.h"
|
||||||
#include "ddrawex_private.h"
|
#include "ddrawex_private.h"
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(ddraw);
|
WINE_DEFAULT_DEBUG_CHANNEL(ddrawex);
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
|
@ -194,36 +194,6 @@ IDirectDrawFactoryImpl_Release(IDirectDrawFactory *iface)
|
||||||
return ref;
|
return ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* IDirectDrawFactoryImpl_CreateDirectDraw
|
|
||||||
*******************************************************************************/
|
|
||||||
static HRESULT WINAPI
|
|
||||||
IDirectDrawFactoryImpl_CreateDirectDraw(IDirectDrawFactory* iface,
|
|
||||||
GUID * pGUID,
|
|
||||||
HWND hWnd,
|
|
||||||
DWORD dwCoopLevelFlags,
|
|
||||||
DWORD dwReserved,
|
|
||||||
IUnknown *pUnkOuter,
|
|
||||||
IDirectDraw **ppDirectDraw)
|
|
||||||
{
|
|
||||||
HRESULT hr;
|
|
||||||
|
|
||||||
TRACE("\n");
|
|
||||||
|
|
||||||
hr = DirectDrawCreateEx(pGUID, (void**)ppDirectDraw, &IID_IDirectDraw3, pUnkOuter);
|
|
||||||
|
|
||||||
if (FAILED(hr))
|
|
||||||
return hr;
|
|
||||||
|
|
||||||
hr = IDirectDraw_SetCooperativeLevel(*ppDirectDraw, hWnd, dwCoopLevelFlags);
|
|
||||||
if (FAILED(hr))
|
|
||||||
IDirectDraw_Release(*ppDirectDraw);
|
|
||||||
|
|
||||||
return hr;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* IDirectDrawFactoryImpl_DirectDrawEnumerate
|
* IDirectDrawFactoryImpl_DirectDrawEnumerate
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
Loading…
Reference in New Issue