d3drm: Add viewport to the device before setting viewport parameters.

Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Matteo Bruni 2018-04-20 00:55:39 +02:00 committed by Alexandre Julliard
parent 8c0c82d760
commit ceba01e2ba
1 changed files with 3 additions and 3 deletions

View File

@ -339,6 +339,9 @@ static HRESULT WINAPI d3drm_viewport2_Init(IDirect3DRMViewport2 *iface, IDirect3
if (FAILED(hr = IDirect3D_CreateViewport(d3d1, &viewport->d3d_viewport, NULL)))
goto cleanup;
if (FAILED(hr = IDirect3DDevice_AddViewport(d3d_device, viewport->d3d_viewport)))
goto cleanup;
vp.dwSize = sizeof(vp);
vp.dwWidth = width;
vp.dwHeight = height;
@ -355,9 +358,6 @@ static HRESULT WINAPI d3drm_viewport2_Init(IDirect3DRMViewport2 *iface, IDirect3
if (FAILED(hr = IDirect3DViewport_SetViewport(viewport->d3d_viewport, &vp)))
goto cleanup;
if (FAILED(hr = IDirect3DDevice_AddViewport(d3d_device, viewport->d3d_viewport)))
goto cleanup;
if (FAILED(hr = IDirect3DRMFrame3_QueryInterface(camera, &IID_IDirect3DRMFrame, (void **)&viewport->camera)))
goto cleanup;