mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 08:55:19 +00:00
Implement IDirectDraw7::EnumDisplayModes and IDirectDraw7::RestoreDisplayMode
svn path=/trunk/; revision=26849
This commit is contained in:
parent
8bbbeb08ba
commit
ded6f889ce
2 changed files with 81 additions and 21 deletions
|
@ -11,6 +11,68 @@
|
|||
|
||||
#include "rosdraw.h"
|
||||
|
||||
HRESULT WINAPI
|
||||
Main_DirectDraw_EnumDisplayModes(LPDIRECTDRAW7 iface, DWORD dwFlags,
|
||||
LPDDSURFACEDESC2 pDDSD, LPVOID pContext, LPDDENUMMODESCALLBACK2 pCallback)
|
||||
{
|
||||
LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface;
|
||||
DX_WINDBG_trace();
|
||||
|
||||
if(!pCallback)
|
||||
return DDERR_INVALIDPARAMS;
|
||||
|
||||
// FIXME: Process DDEDM_STANDARDVGAMODES flag
|
||||
|
||||
int i;
|
||||
for (i=0; i<This->lpLcl->lpGbl->dwNumModes; i++)
|
||||
{
|
||||
DDSURFACEDESC2 SurfaceDesc;
|
||||
|
||||
// FIXME: do we need to set/test more sturcture members ?
|
||||
SurfaceDesc.dwSize = sizeof (DDSURFACEDESC2);
|
||||
SurfaceDesc.dwFlags = DDSD_HEIGHT | DDSD_WIDTH | DDSD_REFRESHRATE | DDSD_WIDTH | DDSD_PIXELFORMAT;
|
||||
SurfaceDesc.dwHeight = This->lpLcl->lpGbl->lpModeInfo[i].dwWidth;
|
||||
SurfaceDesc.dwWidth = This->lpLcl->lpGbl->lpModeInfo[i].dwHeight;
|
||||
SurfaceDesc.lPitch = This->lpLcl->lpGbl->lpModeInfo[i].lPitch;
|
||||
SurfaceDesc.dwRefreshRate = This->lpLcl->lpGbl->lpModeInfo[i].wRefreshRate;
|
||||
|
||||
SurfaceDesc.ddpfPixelFormat.dwSize = sizeof (DDPIXELFORMAT);
|
||||
SurfaceDesc.ddpfPixelFormat.dwFlags = DDPF_RGB;
|
||||
SurfaceDesc.ddpfPixelFormat.dwRBitMask = This->lpLcl->lpGbl->lpModeInfo[i].dwRBitMask;
|
||||
SurfaceDesc.ddpfPixelFormat.dwGBitMask = This->lpLcl->lpGbl->lpModeInfo[i].dwGBitMask;
|
||||
SurfaceDesc.ddpfPixelFormat.dwBBitMask = This->lpLcl->lpGbl->lpModeInfo[i].dwBBitMask;
|
||||
SurfaceDesc.ddpfPixelFormat.dwRGBAlphaBitMask = This->lpLcl->lpGbl->lpModeInfo[i].dwAlphaBitMask;
|
||||
SurfaceDesc.ddpfPixelFormat.dwRGBBitCount = This->lpLcl->lpGbl->lpModeInfo[i].dwBPP;
|
||||
|
||||
if(dwFlags & DDEDM_REFRESHRATES && SurfaceDesc.dwRefreshRate != This->lpLcl->lpGbl->dwMonitorFrequency)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if(pDDSD)
|
||||
{
|
||||
if(pDDSD->dwFlags & DDSD_HEIGHT && pDDSD->dwHeight != SurfaceDesc.dwHeight)
|
||||
continue;
|
||||
|
||||
else if(pDDSD->dwFlags & DDSD_WIDTH && pDDSD->dwWidth != SurfaceDesc.dwWidth)
|
||||
continue;
|
||||
|
||||
else if(pDDSD->dwFlags & DDSD_PITCH && pDDSD->lPitch != SurfaceDesc.lPitch)
|
||||
continue;
|
||||
|
||||
else if(pDDSD->dwFlags & DDSD_REFRESHRATE && pDDSD->dwRefreshRate != SurfaceDesc.dwRefreshRate)
|
||||
continue;
|
||||
|
||||
else if(pDDSD->dwFlags & DDSD_PIXELFORMAT && pDDSD->ddpfPixelFormat.dwRGBBitCount != SurfaceDesc.ddpfPixelFormat.dwRGBBitCount)
|
||||
continue; // FIXME: test for the other members of ddpfPixelFormat as well
|
||||
}
|
||||
|
||||
(*pCallback)(&SurfaceDesc, pContext);
|
||||
}
|
||||
|
||||
return DD_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI
|
||||
Main_DirectDraw_SetDisplayMode (LPDIRECTDRAW7 iface, DWORD dwWidth, DWORD dwHeight,
|
||||
DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags)
|
||||
|
@ -20,7 +82,7 @@ Main_DirectDraw_SetDisplayMode (LPDIRECTDRAW7 iface, DWORD dwWidth, DWORD dwHeig
|
|||
|
||||
// FIXME: Check primary if surface is locked / busy etc.
|
||||
|
||||
// Check Parameter
|
||||
// Check Parameters
|
||||
if(dwFlags != 0)
|
||||
{
|
||||
return DDERR_INVALIDPARAMS;
|
||||
|
@ -70,6 +132,22 @@ Main_DirectDraw_SetDisplayMode (LPDIRECTDRAW7 iface, DWORD dwWidth, DWORD dwHeig
|
|||
return DD_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI
|
||||
Main_DirectDraw_RestoreDisplayMode (LPDIRECTDRAW7 iface)
|
||||
{
|
||||
LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface;
|
||||
DX_WINDBG_trace();
|
||||
|
||||
ChangeDisplaySettings(NULL, 0);
|
||||
|
||||
// Update Interals
|
||||
BOOL ModeChanged;
|
||||
DdReenableDirectDrawObject(This->lpLcl->lpGbl, &ModeChanged);
|
||||
StartDirectDraw((LPDIRECTDRAW)iface, 0, TRUE);
|
||||
|
||||
return DD_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI
|
||||
Main_DirectDraw_GetMonitorFrequency (LPDIRECTDRAW7 iface, LPDWORD lpFreq)
|
||||
{
|
||||
|
@ -96,6 +174,8 @@ Main_DirectDraw_GetDisplayMode (LPDIRECTDRAW7 iface, LPDDSURFACEDESC2 pDDSD)
|
|||
if (pDDSD->dwSize != sizeof(LPDDSURFACEDESC2))
|
||||
return DDERR_INVALIDPARAMS;
|
||||
|
||||
// FIXME: More stucture members might need to be filled
|
||||
|
||||
pDDSD->dwFlags |= DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT | DDSD_PITCH | DDSD_REFRESHRATE;
|
||||
pDDSD->dwHeight = This->lpLcl->lpGbl->vmiData.dwDisplayWidth;
|
||||
pDDSD->dwWidth = This->lpLcl->lpGbl->vmiData.dwDisplayHeight;
|
||||
|
|
|
@ -38,16 +38,6 @@ HRESULT WINAPI Main_DirectDraw_DuplicateSurface(LPDIRECTDRAW7 iface, LPDIRECTDRA
|
|||
DX_STUB;
|
||||
}
|
||||
|
||||
/*
|
||||
* Status: Implentation removed due to rewrite
|
||||
*/
|
||||
HRESULT WINAPI Main_DirectDraw_EnumDisplayModes(LPDIRECTDRAW7 iface, DWORD dwFlags,
|
||||
LPDDSURFACEDESC2 pDDSD, LPVOID context, LPDDENUMMODESCALLBACK2 callback)
|
||||
{
|
||||
DX_WINDBG_trace();
|
||||
DX_STUB;
|
||||
}
|
||||
|
||||
HRESULT WINAPI
|
||||
Main_DirectDraw_EnumSurfaces(LPDIRECTDRAW7 iface, DWORD dwFlags,
|
||||
LPDDSURFACEDESC2 lpDDSD2, LPVOID context,
|
||||
|
@ -107,16 +97,6 @@ Main_DirectDraw_GetVerticalBlankStatus(LPDIRECTDRAW7 iface, LPBOOL lpbIsInVB)
|
|||
DX_STUB;
|
||||
}
|
||||
|
||||
/*
|
||||
* Status: Implentation removed due to rewrite
|
||||
*/
|
||||
HRESULT WINAPI
|
||||
Main_DirectDraw_RestoreDisplayMode(LPDIRECTDRAW7 iface)
|
||||
{
|
||||
DX_WINDBG_trace();
|
||||
DX_STUB;
|
||||
}
|
||||
|
||||
/*
|
||||
* Status: Implentation removed due to rewrite
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue