mirror of
https://github.com/reactos/reactos.git
synced 2025-04-19 20:19:26 +00:00
Some formatting and implement SetDisplayMode.
svn path=/trunk/; revision=26793
This commit is contained in:
parent
149c5b1cae
commit
ada941267c
7 changed files with 65 additions and 21 deletions
|
@ -9,7 +9,7 @@
|
|||
*/
|
||||
|
||||
|
||||
#include "../rosdraw.h"
|
||||
#include "rosdraw.h"
|
||||
|
||||
HRESULT
|
||||
WINAPI
|
||||
|
@ -117,6 +117,65 @@ Main_DirectDraw_Compact(LPDIRECTDRAW7 iface)
|
|||
return DD_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI
|
||||
Main_DirectDraw_SetDisplayMode (LPDIRECTDRAW7 iface, DWORD dwWidth, DWORD dwHeight,
|
||||
DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags)
|
||||
{
|
||||
LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface;
|
||||
DX_WINDBG_trace();
|
||||
|
||||
// FIXME: Check primary if surface is locked / busy etc.
|
||||
|
||||
// Check Parameter
|
||||
if(dwFlags != 0)
|
||||
{
|
||||
return DDERR_INVALIDPARAMS;
|
||||
}
|
||||
|
||||
if ((!dwHeight || This->lpLcl->lpGbl->vmiData.dwDisplayHeight == dwHeight) &&
|
||||
(!dwWidth || This->lpLcl->lpGbl->vmiData.dwDisplayWidth == dwWidth) &&
|
||||
(!dwBPP || This->lpLcl->lpGbl->vmiData.ddpfDisplay.dwRGBBitCount == dwBPP) &&
|
||||
(!dwRefreshRate || This->lpLcl->lpGbl->dwMonitorFrequency == dwRefreshRate))
|
||||
{
|
||||
return DD_OK; // nothing to do here for us
|
||||
}
|
||||
|
||||
// Here we go
|
||||
DEVMODE DevMode;
|
||||
DevMode.dmFields = 0;
|
||||
if(dwHeight)
|
||||
DevMode.dmFields |= DM_PELSHEIGHT;
|
||||
if(dwWidth)
|
||||
DevMode.dmFields |= DM_PELSWIDTH;
|
||||
if(dwBPP)
|
||||
DevMode.dmFields |= DM_BITSPERPEL;
|
||||
if(dwRefreshRate)
|
||||
DevMode.dmFields |= DM_DISPLAYFREQUENCY;
|
||||
|
||||
DevMode.dmPelsHeight = dwHeight;
|
||||
DevMode.dmPelsWidth = dwWidth;
|
||||
DevMode.dmBitsPerPel = dwBPP;
|
||||
DevMode.dmDisplayFrequency = dwRefreshRate;
|
||||
|
||||
LONG retval = ChangeDisplaySettings(&DevMode, CDS_FULLSCREEN /* | CDS_SET_PRIMARY ? */);
|
||||
DbgPrint("%d\n", retval);
|
||||
|
||||
if(retval == DISP_CHANGE_BADMODE)
|
||||
{
|
||||
return DDERR_UNSUPPORTED;
|
||||
}
|
||||
else if(retval != DISP_CHANGE_SUCCESSFUL)
|
||||
{
|
||||
return DDERR_GENERIC;
|
||||
}
|
||||
|
||||
// Update Interals
|
||||
BOOL ModeChanged;
|
||||
DdReenableDirectDrawObject(This->lpLcl->lpGbl, &ModeChanged);
|
||||
StartDirectDraw((LPDIRECTDRAW)iface, 0, TRUE);
|
||||
|
||||
return DD_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
*/
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include "../rosdraw.h"
|
||||
#include "rosdraw.h"
|
||||
|
||||
/*
|
||||
* Status: Implentation removed due to rewrite
|
||||
|
@ -144,17 +144,6 @@ Main_DirectDraw_RestoreDisplayMode(LPDIRECTDRAW7 iface)
|
|||
DX_STUB;
|
||||
}
|
||||
|
||||
/*
|
||||
* Status: Implentation removed due to rewrite
|
||||
*/
|
||||
HRESULT WINAPI
|
||||
Main_DirectDraw_SetDisplayMode (LPDIRECTDRAW7 iface, DWORD dwWidth, DWORD dwHeight,
|
||||
DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags)
|
||||
{
|
||||
DX_WINDBG_trace();
|
||||
DX_STUB;
|
||||
}
|
||||
|
||||
/*
|
||||
* Status: Implentation removed due to rewrite
|
||||
*/
|
||||
|
|
|
@ -8,11 +8,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
#include "rosdraw.h"
|
||||
#include "d3dhal.h"
|
||||
#include "ddrawgdi.h"
|
||||
|
||||
|
||||
DWORD CALLBACK HelDdSurfAddAttachedSurface(LPDDHAL_ADDATTACHEDSURFACEDATA lpDestroySurface)
|
||||
{
|
||||
|
|
|
@ -94,7 +94,6 @@ void CopyDDSurfDescToDDSurfDesc2(LPDDSURFACEDESC2 dst_pDesc, LPDDSURFACEDESC src
|
|||
dst_pDesc->dwSize = sizeof(DDSURFACEDESC2);
|
||||
}
|
||||
|
||||
|
||||
HRESULT
|
||||
CreatePrimarySurface(LPDDRAWI_DIRECTDRAW_INT This,
|
||||
LPDDRAWI_DDRAWSURFACE_INT *That,
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include "../rosdraw.h"
|
||||
#include "rosdraw.h"
|
||||
|
||||
|
||||
/* FIXME adding hal and hel stub
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include "../rosdraw.h"
|
||||
#include "rosdraw.h"
|
||||
|
||||
HRESULT WINAPI
|
||||
Main_DDrawSurface_QueryInterface(LPDIRECTDRAWSURFACE7 iface, REFIID riid,
|
||||
|
|
|
@ -358,7 +358,6 @@ HRESULT WINAPI
|
|||
StartDirectDrawHal(LPDIRECTDRAW* iface, BOOL reenable)
|
||||
{
|
||||
|
||||
|
||||
LPDWORD mpFourCC;
|
||||
DDHALINFO mHALInfo;
|
||||
BOOL newmode = FALSE;
|
||||
|
@ -368,6 +367,8 @@ StartDirectDrawHal(LPDIRECTDRAW* iface, BOOL reenable)
|
|||
DDHAL_DDEXEBUFCALLBACKS mD3dBufferCallbacks;
|
||||
LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface;
|
||||
|
||||
DX_WINDBG_trace();
|
||||
|
||||
RtlZeroMemory(&mHALInfo, sizeof(DDHALINFO));
|
||||
RtlZeroMemory(&mD3dCallbacks, sizeof(D3DHAL_CALLBACKS));
|
||||
RtlZeroMemory(&mD3dDriverData, sizeof(D3DHAL_GLOBALDRIVERDATA));
|
||||
|
|
Loading…
Reference in a new issue