mirror of
https://github.com/reactos/wine.git
synced 2024-11-26 05:00:30 +00:00
wined3d: Set the initial viewport in InitStartupStateBlock().
>From 8aa3fb7ceb6fb93abf71520c852403284a9f8c76 Mon Sep 17 00:00:00 2001 From: Henri Verbeet <hverbeet@codeweavers.com> Date: Fri, 19 Dec 2008 19:21:55 +0100 Subject: wined3d: Set the initial viewport in InitStartupStateBlock().
This commit is contained in:
parent
6e07c7bc14
commit
ef7365a4cd
@ -2181,17 +2181,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface, WINED3DPR
|
||||
|
||||
ENTER_GL();
|
||||
|
||||
{ /* Set a default viewport */
|
||||
WINED3DVIEWPORT vp;
|
||||
vp.X = 0;
|
||||
vp.Y = 0;
|
||||
vp.Width = pPresentationParameters->BackBufferWidth;
|
||||
vp.Height = pPresentationParameters->BackBufferHeight;
|
||||
vp.MinZ = 0.0f;
|
||||
vp.MaxZ = 1.0f;
|
||||
IWineD3DDevice_SetViewport((IWineD3DDevice *)This, &vp);
|
||||
}
|
||||
|
||||
/* Initialize the current view state */
|
||||
This->view_ident = 1;
|
||||
This->contexts[0]->last_was_rhw = 0;
|
||||
@ -7081,16 +7070,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice* iface, WINED3DPRE
|
||||
(pPresentationParameters->BackBufferWidth != swapchain->presentParms.BackBufferWidth ||
|
||||
pPresentationParameters->BackBufferHeight != swapchain->presentParms.BackBufferHeight))
|
||||
{
|
||||
WINED3DVIEWPORT vp;
|
||||
UINT i;
|
||||
|
||||
vp.X = 0;
|
||||
vp.Y = 0;
|
||||
vp.Width = pPresentationParameters->BackBufferWidth;
|
||||
vp.Height = pPresentationParameters->BackBufferHeight;
|
||||
vp.MinZ = 0;
|
||||
vp.MaxZ = 1;
|
||||
|
||||
if(!pPresentationParameters->Windowed) {
|
||||
DisplayModeChanged = TRUE;
|
||||
}
|
||||
@ -7104,10 +7085,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice* iface, WINED3DPRE
|
||||
if(This->auto_depth_stencil_buffer) {
|
||||
updateSurfaceDesc((IWineD3DSurfaceImpl *)This->auto_depth_stencil_buffer, pPresentationParameters);
|
||||
}
|
||||
|
||||
|
||||
/* Now set the new viewport */
|
||||
IWineD3DDevice_SetViewport(iface, &vp);
|
||||
}
|
||||
|
||||
if((pPresentationParameters->Windowed && !swapchain->presentParms.Windowed) ||
|
||||
|
@ -1244,6 +1244,8 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_InitStartupStateBlock(IWineD3DStat
|
||||
/* check the return values, because the GetBackBuffer call isn't valid for ddraw */
|
||||
hr = IWineD3DDevice_GetSwapChain(device, 0, &swapchain);
|
||||
if( hr == WINED3D_OK && swapchain != NULL) {
|
||||
WINED3DVIEWPORT vp;
|
||||
|
||||
hr = IWineD3DSwapChain_GetBackBuffer(swapchain, 0, WINED3DBACKBUFFER_TYPE_MONO, &backbuffer);
|
||||
if( hr == WINED3D_OK && backbuffer != NULL) {
|
||||
IWineD3DSurface_GetDesc(backbuffer, &desc);
|
||||
@ -1258,6 +1260,16 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_InitStartupStateBlock(IWineD3DStat
|
||||
ERR("This should never happen, expect rendering issues!\n");
|
||||
}
|
||||
}
|
||||
|
||||
/* Set the default viewport */
|
||||
vp.X = 0;
|
||||
vp.Y = 0;
|
||||
vp.Width = ((IWineD3DSwapChainImpl *)swapchain)->presentParms.BackBufferWidth;
|
||||
vp.Height = ((IWineD3DSwapChainImpl *)swapchain)->presentParms.BackBufferHeight;
|
||||
vp.MinZ = 0.0f;
|
||||
vp.MaxZ = 1.0f;
|
||||
IWineD3DDevice_SetViewport(device, &vp);
|
||||
|
||||
IWineD3DSwapChain_Release(swapchain);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user