implement Main_DirectDraw_GetDisplayMode (not to 100% see the comment)
implement Main_DirectDraw_GetMonitorFrequency but we do not get the freq
at return we need exaime the hal instate.
Modified: trunk/reactos/lib/ddraw/main/ddraw.c
Modified: trunk/reactos/lib/ddraw/rosdraw.h
_____
Modified: trunk/reactos/lib/ddraw/main/ddraw.c
--- trunk/reactos/lib/ddraw/main/ddraw.c 2005-10-23 21:10:58 UTC
(rev 18724)
+++ trunk/reactos/lib/ddraw/main/ddraw.c 2005-10-23 21:17:12 UTC
(rev 18725)
@@ -245,8 +245,52 @@
}
HRESULT WINAPI Main_DirectDraw_GetDisplayMode(LPDIRECTDRAW7 iface,
LPDDSURFACEDESC2 pDDSD)
-{
- DX_STUB;
+{
+ IDirectDrawImpl *This = (IDirectDrawImpl *)iface;
+
+ if (pDDSD == NULL)
+ {
+ return DD_FALSE;
+ }
+
+ pDDSD->dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_PITCH |
DDSD_PIXELFORMAT | DDSD_REFRESHRATE | DDSD_WIDTH;
+ pDDSD->dwHeight =
This->DirectDrawGlobal.vmiData.dwDisplayHeight;
+ pDDSD->dwWidth = This->DirectDrawGlobal.vmiData.dwDisplayWidth;
+
+ /* FIXME Do not use DUMMYUNIONNAME1 some how union lPitch does
not see by the compiler
+ but rest of the union are visable. more header problem ???
+ */
+ pDDSD->DUMMYUNIONNAME1.lPitch =
This->DirectDrawGlobal.vmiData.lDisplayPitch;
+
+
+ /* have not check where I should get hold of this info yet
+ DWORD dwBackBufferCount;
+ */
+
+ pDDSD->dwRefreshRate = This->DirectDrawGlobal.dwMonitorFrequency;
+
+ /* have not check where I should get hold of this info yet
+ DWORD dwAlphaBitDepth;
+ DWORD dwReserved;
+ LPVOID lpSurface;
+ union
+ {
+ DDCOLORKEY ddckCKDestOverlay;
+ DWORD dwEmptyFaceColor;
+ }
+ DDCOLORKEY ddckCKDestBlt;
+ DDCOLORKEY ddckCKSrcOverlay;
+ DDCOLORKEY ddckCKSrcBlt;
+ */
+
+
RtlCopyMemory(&pDDSD->ddpfPixelFormat,&This->DirectDrawGlobal.vmiData.dd
pfDisplay,sizeof(DDPIXELFORMAT));
+
RtlCopyMemory(&pDDSD->ddsCaps,&This->DirectDrawGlobal.ddCaps,sizeof(DDCO
RECAPS));
+
+ /* have not check where I should get hold of this info yet
+ DWORD dwTextureStage;
+ */
+
+ return DD_OK;
}
@@ -263,7 +307,15 @@
HRESULT WINAPI Main_DirectDraw_GetMonitorFrequency(LPDIRECTDRAW7
iface,LPDWORD freq)
{
- DX_STUB;
+ IDirectDrawImpl *This = (IDirectDrawImpl *)iface;
+
+ if (freq == NULL)
+ {
+ return DD_FALSE;
+ }
+
+ *freq = This->DirectDrawGlobal.dwMonitorFrequency;
+ return DD_OK;
}
HRESULT WINAPI Main_DirectDraw_GetScanLine(LPDIRECTDRAW7 iface, LPDWORD
lpdwScanLine)
_____
Modified: trunk/reactos/lib/ddraw/rosdraw.h
--- trunk/reactos/lib/ddraw/rosdraw.h 2005-10-23 21:10:58 UTC (rev
18724)
+++ trunk/reactos/lib/ddraw/rosdraw.h 2005-10-23 21:17:12 UTC (rev
18725)
@@ -3,6 +3,7 @@
/********* Includes *********/
+
#include <windows.h>
#include <stdio.h>
#include <ddraw.h>
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.
Modified: trunk/reactos/lib/ddraw/hal/ddraw.c
Modified: trunk/reactos/lib/ddraw/main/ddraw.c
_____
Modified: trunk/reactos/lib/ddraw/hal/ddraw.c
--- trunk/reactos/lib/ddraw/hal/ddraw.c 2005-10-23 19:18:39 UTC (rev
18721)
+++ trunk/reactos/lib/ddraw/hal/ddraw.c 2005-10-23 19:24:42 UTC (rev
18722)
@@ -80,18 +80,50 @@
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,siz
eof(VIDMEMINFO));
+
RtlCopyMemory(&This->DirectDrawGlobal.ddCaps,&This->HalInfo.ddCaps,sizeo
f(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;
_____
Modified: trunk/reactos/lib/ddraw/main/ddraw.c
--- trunk/reactos/lib/ddraw/main/ddraw.c 2005-10-23 19:18:39 UTC
(rev 18721)
+++ trunk/reactos/lib/ddraw/main/ddraw.c 2005-10-23 19:24:42 UTC
(rev 18722)
@@ -223,7 +223,25 @@
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(DDCORECA
PS));
+ status = DD_OK;
+ }
+
+ if (pHELCaps != NULL)
+ {
+
RtlCopyMemory(pDriverCaps,&This->DirectDrawGlobal.ddHELCaps,sizeof(DDCOR
ECAPS));
+ status = DD_OK;
+ }
+
+ /* Both caps mixed ?? */
+ /* DDCORECAPS ddBothCaps; */
+
+ return status;
}
HRESULT WINAPI Main_DirectDraw_GetDisplayMode(LPDIRECTDRAW7 iface,
LPDDSURFACEDESC2 pDDSD)