From 08482c30b1b5730795dd2910bcbd12bf56d1d5ae Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Sun, 20 Mar 2005 17:24:11 +0000 Subject: [PATCH] start add hardware interface to hal we now map the hal to directdraw follow api are implement in the ddraw for hal but all hal api are not implement in the kernel if you got louky it maby working with nvida driver now. untested yet. svn path=/trunk/; revision=14225 --- reactos/lib/ddraw/ddraw_hal.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/reactos/lib/ddraw/ddraw_hal.c b/reactos/lib/ddraw/ddraw_hal.c index 570c4fb809b..b1dec34eeca 100644 --- a/reactos/lib/ddraw/ddraw_hal.c +++ b/reactos/lib/ddraw/ddraw_hal.c @@ -37,9 +37,9 @@ HRESULT HAL_DirectDraw_Construct(IDirectDrawImpl *This, BOOL ex) This->create_primary = HAL_DirectDraw_create_primary; This->create_backbuffer = HAL_DirectDraw_create_backbuffer; - This->create_texture = HAL_DirectDraw_create_texture; + This->create_texture = HAL_DirectDraw_create_texture; - ICOM_INIT_INTERFACE(This, IDirectDraw7, HAL_DirectDraw_VTable); + // ICOM_INIT_INTERFACE(This, IDirectDraw7, HAL_DirectDraw_VTable); return S_OK; } @@ -290,7 +290,8 @@ HRESULT WINAPI HAL_DirectDraw_Create(const GUID* pGUID, LPDIRECTDRAW7* pIface, { HRESULT hr; - IDirectDrawImpl* This; + IDirectDrawImpl* This; + HDC desktop; /* This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, @@ -312,8 +313,14 @@ HRESULT WINAPI HAL_DirectDraw_Create(const GUID* pGUID, LPDIRECTDRAW7* pIface, hr = HAL_DirectDraw_Construct(This, ex); if (FAILED(hr)) HeapFree(GetProcessHeap(), 0, This); - else - *pIface = ICOM_INTERFACE(This, IDirectDraw7); + else *pIface = ICOM_INTERFACE(This, IDirectDraw7); + + /* create a scaner that check which driver we should get the HDC from */ + /* for now we always asume it is the active dirver that should be use. */ + + desktop = GetWindowDC(GetDesktopWindow()); + *pIface = OsThunkDdCreateDirectDrawObject(desktop); + if (pIface == NULL) hr == DDERR_NODIRECTDRAWHW; return hr; }