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
7085a3f8
Commit
7085a3f8
authored
Sep 14, 2010
by
Oldřich Jedlička
Committed by
Alexandre Julliard
Sep 14, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw/tests: New attachment tests for 3D back buffers.
parent
1be7bbf5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
98 additions
and
0 deletions
+98
-0
d3d.c
dlls/ddraw/tests/d3d.c
+98
-0
No files found.
dlls/ddraw/tests/d3d.c
View file @
7085a3f8
...
...
@@ -3618,6 +3618,103 @@ static void BackBuffer3DCreateSurfaceTest(void)
IDirectDraw7_Release
(
dd7
);
}
static
void
BackBuffer3DAttachmentTest
(
void
)
{
HRESULT
hr
;
IDirectDrawSurface
*
surface1
,
*
surface2
,
*
surface3
,
*
surface4
;
DDSURFACEDESC
ddsd
;
HWND
window
=
CreateWindow
(
"static"
,
"ddraw_test"
,
WS_OVERLAPPEDWINDOW
,
100
,
100
,
160
,
160
,
NULL
,
NULL
,
NULL
,
NULL
);
hr
=
IDirectDraw_SetCooperativeLevel
(
DirectDraw1
,
window
,
DDSCL_EXCLUSIVE
|
DDSCL_FULLSCREEN
);
ok
(
hr
==
DD_OK
,
"SetCooperativeLevel returned %08x
\n
"
,
hr
);
/* Perform attachment tests on a back-buffer */
memset
(
&
ddsd
,
0
,
sizeof
(
ddsd
));
ddsd
.
dwSize
=
sizeof
(
ddsd
);
ddsd
.
dwFlags
=
DDSD_CAPS
|
DDSD_WIDTH
|
DDSD_HEIGHT
;
ddsd
.
ddsCaps
.
dwCaps
=
DDSCAPS_BACKBUFFER
|
DDSCAPS_3DDEVICE
;
ddsd
.
dwWidth
=
GetSystemMetrics
(
SM_CXSCREEN
);
ddsd
.
dwHeight
=
GetSystemMetrics
(
SM_CYSCREEN
);
hr
=
IDirectDraw_CreateSurface
(
DirectDraw1
,
&
ddsd
,
&
surface2
,
NULL
);
todo_wine
ok
(
SUCCEEDED
(
hr
),
"CreateSurface returned: %x
\n
"
,
hr
);
if
(
surface2
!=
NULL
)
{
/* Try a single primary and a two back buffers */
memset
(
&
ddsd
,
0
,
sizeof
(
ddsd
));
ddsd
.
dwSize
=
sizeof
(
ddsd
);
ddsd
.
dwFlags
=
DDSD_CAPS
;
ddsd
.
ddsCaps
.
dwCaps
=
DDSCAPS_PRIMARYSURFACE
;
hr
=
IDirectDraw_CreateSurface
(
DirectDraw1
,
&
ddsd
,
&
surface1
,
NULL
);
ok
(
hr
==
DD_OK
,
"CreateSurface returned: %x
\n
"
,
hr
);
memset
(
&
ddsd
,
0
,
sizeof
(
ddsd
));
ddsd
.
dwSize
=
sizeof
(
ddsd
);
ddsd
.
dwFlags
=
DDSD_CAPS
|
DDSD_WIDTH
|
DDSD_HEIGHT
;
ddsd
.
ddsCaps
.
dwCaps
=
DDSCAPS_BACKBUFFER
|
DDSCAPS_3DDEVICE
;
ddsd
.
dwWidth
=
GetSystemMetrics
(
SM_CXSCREEN
);
ddsd
.
dwHeight
=
GetSystemMetrics
(
SM_CYSCREEN
);
hr
=
IDirectDraw_CreateSurface
(
DirectDraw1
,
&
ddsd
,
&
surface3
,
NULL
);
ok
(
hr
==
DD_OK
,
"CreateSurface returned: %x
\n
"
,
hr
);
/* This one has a different size */
memset
(
&
ddsd
,
0
,
sizeof
(
ddsd
));
ddsd
.
dwSize
=
sizeof
(
ddsd
);
ddsd
.
dwFlags
=
DDSD_CAPS
|
DDSD_WIDTH
|
DDSD_HEIGHT
;
ddsd
.
ddsCaps
.
dwCaps
=
DDSCAPS_BACKBUFFER
|
DDSCAPS_3DDEVICE
;
ddsd
.
dwWidth
=
128
;
ddsd
.
dwHeight
=
128
;
hr
=
IDirectDraw_CreateSurface
(
DirectDraw1
,
&
ddsd
,
&
surface4
,
NULL
);
ok
(
hr
==
DD_OK
,
"CreateSurface returned: %x
\n
"
,
hr
);
hr
=
IDirectDrawSurface_AddAttachedSurface
(
surface1
,
surface2
);
todo_wine
ok
(
hr
==
DD_OK
||
broken
(
hr
==
DDERR_CANNOTATTACHSURFACE
),
"Attaching a back buffer to a front buffer returned %08x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
/* Try the reverse without detaching first */
hr
=
IDirectDrawSurface_AddAttachedSurface
(
surface2
,
surface1
);
ok
(
hr
==
DDERR_SURFACEALREADYATTACHED
,
"Attaching an attached surface to its attachee returned %08x
\n
"
,
hr
);
hr
=
IDirectDrawSurface_DeleteAttachedSurface
(
surface1
,
0
,
surface2
);
ok
(
hr
==
DD_OK
,
"DeleteAttachedSurface failed with %08x
\n
"
,
hr
);
}
hr
=
IDirectDrawSurface_AddAttachedSurface
(
surface2
,
surface1
);
todo_wine
ok
(
hr
==
DD_OK
||
broken
(
hr
==
DDERR_CANNOTATTACHSURFACE
),
"Attaching a front buffer to a back buffer returned %08x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
/* Try to detach reversed */
hr
=
IDirectDrawSurface_DeleteAttachedSurface
(
surface1
,
0
,
surface2
);
ok
(
hr
==
DDERR_CANNOTDETACHSURFACE
,
"DeleteAttachedSurface returned %08x
\n
"
,
hr
);
/* Now the proper detach */
hr
=
IDirectDrawSurface_DeleteAttachedSurface
(
surface2
,
0
,
surface1
);
ok
(
hr
==
DD_OK
,
"DeleteAttachedSurface failed with %08x
\n
"
,
hr
);
}
hr
=
IDirectDrawSurface_AddAttachedSurface
(
surface2
,
surface3
);
todo_wine
ok
(
hr
==
DD_OK
||
broken
(
hr
==
DDERR_CANNOTATTACHSURFACE
),
"Attaching a back buffer to another back buffer returned %08x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IDirectDrawSurface_DeleteAttachedSurface
(
surface2
,
0
,
surface3
);
ok
(
hr
==
DD_OK
,
"DeleteAttachedSurface failed with %08x
\n
"
,
hr
);
}
hr
=
IDirectDrawSurface_AddAttachedSurface
(
surface1
,
surface4
);
ok
(
hr
==
DDERR_CANNOTATTACHSURFACE
,
"Attaching a back buffer to a front buffer of different size returned %08x
\n
"
,
hr
);
hr
=
IDirectDrawSurface_AddAttachedSurface
(
surface4
,
surface1
);
ok
(
hr
==
DDERR_CANNOTATTACHSURFACE
,
"Attaching a front buffer to a back buffer of different size returned %08x
\n
"
,
hr
);
IDirectDrawSurface_Release
(
surface4
);
IDirectDrawSurface_Release
(
surface3
);
IDirectDrawSurface_Release
(
surface2
);
IDirectDrawSurface_Release
(
surface1
);
}
hr
=
IDirectDraw_SetCooperativeLevel
(
DirectDraw1
,
NULL
,
DDSCL_NORMAL
);
ok
(
hr
==
DD_OK
,
"SetCooperativeLevel returned %08x
\n
"
,
hr
);
DestroyWindow
(
window
);
}
START_TEST
(
d3d
)
{
init_function_pointers
();
...
...
@@ -3654,6 +3751,7 @@ START_TEST(d3d)
ViewportTest
();
FindDevice
();
BackBuffer3DCreateSurfaceTest
();
BackBuffer3DAttachmentTest
();
D3D1_releaseObjects
();
}
...
...
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