ddraw: Pass the fullscreen flag to wined3d.

This commit is contained in:
Stefan Dösinger 2006-09-09 13:33:17 +02:00 committed by Alexandre Julliard
parent 2d5b19c182
commit 6286c4e70d
4 changed files with 21 additions and 0 deletions

View File

@ -550,6 +550,9 @@ IDirectDrawImpl_SetCooperativeLevel(IDirectDraw7 *iface,
{
IWineD3DDevice_SetHWND(This->wineD3DDevice, hwnd);
}
IWineD3DDevice_SetFullscreen(This->wineD3DDevice,
FALSE);
}
else if(cooplevel & DDSCL_FULLSCREEN)
{
@ -571,6 +574,8 @@ IDirectDrawImpl_SetCooperativeLevel(IDirectDraw7 *iface,
if(This->cooperative_level & DDSCL_NORMAL)
{
This->cooperative_level &= ~DDSCL_NORMAL;
IWineD3DDevice_SetFullscreen(This->wineD3DDevice,
TRUE);
}
/* Don't override focus windows or private device windows */

View File

@ -2175,6 +2175,18 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Uninit3D(IWineD3DDevice *iface) {
return WINED3D_OK;
}
static void WINAPI IWineD3DDeviceImpl_SetFullscreen(IWineD3DDevice *iface, BOOL fullscreen) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface;
TRACE("(%p) Setting DDraw fullscreen mode to %s\n", This, fullscreen ? "true" : "false");
/* DirectDraw apps can change between fullscreen and windowed mode after device creation with
* IDirectDraw7::SetCooperativeLevel. The GDI surface implementation needs to know this.
* DDraw doesn't necessarilly have a swapchain, so we have to store the fullscreen flag
* seperately.
*/
This->ddraw_fullscreen = fullscreen;
}
static HRESULT WINAPI IWineD3DDeviceImpl_EnumDisplayModes(IWineD3DDevice *iface, DWORD Flags, UINT Width, UINT Height, WINED3DFORMAT pixelformat, LPVOID context, D3DCB_ENUMDISPLAYMODESCALLBACK callback) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
@ -7965,6 +7977,7 @@ const IWineD3DDeviceVtbl IWineD3DDevice_Vtbl =
/*** Odd functions **/
IWineD3DDeviceImpl_Init3D,
IWineD3DDeviceImpl_Uninit3D,
IWineD3DDeviceImpl_SetFullscreen,
IWineD3DDeviceImpl_EnumDisplayModes,
IWineD3DDeviceImpl_EvictManagedResources,
IWineD3DDeviceImpl_GetAvailableTextureMem,

View File

@ -576,6 +576,7 @@ typedef struct IWineD3DDeviceImpl
IWineD3DSurface *ddraw_primary;
DWORD ddraw_width, ddraw_height;
WINED3DFORMAT ddraw_format;
BOOL ddraw_fullscreen;
/* List of GLSL shader programs and their associated vertex & pixel shaders */
struct list glsl_shader_progs;

View File

@ -381,6 +381,7 @@ DECLARE_INTERFACE_(IWineD3DDevice,IWineD3DBase)
STDMETHOD_(HRESULT,CreatePalette)(THIS_ DWORD Flags, PALETTEENTRY *PalEnt, struct IWineD3DPalette **Palette, IUnknown *Parent);
STDMETHOD(Init3D)(THIS_ WINED3DPRESENT_PARAMETERS* pPresentationParameters, D3DCB_CREATEADDITIONALSWAPCHAIN D3DCB_CreateAdditionalSwapChain);
STDMETHOD(Uninit3D)(THIS);
STDMETHOD_(void, SetFullscreen)(THIS_ BOOL fullscreen);
STDMETHOD(EnumDisplayModes)(THIS_ DWORD Flags, UINT Width, UINT Height, WINED3DFORMAT Format, void *context, D3DCB_ENUMDISPLAYMODESCALLBACK cb) PURE;
STDMETHOD(EvictManagedResources)(THIS) PURE;
STDMETHOD_(UINT, GetAvailableTextureMem)(THIS) PURE;
@ -521,6 +522,7 @@ DECLARE_INTERFACE_(IWineD3DDevice,IWineD3DBase)
#define IWineD3DDevice_CreatePalette(p, a, b, c, d) (p)->lpVtbl->CreatePalette(p, a, b, c, d)
#define IWineD3DDevice_Init3D(p, a, b) (p)->lpVtbl->Init3D(p, a, b)
#define IWineD3DDevice_Uninit3D(p) (p)->lpVtbl->Uninit3D(p)
#define IWineD3DDevice_SetFullscreen(p, a) (p)->lpVtbl->SetFullscreen(p, a)
#define IWineD3DDevice_EnumDisplayModes(p,a,b,c,d,e,f) (p)->lpVtbl->EnumDisplayModes(p,a,b,c,d,e,f)
#define IWineD3DDevice_EvictManagedResources(p) (p)->lpVtbl->EvictManagedResources(p)
#define IWineD3DDevice_GetAvailableTextureMem(p) (p)->lpVtbl->GetAvailableTextureMem(p)