From 1ad37b3ad94242027f23e3529c06465631b1e5e0 Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Sun, 23 Oct 2005 19:24:42 +0000 Subject: [PATCH] first working api is GetCaps for HAL. rember we do not support HEL, and we are missing GdiEntry2 in ros, so it will not working in reactos until gdientry2 are inplace. svn path=/trunk/; revision=18722 --- reactos/lib/ddraw/hal/ddraw.c | 54 +++++++++++++++++++++++++++------- reactos/lib/ddraw/main/ddraw.c | 20 ++++++++++++- 2 files changed, 62 insertions(+), 12 deletions(-) diff --git a/reactos/lib/ddraw/hal/ddraw.c b/reactos/lib/ddraw/hal/ddraw.c index 0c4336d8ef2..2e9d924784c 100644 --- a/reactos/lib/ddraw/hal/ddraw.c +++ b/reactos/lib/ddraw/hal/ddraw.c @@ -80,18 +80,50 @@ HRESULT Hal_DirectDraw_Initialize (LPDIRECTDRAW7 iface) return 1; } - /* fill some extra data */ - This->DirectDrawGlobal.vmiData.dwDisplayWidth = This->Width; - This->DirectDrawGlobal.vmiData.dwDisplayHeight = This->Height; - This->DirectDrawGlobal.vmiData.lDisplayPitch = This->Width * This->Bpp/8; - This->DirectDrawGlobal.vmiData.dwOffscreenAlign = 64; - This->DirectDrawGlobal.vmiData.dwOverlayAlign = 64; - This->DirectDrawGlobal.vmiData.dwTextureAlign = 64; - This->DirectDrawGlobal.vmiData.dwZBufferAlign = 64; - This->DirectDrawGlobal.vmiData.dwAlphaAlign = 64; - //This->DirectDrawGlobal.vmiData.ddpfDisplay; // This has to be filled + /* Copy HalInfo to DirectDrawGlobal */ - This->DirectDrawGlobal.ddCaps = This->HalInfo.ddCaps; + /* have not check where it should go into yet + LPDDHAL_DDCALLBACKS lpDDCallbacks; + LPDDHAL_DDSURFACECALLBACKS lpDDSurfaceCallbacks; + LPDDHAL_DDPALETTECALLBACKS lpDDPaletteCallbacks; + */ + + RtlCopyMemory(&This->DirectDrawGlobal.vmiData,&This->HalInfo.vmiData,sizeof(VIDMEMINFO)); + RtlCopyMemory(&This->DirectDrawGlobal.ddCaps,&This->HalInfo.ddCaps,sizeof(DDCORECAPS)); + This->DirectDrawGlobal.dwMonitorFrequency = This->HalInfo.dwMonitorFrequency; + + /* have not check where it should go into yet + LPDDHAL_GETDRIVERINFO GetDriverInfo; + */ + + This->DirectDrawGlobal.dwModeIndex = This->HalInfo.dwModeIndex; + + /* have not check where it should go into yet + LPDWORD lpdwFourCC; + */ + + This->DirectDrawGlobal.dwNumModes = This->HalInfo.dwNumModes; + This->DirectDrawGlobal.lpModeInfo = This->HalInfo.lpModeInfo; + + /* have not check where it should go into yet + DWORD dwFlags; + */ + + /* Unsure which of these two for lpPDevice + This->DirectDrawGlobal.dwPDevice = This->HalInfo.lpPDevice; + This->lpDriverHandle = This->HalInfo.lpPDevice; + */ + + This->DirectDrawGlobal.hInstance = This->HalInfo.hInstance; + + /* have not check where it should go into yet + ULONG_PTR lpD3DGlobalDriverData; + ULONG_PTR lpD3DHALCallbacks; + LPDDHAL_DDEXEBUFCALLBACKS lpDDExeBufCallbacks; + */ + + + This->DirectDrawGlobal.lpDDCBtmp->HALDD = This->DirectDrawGlobal.lpDDCBtmp->cbDDCallbacks; This->DirectDrawGlobal.lpDDCBtmp->HALDDSurface = This->DirectDrawGlobal.lpDDCBtmp->cbDDSurfaceCallbacks; This->DirectDrawGlobal.lpDDCBtmp->HALDDExeBuf = This->DirectDrawGlobal.lpDDCBtmp->cbDDExeBufCallbacks; diff --git a/reactos/lib/ddraw/main/ddraw.c b/reactos/lib/ddraw/main/ddraw.c index c7c25d3a4ae..9ba7182f822 100644 --- a/reactos/lib/ddraw/main/ddraw.c +++ b/reactos/lib/ddraw/main/ddraw.c @@ -223,7 +223,25 @@ HRESULT WINAPI Main_DirectDraw_FlipToGDISurface(LPDIRECTDRAW7 iface) HRESULT WINAPI Main_DirectDraw_GetCaps(LPDIRECTDRAW7 iface, LPDDCAPS pDriverCaps, LPDDCAPS pHELCaps) { - DX_STUB; + DWORD status = DD_FALSE; + IDirectDrawImpl *This = (IDirectDrawImpl *)iface; + + if (pDriverCaps != NULL) + { + RtlCopyMemory(pDriverCaps,&This->DirectDrawGlobal.ddCaps,sizeof(DDCORECAPS)); + status = DD_OK; + } + + if (pHELCaps != NULL) + { + RtlCopyMemory(pDriverCaps,&This->DirectDrawGlobal.ddHELCaps,sizeof(DDCORECAPS)); + status = DD_OK; + } + + /* Both caps mixed ?? */ + /* DDCORECAPS ddBothCaps; */ + + return status; } HRESULT WINAPI Main_DirectDraw_GetDisplayMode(LPDIRECTDRAW7 iface, LPDDSURFACEDESC2 pDDSD)