Author: khornicek
Date: Sat Nov 29 10:27:59 2008
New Revision: 37733
URL:
http://svn.reactos.org/svn/reactos?rev=37733&view=rev
Log:
- create wined3d device in GdiEntry2
Modified:
branches/reactx/reactos/dll/win32/gdi32/misc/gdientryhelgl.c
Modified: branches/reactx/reactos/dll/win32/gdi32/misc/gdientryhelgl.c
URL:
http://svn.reactos.org/svn/reactos/branches/reactx/reactos/dll/win32/gdi32/…
==============================================================================
--- branches/reactx/reactos/dll/win32/gdi32/misc/gdientryhelgl.c [iso-8859-1] (original)
+++ branches/reactx/reactos/dll/win32/gdi32/misc/gdientryhelgl.c [iso-8859-1] Sat Nov 29
10:27:59 2008
@@ -1659,6 +1659,39 @@
BOOL
WINAPI
+CreateWineD3DDevice(LPDDRAWI_DIRECTDRAW_GBL hDirectDraw)
+{
+ IWineD3D *This = (IWineD3D*)hDirectDraw;
+ IWineD3DDevice *WineD3DDevice;
+ HRESULT hr;
+
+ if( !This )
+ return FALSE;
+
+ WineD3DDevice = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(IWineD3DDevice));
+
+ if (!WineD3DDevice)
+ {
+ hDirectDraw->dwUnused3 = 0;
+ return FALSE;
+ }
+
+ hr = IWineD3D_CreateDevice(This, 0, WINED3DDEVTYPE_HAL, NULL, 0, &WineD3DDevice,
NULL);
+
+ if ( hr != DD_OK )
+ {
+ HeapFree(GetProcessHeap(), 0, WineD3DDevice);
+ hDirectDraw->dwUnused3 = 0;
+ return FALSE;
+ }
+
+ hDirectDraw->dwUnused3 = (DWORD) WineD3DDevice;
+
+ return TRUE;
+}
+
+BOOL
+WINAPI
bDDCreateSurface(LPDDRAWI_DDRAWSURFACE_LCL pSurface,
BOOL bComplete)
{
@@ -1749,7 +1782,7 @@
/* Create the DDraw Object */
//ghDirectDraw = NtGdiDdCreateDirectDrawObject(hdc);
ghDirectDraw = (HANDLE) pWineDirect3DCreate(D3D_SDK_VERSION, 9, NULL);
-
+ CreateWineD3DDevice((LPDDRAWI_DIRECTDRAW_GBL) ghDirectDraw);
/* Delete our DC */
DeleteDC(hdc);
}
@@ -1771,7 +1804,7 @@
/* Using the per-process object, so create it */
//pDirectDrawGlobal->hDD = (ULONG_PTR)NtGdiDdCreateDirectDrawObject(hdc);
pDirectDrawGlobal->hDD = (ULONG_PTR) pWineDirect3DCreate(D3D_SDK_VERSION, 9,
NULL);
-
+ CreateWineD3DDevice((LPDDRAWI_DIRECTDRAW_GBL) pDirectDrawGlobal->hDD);
/* Set the return value */
Return = pDirectDrawGlobal->hDD ? TRUE : FALSE;
@@ -1841,7 +1874,7 @@
}
/* Do the query */
- if ( GetDdHandle(pDirectDrawGlobal->hDD) == NULL || pHalInfo == NULL)
+ if ( GetDdHandle(pDirectDrawGlobal->hDD) == NULL)
{
/* We failed, free the memory and return */
retVal = FALSE;