Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
e0db367a
Commit
e0db367a
authored
Aug 28, 2011
by
Stefan Dösinger
Committed by
Alexandre Julliard
Sep 02, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Set the viewport after changing the render target.
parent
5ce2e1f3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
11 deletions
+21
-11
visual.c
dlls/ddraw/tests/visual.c
+21
-11
No files found.
dlls/ddraw/tests/visual.c
View file @
e0db367a
...
...
@@ -210,16 +210,24 @@ out:
return
ret
;
}
/*
* Helper function to get and set the viewport - needed on geforce 8800 on XP - driver bug?
* This is needed after IDirect3DDevice7_SetRenderTarget in combination with offscreen to backbuffer rendering.
*/
static
void
set_the_same_viewport_again
(
IDirect3DDevice7
*
device
)
static
void
set_viewport_size
(
IDirect3DDevice7
*
device
)
{
D3DVIEWPORT7
vp
=
{
0
};
DDSURFACEDESC2
ddsd
;
HRESULT
hr
;
hr
=
IDirect3DDevice7_GetViewport
(
device
,
&
vp
);
ok
(
hr
==
D3D_OK
&&
vp
.
dwWidth
==
640
&&
vp
.
dwHeight
==
480
,
"IDirect3DDevice7_SetViewport returned %08x
\n
"
,
hr
);
IDirectDrawSurface7
*
target
;
hr
=
IDirect3DDevice7_GetRenderTarget
(
device
,
&
target
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice7_GetRenderTarget returned %08x
\n
"
,
hr
);
memset
(
&
ddsd
,
0
,
sizeof
(
ddsd
));
ddsd
.
dwSize
=
sizeof
(
ddsd
);
IDirectDrawSurface7_GetSurfaceDesc
(
target
,
&
ddsd
);
ok
(
hr
==
D3D_OK
,
"IDirectDrawSurface7_GetSurfaceDesc returned %08x
\n
"
,
hr
);
IDirectDrawSurface7_Release
(
target
);
vp
.
dwWidth
=
ddsd
.
dwWidth
;
vp
.
dwHeight
=
ddsd
.
dwHeight
;
hr
=
IDirect3DDevice7_SetViewport
(
device
,
&
vp
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice7_SetViewport returned %08x
\n
"
,
hr
);
return
;
...
...
@@ -831,6 +839,7 @@ static void offscreen_test(IDirect3DDevice7 *device)
if
(
IDirect3DDevice7_BeginScene
(
device
)
==
D3D_OK
)
{
hr
=
IDirect3DDevice7_SetRenderTarget
(
device
,
offscreen
,
0
);
ok
(
hr
==
D3D_OK
,
"SetRenderTarget failed, hr = %08x
\n
"
,
hr
);
set_viewport_size
(
device
);
hr
=
IDirect3DDevice7_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
,
0xffff00ff
,
0
.
0
,
0
);
ok
(
hr
==
D3D_OK
,
"Clear failed, hr = %08x
\n
"
,
hr
);
...
...
@@ -840,7 +849,7 @@ static void offscreen_test(IDirect3DDevice7 *device)
hr
=
IDirect3DDevice7_SetRenderTarget
(
device
,
backbuffer
,
0
);
ok
(
hr
==
D3D_OK
,
"SetRenderTarget failed, hr = %08x
\n
"
,
hr
);
set_
the_same_viewport_again
(
device
);
set_
viewport_size
(
device
);
hr
=
IDirect3DDevice7_SetTexture
(
device
,
0
,
offscreen
);
ok
(
hr
==
D3D_OK
,
"SetTexture failed, %08x
\n
"
,
hr
);
...
...
@@ -987,7 +996,8 @@ static void alpha_test(IDirect3DDevice7 *device)
* vertices
*/
hr
=
IDirect3DDevice7_SetRenderTarget
(
device
,
offscreen
,
0
);
ok
(
hr
==
D3D_OK
,
"Can't get back buffer, hr = %08x
\n
"
,
hr
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice7_SetRenderTarget failed, hr = %08x
\n
"
,
hr
);
set_viewport_size
(
device
);
hr
=
IDirect3DDevice7_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
,
0x80ff0000
,
0
.
0
,
0
);
ok
(
hr
==
D3D_OK
,
"Clear failed, hr = %08x
\n
"
,
hr
);
...
...
@@ -1006,8 +1016,8 @@ static void alpha_test(IDirect3DDevice7 *device)
ok
(
hr
==
D3D_OK
,
"DrawPrimitive failed, hr = %08x
\n
"
,
hr
);
hr
=
IDirect3DDevice7_SetRenderTarget
(
device
,
backbuffer
,
0
);
ok
(
hr
==
D3D_OK
,
"
Can't get back buffer
, hr = %08x
\n
"
,
hr
);
set_
the_same_viewport_again
(
device
);
ok
(
hr
==
D3D_OK
,
"
IDirect3DDevice7_SetRenderTarget failed
, hr = %08x
\n
"
,
hr
);
set_
viewport_size
(
device
);
/* Render the offscreen texture onto the frame buffer to be able to compare it regularly.
* Disable alpha blending for the final composition
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment