mirror of
https://github.com/reactos/reactos.git
synced 2025-02-25 01:39:30 +00:00
Complete the dummy of HAL.
CreateDirectDraw and CreateDirectDrawEx will return a pointer of ddraw object. only hardware acclration support are being add. noting real working yet. svn path=/trunk/; revision=14211
This commit is contained in:
parent
f0e4451f31
commit
a98111e50f
3 changed files with 845 additions and 818 deletions
|
@ -76,27 +76,30 @@ HRESULT DDRAW_Create(
|
|||
LPGUID lpGUID, LPVOID *lplpDD, LPUNKNOWN pUnkOuter, REFIID iid, BOOL ex)
|
||||
{
|
||||
|
||||
HRESULT hr;
|
||||
|
||||
|
||||
|
||||
//HDC desktop;
|
||||
|
||||
/* BOOL ex == TRUE it is DirectDrawCreateEx call here. */
|
||||
|
||||
/* TODO:
|
||||
/* TODO 1:
|
||||
check the GUID are right
|
||||
add scanner that DirectDrawCreate / DirectDrawCreateEx select right driver.
|
||||
now we will assume it is the current display driver
|
||||
*/
|
||||
|
||||
/* TODO 2:
|
||||
do not only use hardware mode.
|
||||
*/
|
||||
|
||||
hr = HAL_DirectDraw_Create(lpGUID, lplpDD, pUnkOuter, iid, ex);
|
||||
|
||||
/* old code
|
||||
//HDC desktop;
|
||||
|
||||
/*
|
||||
desktop = GetWindowDC(GetDesktopWindow());
|
||||
lplpDD = OsThunkDdCreateDirectDrawObject(desktop);
|
||||
if (lplpDD == NULL) return DDERR_NODIRECTDRAWHW;
|
||||
*/
|
||||
|
||||
return DDERR_NODIRECTDRAWHW;
|
||||
return hr;
|
||||
}
|
||||
|
||||
BOOL WINAPI DllMain(HINSTANCE hInstance,DWORD fwdReason, LPVOID lpvReserved)
|
||||
|
|
|
@ -289,10 +289,33 @@ HRESULT WINAPI HAL_DirectDraw_Create(const GUID* pGUID, LPDIRECTDRAW7* pIface,
|
|||
IUnknown* pUnkOuter, BOOL ex)
|
||||
{
|
||||
|
||||
HRESULT hr;
|
||||
IDirectDrawImpl* This;
|
||||
|
||||
/*
|
||||
This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
|
||||
sizeof(IDirectDrawImpl)
|
||||
+ sizeof(HAL_DirectDrawImpl));
|
||||
*/
|
||||
This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
|
||||
sizeof(IDirectDrawImpl));
|
||||
|
||||
if (This == NULL) return E_OUTOFMEMORY;
|
||||
|
||||
/* Note that this relation does *not* hold true if the DD object was
|
||||
* CoCreateInstanced then Initialized. */
|
||||
//This->private = (HAL_DirectDrawImpl *)(This+1);
|
||||
|
||||
/* Initialize the DDCAPS structure */
|
||||
This->caps.dwSize = sizeof(This->caps);
|
||||
|
||||
hr = HAL_DirectDraw_Construct(This, ex);
|
||||
if (FAILED(hr))
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
else
|
||||
*pIface = ICOM_INTERFACE(This, IDirectDraw7);
|
||||
|
||||
return DD_OK;
|
||||
return hr;
|
||||
}
|
||||
|
||||
static IDirectDraw7Vtbl HAL_DirectDraw_VTable =
|
||||
|
|
|
@ -119,10 +119,10 @@ struct IDirectDrawImpl
|
|||
ICOM_VFIELD_MULTI(IDirectDraw4);
|
||||
ICOM_VFIELD_MULTI(IDirectDraw2);
|
||||
ICOM_VFIELD_MULTI(IDirectDraw);
|
||||
// ICOM_VFIELD_MULTI(IDirect3D7);
|
||||
// ICOM_VFIELD_MULTI(IDirect3D3);
|
||||
// ICOM_VFIELD_MULTI(IDirect3D2);
|
||||
// ICOM_VFIELD_MULTI(IDirect3D);
|
||||
ICOM_VFIELD_MULTI(IDirect3D7);
|
||||
ICOM_VFIELD_MULTI(IDirect3D3);
|
||||
ICOM_VFIELD_MULTI(IDirect3D2);
|
||||
ICOM_VFIELD_MULTI(IDirect3D);
|
||||
|
||||
DWORD ref;
|
||||
|
||||
|
@ -284,8 +284,8 @@ struct IDirectDrawSurfaceImpl
|
|||
ICOM_VFIELD_MULTI(IDirectDrawSurface7);
|
||||
ICOM_VFIELD_MULTI(IDirectDrawSurface3);
|
||||
ICOM_VFIELD_MULTI(IDirectDrawGammaControl);
|
||||
//ICOM_VFIELD_MULTI(IDirect3DTexture2);
|
||||
//ICOM_VFIELD_MULTI(IDirect3DTexture);
|
||||
ICOM_VFIELD_MULTI(IDirect3DTexture2);
|
||||
ICOM_VFIELD_MULTI(IDirect3DTexture);
|
||||
DWORD ref;
|
||||
|
||||
struct IDirectDrawSurfaceImpl* attached; /* attached surfaces */
|
||||
|
@ -478,4 +478,5 @@ typedef struct
|
|||
extern void DDRAW_dump_flags_(DWORD flags, const flag_info* names, size_t num_names, int newline);
|
||||
extern void DDRAW_dump_members(DWORD flags, const void* data, const member_info* mems, size_t num_mems);
|
||||
|
||||
|
||||
#endif /* __WINE_DLLS_DDRAW_DDRAW_PRIVATE_H */
|
||||
|
|
Loading…
Reference in a new issue