3 * COPYRIGHT: See COPYING in the top level directory
5 * FILE: lib/ddraw/hal/ddraw.c
6 * PURPOSE: DirectDraw HAL Implementation
7 * PROGRAMMER: Magnus Olsen, Maarten Bosma
14 HRESULT
Hal_DirectDraw_Initialize (LPDIRECTDRAW7 iface
)
16 IDirectDrawImpl
* This
= (IDirectDrawImpl
*)iface
;
19 /* point to it self */
20 This
->DirectDrawGlobal
.lp16DD
= &This
->DirectDrawGlobal
;
23 if(!DdCreateDirectDrawObject (&This
->DirectDrawGlobal
, This
->hdc
))
24 return DDERR_INVALIDPARAMS
;
27 /* alloc all the space */
28 This
->DirectDrawGlobal
.lpDDCBtmp
= (LPDDHAL_CALLBACKS
)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(DDHAL_CALLBACKS
));
29 This
->DirectDrawGlobal
.lpD3DHALCallbacks
= (ULONG_PTR
)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY
, sizeof(D3DHAL_CALLBACKS
));
30 This
->DirectDrawGlobal
.lpD3DGlobalDriverData
= (ULONG_PTR
)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(D3DHAL_GLOBALDRIVERDATA
));
33 /* Fill in some info */
34 This
->HalInfo
.lpD3DGlobalDriverData
= This
->DirectDrawGlobal
.lpD3DGlobalDriverData
;
35 This
->HalInfo
.lpD3DHALCallbacks
= This
->DirectDrawGlobal
.lpD3DHALCallbacks
;
36 This
->HalInfo
.lpDDCallbacks
= &This
->DirectDrawGlobal
.lpDDCBtmp
->HALDD
;
37 This
->HalInfo
.lpDDExeBufCallbacks
= &This
->DirectDrawGlobal
.lpDDCBtmp
->HALDDExeBuf
;
38 This
->HalInfo
.lpDDPaletteCallbacks
= &This
->DirectDrawGlobal
.lpDDCBtmp
->HALDDPalette
;
39 This
->HalInfo
.lpDDSurfaceCallbacks
= &This
->DirectDrawGlobal
.lpDDCBtmp
->HALDDSurface
;
41 /* FIXME The insate is not right we need the info that the three NULL return */
43 /* query all kinds of infos from the driver */
44 if(!DdQueryDirectDrawObject (
45 &This
->DirectDrawGlobal
,
47 This
->HalInfo
.lpDDCallbacks
,
48 This
->HalInfo
.lpDDSurfaceCallbacks
,
49 This
->HalInfo
.lpDDPaletteCallbacks
,
50 (LPD3DHAL_CALLBACKS
)This
->DirectDrawGlobal
.lpD3DHALCallbacks
,
51 (LPD3DHAL_GLOBALDRIVERDATA
)This
->DirectDrawGlobal
.lpD3DGlobalDriverData
,
52 This
->HalInfo
.lpDDExeBufCallbacks
,
57 OutputDebugString(L
"First DdQueryDirectDrawObject failed");
61 /* FIXME The insate is not right we need the info that the three NULL return and use it here*/
63 /* Fixme shall we selected the pixel type before we call the DdQueryDirectDrawObject second time
64 and fill in more info ?? */
66 This
->HalInfo
.vmiData
.pvmList
= HeapAlloc(GetProcessHeap(), 0, sizeof(VIDMEM
) * This
->HalInfo
.vmiData
.dwNumHeaps
);
67 This
->DirectDrawGlobal
.lpdwFourCC
= HeapAlloc(GetProcessHeap(), 0, sizeof(DWORD
) * This
->HalInfo
.ddCaps
.dwNumFourCCCodes
);
68 This
->DirectDrawGlobal
.lpZPixelFormats
= HeapAlloc(GetProcessHeap(), 0, sizeof(DDPIXELFORMAT
) * This
->DirectDrawGlobal
.dwNumZPixelFormats
);
69 ((LPD3DHAL_GLOBALDRIVERDATA
)This
->DirectDrawGlobal
.lpD3DGlobalDriverData
)->lpTextureFormats
= HeapAlloc(GetProcessHeap(), 0, sizeof(DDSURFACEDESC
) * ((LPD3DHAL_GLOBALDRIVERDATA
)This
->DirectDrawGlobal
.lpD3DGlobalDriverData
)->dwNumTextureFormats
);
71 if(!DdQueryDirectDrawObject (
72 &This
->DirectDrawGlobal
,
74 This
->HalInfo
.lpDDCallbacks
,
75 This
->HalInfo
.lpDDSurfaceCallbacks
,
76 This
->HalInfo
.lpDDPaletteCallbacks
,
77 (LPD3DHAL_CALLBACKS
)This
->DirectDrawGlobal
.lpD3DHALCallbacks
,
78 (LPD3DHAL_GLOBALDRIVERDATA
)This
->DirectDrawGlobal
.lpD3DGlobalDriverData
,
79 This
->HalInfo
.lpDDExeBufCallbacks
,
80 ((LPD3DHAL_GLOBALDRIVERDATA
)This
->DirectDrawGlobal
.lpD3DGlobalDriverData
)->lpTextureFormats
,
81 This
->DirectDrawGlobal
.lpdwFourCC
,
82 This
->HalInfo
.vmiData
.pvmList
85 OutputDebugString(L
"Second DdQueryDirectDrawObject failed");
89 /* Copy HalInfo to DirectDrawGlobal (Not complete)*/
91 RtlCopyMemory(&This
->DirectDrawGlobal
.vmiData
,&This
->HalInfo
.vmiData
,sizeof(VIDMEMINFO
));
92 RtlCopyMemory(&This
->DirectDrawGlobal
.ddCaps
,&This
->HalInfo
.ddCaps
,sizeof(DDCORECAPS
));
93 This
->DirectDrawGlobal
.dwMonitorFrequency
= This
->HalInfo
.dwMonitorFrequency
;
95 /* have not check where it should go into yet
96 This->HalInfo.GetDriverInfo datatype LPDDHAL_GETDRIVERINFO
99 This
->DirectDrawGlobal
.dwModeIndex
= This
->HalInfo
.dwModeIndex
;
101 /* have not check where it should go into yet
102 This->HalInfo.lpdwFourCC datatype LPDWORD
105 This
->DirectDrawGlobal
.dwNumModes
= This
->HalInfo
.dwNumModes
;
106 This
->DirectDrawGlobal
.lpModeInfo
= This
->HalInfo
.lpModeInfo
;
108 /* have not check where it should go into yet
109 This->HalInfo.dwFlags data type DWORD
112 /* Unsure which of these two for lpPDevice
113 This->DirectDrawGlobal.dwPDevice = This->HalInfo.lpPDevice;
114 This->lpDriverHandle = This->HalInfo.lpPDevice;
117 This
->DirectDrawGlobal
.hInstance
= This
->HalInfo
.hInstance
;
119 /* have not check where it should go into yet
120 This->lpD3DGlobalDriverData datatype ULONG_PTR
121 This->lpD3DHALCallbacks datatype ULONG_PTR
123 RtlCopyMemory(&This
->DirectDrawGlobal
.lpDDCBtmp
->HALDDExeBuf
,&This
->HalInfo
.lpDDExeBufCallbacks
,sizeof(DDHAL_DDEXEBUFCALLBACKS
));
127 /************************************************************************/
128 /* Set up the rest of the callbacks all callbacks we get back from */
129 /* gdi32.dll is user mode */
130 /************************************************************************/
132 /* Todo add a check see if HalInfo.GetDriverInfo is supported or not */
134 /* Do not trust msdn what it say about dwContext it is not in use for
135 windows nt, it is in use for all os, and it always pont to
136 DirectDrawGlobal.hDD */
138 /* FIXME add all callback that have been commect out to gpl */
139 /* FIXME free the memmor that being alloc when ddraw.dll exists */
140 /* FIXME add check for DriverInfo if the handle or not */
142 DDHAL_GETDRIVERINFODATA DriverInfo
;
143 memset(&DriverInfo
,0, sizeof(DDHAL_GETDRIVERINFODATA
));
144 DriverInfo
.dwSize
= sizeof(DDHAL_GETDRIVERINFODATA
);
145 DriverInfo
.dwContext
= This
->DirectDrawGlobal
.hDD
;
148 /* Get ColorControlCallbacks */
149 DriverInfo
.guidInfo
= GUID_ColorControlCallbacks
;
150 DriverInfo
.lpvData
= &This
->DirectDrawGlobal
.lpDDCBtmp
->HALDDColorControl
;
151 DriverInfo
.dwExpectedSize
= sizeof(DDHAL_DDCOLORCONTROLCALLBACKS
);
152 This
->HalInfo
.GetDriverInfo( &DriverInfo
);
155 /* Get the GUID_D3DCallbacks callback */
157 /* Problem with include files
158 DDHAL_DDMISCELLANEOUSCALLBACKS misc;
159 DriverInfo.guidInfo = GUID_D3DCallbacks;
160 DriverInfo.lpvData = &misc;
161 DriverInfo.dwExpectedSize = sizeof();
162 This->HalInfo.GetDriverInfo( &DriverInfo);*/
164 /* Get the D3DCallbacks2 */
165 This
->DirectDrawGlobal
.lpD3DHALCallbacks2
= (ULONG_PTR
)HeapAlloc(GetProcessHeap(), 0, sizeof(D3DHAL_CALLBACKS2
));
166 DriverInfo
.guidInfo
= GUID_D3DCallbacks2
;
167 DriverInfo
.lpvData
= (PVOID
)This
->DirectDrawGlobal
.lpD3DHALCallbacks2
;
168 DriverInfo
.dwExpectedSize
= sizeof(D3DHAL_CALLBACKS2
);
169 This
->HalInfo
.GetDriverInfo( &DriverInfo
);
172 /* Get the D3DCallbacks3 */
173 This
->DirectDrawGlobal
.lpD3DHALCallbacks
= (ULONG_PTR
)HeapAlloc(GetProcessHeap(), 0, sizeof(D3DHAL_CALLBACKS3
));
174 DriverInfo
.guidInfo
= GUID_D3DCallbacks3
;
175 DriverInfo
.lpvData
= (PVOID
)This
->DirectDrawGlobal
.lpD3DHALCallbacks
;
176 DriverInfo
.dwExpectedSize
= sizeof(D3DHAL_CALLBACKS3
);
177 This
->HalInfo
.GetDriverInfo( &DriverInfo
);
180 /* Get the misc callback */
181 /* Problem with include files
182 DriverInfo.guidInfo = GUID_D3DCaps;
183 DriverInfo.lpvData = &misc;
184 DriverInfo.dwExpectedSize = sizeof();
185 This->HalInfo.GetDriverInfo( &DriverInfo);
188 /* Get the D3DExtendedCaps */
190 This
->DirectDrawGlobal
.lpD3DExtendedCaps
= (ULONG_PTR
)HeapAlloc(GetProcessHeap(), 0, sizeof(D3DHAL_D3DEXTENDEDCAPS
));
191 DriverInfo
.guidInfo
= GUID_D3DExtendedCaps
;
192 DriverInfo
.lpvData
= (PVOID
) This
->DirectDrawGlobal
.lpD3DExtendedCaps
;
193 DriverInfo
.dwExpectedSize
= sizeof(D3DHAL_D3DEXTENDEDCAPS
);
194 This
->HalInfo
.GetDriverInfo( &DriverInfo
);
197 /* Get the D3DParseUnknownCommandCallback */
198 /* D3dDrawPrimitives2 callback where should it be fill in
199 DriverInfo.guidInfo = GUID_D3DParseUnknownCommandCallback;
200 DriverInfo.lpvData = &misc;
201 DriverInfo.dwExpectedSize = sizeof();
202 This->HalInfo.GetDriverInfo( &DriverInfo);
205 /* Get the GetHeapAlignment */
206 /* where should it be fill in
207 DriverInfo.guidInfo = GUID_GetHeapAlignment;
208 DriverInfo.lpvData = &misc;
209 DriverInfo.dwExpectedSize = sizeof();
210 This->HalInfo.GetDriverInfo( &DriverInfo);
214 /* Get the KernelCallbacks */
215 DriverInfo
.guidInfo
= GUID_KernelCallbacks
;
216 DriverInfo
.lpvData
= &This
->DirectDrawGlobal
.lpDDCBtmp
->HALDDKernel
;
217 DriverInfo
.dwExpectedSize
= sizeof(DDHAL_DDKERNELCALLBACKS
);
218 This
->HalInfo
.GetDriverInfo( &DriverInfo
);
221 /* Get the KernelCaps */
222 This
->DirectDrawGlobal
.lpDDKernelCaps
= (LPDDKERNELCAPS
)HeapAlloc(GetProcessHeap(), 0, sizeof(DDHAL_DDKERNELCALLBACKS
));
223 DriverInfo
.guidInfo
= GUID_KernelCaps
;
224 DriverInfo
.lpvData
= (PVOID
) This
->DirectDrawGlobal
.lpDDKernelCaps
;
225 DriverInfo
.dwExpectedSize
= sizeof(DDHAL_DDKERNELCALLBACKS
);
226 This
->HalInfo
.GetDriverInfo( &DriverInfo
);
229 /* Get the MiscellaneousCallbacks */
230 DriverInfo
.guidInfo
= GUID_MiscellaneousCallbacks
;
231 DriverInfo
.lpvData
= &This
->DirectDrawGlobal
.lpDDCBtmp
->HALDDMiscellaneous
;
232 DriverInfo
.dwExpectedSize
= sizeof(DDHAL_DDMISCELLANEOUSCALLBACKS
);
233 This
->HalInfo
.GetDriverInfo( &DriverInfo
);
236 /* Get the Miscellaneous2Callbacks */
237 /* Not in the DDRAWI_DIRECTDRAW_GBL we map it up as private
238 Contain CreatesurfaceEx and other nice callbacks */
239 DriverInfo
.guidInfo
= GUID_Miscellaneous2Callbacks
;
240 DriverInfo
.lpvData
= &This
->Misc2Callback
;
241 DriverInfo
.dwExpectedSize
= sizeof(DDHAL_DDMISCELLANEOUSCALLBACKS
);
242 This
->HalInfo
.GetDriverInfo( &DriverInfo
);
245 /* Get the MotionCompCallbacks */
246 DriverInfo
.guidInfo
= GUID_MotionCompCallbacks
;
247 DriverInfo
.lpvData
= &This
->DirectDrawGlobal
.lpDDCBtmp
->HALDDMotionComp
;
248 DriverInfo
.dwExpectedSize
= sizeof(DDHAL_DDMOTIONCOMPCALLBACKS
);
249 This
->HalInfo
.GetDriverInfo( &DriverInfo
);
252 /* Get the NonLocalVidMemCaps */
253 This
->DirectDrawGlobal
.lpddNLVCaps
= (LPDDNONLOCALVIDMEMCAPS
)HeapAlloc(GetProcessHeap(), 0, sizeof(DDNONLOCALVIDMEMCAPS
));
254 DriverInfo
.guidInfo
= GUID_NonLocalVidMemCaps
;
255 DriverInfo
.lpvData
= (PVOID
)This
->DirectDrawGlobal
.lpddNLVCaps
;
256 DriverInfo
.dwExpectedSize
= sizeof(DDNONLOCALVIDMEMCAPS
);
257 This
->HalInfo
.GetDriverInfo( &DriverInfo
);
260 /* Get the NTCallbacks */
262 DriverInfo.guidInfo = GUID_NTCallbacks;
263 DriverInfo.lpvData = &misc;
264 DriverInfo.dwExpectedSize = sizeof();
265 This->HalInfo.GetDriverInfo( &DriverInfo);
268 /* Get the NTPrivateDriverCaps */
270 DriverInfo.guidInfo = GUID_NTPrivateDriverCaps;
271 DriverInfo.lpvData = &misc;
272 DriverInfo.dwExpectedSize = sizeof();
273 This->HalInfo.GetDriverInfo( &DriverInfo);
276 /* Get the UpdateNonLocalHeap */
278 DriverInfo.guidInfo = GUID_UpdateNonLocalHeap;
279 DriverInfo.lpvData = &misc;
280 DriverInfo.dwExpectedSize = sizeof();
281 This->HalInfo.GetDriverInfo( &DriverInfo);
284 /* Get the VideoPortCallbacks */
285 DriverInfo
.guidInfo
= GUID_VideoPortCallbacks
;
286 DriverInfo
.lpvData
= &This
->DirectDrawGlobal
.lpDDCBtmp
->HALDDVideoPort
;
287 DriverInfo
.dwExpectedSize
= sizeof(DDHAL_DDVIDEOPORTCALLBACKS
);
288 This
->HalInfo
.GetDriverInfo( &DriverInfo
);
291 /* Get the VideoPortCaps */
292 This
->DirectDrawGlobal
.lpDDVideoPortCaps
= (LPDDVIDEOPORTCAPS
)HeapAlloc(GetProcessHeap(), 0, sizeof(DDVIDEOPORTCAPS
));
293 DriverInfo
.guidInfo
= GUID_VideoPortCaps
;
294 DriverInfo
.lpvData
= (PVOID
)This
->DirectDrawGlobal
.lpDDVideoPortCaps
;
295 DriverInfo
.dwExpectedSize
= sizeof(DDVIDEOPORTCAPS
);
296 This
->HalInfo
.GetDriverInfo( &DriverInfo
);
299 /* Get the ZPixelFormats */
300 This
->DirectDrawGlobal
.lpZPixelFormats
= (LPDDPIXELFORMAT
)HeapAlloc(GetProcessHeap(), 0, sizeof(DDPIXELFORMAT
));
301 DriverInfo
.guidInfo
= GUID_ZPixelFormats
;
302 DriverInfo
.lpvData
= (PVOID
)This
->DirectDrawGlobal
.lpZPixelFormats
;
303 DriverInfo
.dwExpectedSize
= sizeof(DDPIXELFORMAT
);
304 This
->HalInfo
.GetDriverInfo( &DriverInfo
);
308 /* Setup some info from the callbacks we got */
310 /* FIXME do more callbacks and fill the gpl struct */
312 DDHAL_GETAVAILDRIVERMEMORYDATA mem
;
313 mem
.lpDD
= &This
->DirectDrawGlobal
;
315 This
->DirectDrawGlobal
.lpDDCBtmp
->HALDDMiscellaneous
.GetAvailDriverMemory(&mem
);
317 This
->DirectDrawGlobal
.ddCaps
.dwVidMemFree
= mem
.dwFree
;
318 This
->DirectDrawGlobal
.ddCaps
.dwVidMemTotal
= mem
.dwTotal
;
324 /* Now all setup for HAL is done and we hopply do not have forget anything */
329 HRESULT
Hal_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 iface
)
335 VOID
Hal_DirectDraw_Release (LPDIRECTDRAW7 iface
)
337 IDirectDrawImpl
* This
= (IDirectDrawImpl
*)iface
;
339 DdDeleteDirectDrawObject (&This
->DirectDrawGlobal
);
341 if(This
->HalInfo
.vmiData
.pvmList
)
342 HeapFree(GetProcessHeap(), 0, This
->HalInfo
.vmiData
.pvmList
);
343 if(This
->DirectDrawGlobal
.lpdwFourCC
)
344 HeapFree(GetProcessHeap(), 0, This
->DirectDrawGlobal
.lpdwFourCC
);
345 if(This
->DirectDrawGlobal
.lpZPixelFormats
)
346 HeapFree(GetProcessHeap(), 0, This
->DirectDrawGlobal
.lpZPixelFormats
);
347 if(((LPD3DHAL_GLOBALDRIVERDATA
)This
->DirectDrawGlobal
.lpD3DGlobalDriverData
)->lpTextureFormats
)
348 HeapFree(GetProcessHeap(), 0, ((LPD3DHAL_GLOBALDRIVERDATA
)This
->DirectDrawGlobal
.lpD3DGlobalDriverData
)->lpTextureFormats
);
350 if(This
->DirectDrawGlobal
.lpDDCBtmp
)
351 HeapFree(GetProcessHeap(), 0, This
->DirectDrawGlobal
.lpDDCBtmp
);
352 if(This
->DirectDrawGlobal
.lpD3DHALCallbacks
)
353 HeapFree(GetProcessHeap(), 0, (PVOID
)This
->DirectDrawGlobal
.lpD3DHALCallbacks
);
354 if(This
->DirectDrawGlobal
.lpD3DGlobalDriverData
)
355 HeapFree(GetProcessHeap(), 0, (PVOID
)This
->DirectDrawGlobal
.lpD3DGlobalDriverData
);
359 HRESULT
Hal_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface
, LPDDSCAPS2 ddscaps
,
360 LPDWORD total
, LPDWORD free
)
362 IDirectDrawImpl
* This
= (IDirectDrawImpl
*)iface
;
364 DDHAL_GETAVAILDRIVERMEMORYDATA mem
;
366 if (!(This
->DirectDrawGlobal
.lpDDCBtmp
->HALDDMiscellaneous
.dwFlags
& DDHAL_MISCCB32_GETAVAILDRIVERMEMORY
))
368 return DDERR_NODRIVERSUPPORT
;
371 mem
.lpDD
= &This
->DirectDrawGlobal
;
372 mem
.ddRVal
= DDERR_NOTPALETTIZED
;
374 if (This
->DirectDrawGlobal
.lpDDCBtmp
->HALDDMiscellaneous
.GetAvailDriverMemory(&mem
) != DDHAL_DRIVER_HANDLED
)
376 return DDERR_NODRIVERSUPPORT
;
379 ddscaps
->dwCaps
= mem
.DDSCaps
.dwCaps
;
380 ddscaps
->dwCaps2
= mem
.ddsCapsEx
.dwCaps2
;
381 ddscaps
->dwCaps3
= mem
.ddsCapsEx
.dwCaps3
;
382 ddscaps
->dwCaps4
= mem
.ddsCapsEx
.dwCaps4
;
383 *total
= mem
.dwTotal
;
389 HRESULT
Hal_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface
, DWORD dwFlags
,HANDLE h
)
392 IDirectDrawImpl
* This
= (IDirectDrawImpl
*)iface
;
394 DDHAL_WAITFORVERTICALBLANKDATA WaitVectorData
;
396 if (!(This
->DirectDrawGlobal
.lpDDCBtmp
->HALDD
.dwFlags
& DDHAL_CB32_WAITFORVERTICALBLANK
))
398 return DDERR_NODRIVERSUPPORT
;
401 WaitVectorData
.lpDD
= &This
->DirectDrawGlobal
;
402 WaitVectorData
.dwFlags
= dwFlags
;
403 WaitVectorData
.hEvent
= (DWORD
)h
;
404 WaitVectorData
.ddRVal
= DDERR_NOTPALETTIZED
;
406 if (This
->DirectDrawGlobal
.lpDDCBtmp
->HALDD
.WaitForVerticalBlank(&WaitVectorData
) != DDHAL_DRIVER_HANDLED
)
408 return DDERR_NODRIVERSUPPORT
;
411 return WaitVectorData
.ddRVal
;
414 HRESULT
Hal_DirectDraw_GetScanLine(LPDIRECTDRAW7 iface
, LPDWORD lpdwScanLine
)
416 IDirectDrawImpl
* This
= (IDirectDrawImpl
*)iface
;
418 DDHAL_GETSCANLINEDATA GetScan
;
420 if (!(This
->DirectDrawGlobal
.lpDDCBtmp
->HALDD
.dwFlags
& DDHAL_CB32_GETSCANLINE
))
422 return DDERR_NODRIVERSUPPORT
;
425 GetScan
.lpDD
= &This
->DirectDrawGlobal
;
426 GetScan
.ddRVal
= DDERR_NOTPALETTIZED
;
428 if (This
->DirectDrawGlobal
.lpDDCBtmp
->HALDD
.GetScanLine(&GetScan
) != DDHAL_DRIVER_HANDLED
)
430 return DDERR_NODRIVERSUPPORT
;
433 *lpdwScanLine
= GetScan
.ddRVal
;
434 return GetScan
.ddRVal
;
437 HRESULT
Hal_DirectDraw_FlipToGDISurface(LPDIRECTDRAW7 iface
)
439 IDirectDrawImpl
* This
= (IDirectDrawImpl
*)iface
;
441 DDHAL_FLIPTOGDISURFACEDATA FlipGdi
;
443 if (!(This
->DirectDrawGlobal
.lpDDCBtmp
->HALDD
.dwFlags
& DDHAL_CB32_FLIPTOGDISURFACE
))
445 return DDERR_NODRIVERSUPPORT
;
448 FlipGdi
.lpDD
= &This
->DirectDrawGlobal
;
449 FlipGdi
.ddRVal
= DDERR_NOTPALETTIZED
;
451 if (This
->DirectDrawGlobal
.lpDDCBtmp
->HALDD
.FlipToGDISurface(&FlipGdi
) != DDHAL_DRIVER_HANDLED
)
453 return DDERR_NODRIVERSUPPORT
;
456 /* FIXME where should FlipGdi.dwToGDI be fill in */
457 return FlipGdi
.ddRVal
;
460 HRESULT
Hal_DirectDraw_SetDisplayMode (LPDIRECTDRAW7 iface
, DWORD dwWidth
, DWORD dwHeight
,
461 DWORD dwBPP
, DWORD dwRefreshRate
, DWORD dwFlags
)
463 DDHAL_SETMODEDATA mode
;
465 IDirectDrawImpl
* This
= (IDirectDrawImpl
*)iface
;
467 if (!(This
->DirectDrawGlobal
.lpDDCBtmp
->HALDD
.dwFlags
& DDHAL_CB32_SETMODE
))
469 return DDERR_NODRIVERSUPPORT
;
472 mode
.lpDD
= &This
->DirectDrawGlobal
;
473 mode
.ddRVal
= DDERR_NODRIVERSUPPORT
;
475 /* FIXME : add search for which mode.ModeIndex we should use */
476 /* FIXME : fill the mode.inexcl; */
477 /* FIXME : fill the mode.useRefreshRate; */
480 if (This->DirectDrawGlobal.lpDDCBtmp->HALDD.SetMode(&mode) != DDHAL_DRIVER_HANDLED)
482 return DDERR_NODRIVERSUPPORT;
487 /* return mode.ddRVal */