Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
05b3222b
Commit
05b3222b
authored
Aug 30, 2011
by
Stefan Dösinger
Committed by
Alexandre Julliard
Aug 31, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Add a test for DDSD_ZBUFFERBITDEPTH and DDSD_PIXELFORMAT.
parent
6176eb87
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
89 additions
and
0 deletions
+89
-0
dsurface.c
dlls/ddraw/tests/dsurface.c
+89
-0
No files found.
dlls/ddraw/tests/dsurface.c
View file @
05b3222b
...
...
@@ -4027,6 +4027,94 @@ static void zbufferbitdepth_test(void)
ddsd
.
dwZBufferBitDepth
);
}
static
void
test_ddsd
(
DDSURFACEDESC
*
ddsd
,
BOOL
expect_pf
,
BOOL
expect_zd
,
const
char
*
name
)
{
IDirectDrawSurface
*
surface
;
IDirectDrawSurface7
*
surface7
;
HRESULT
hr
;
DDSURFACEDESC
out
;
DDSURFACEDESC2
out2
;
hr
=
IDirectDraw_CreateSurface
(
lpDD
,
ddsd
,
&
surface
,
NULL
);
if
(
hr
==
DDERR_NOZBUFFERHW
)
{
skip
(
"Z buffers not supported, skipping Z flag test
\n
"
);
return
;
}
ok
(
SUCCEEDED
(
hr
),
"IDirectDraw_CreateSurface failed, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawSurface_QueryInterface
(
surface
,
&
IID_IDirectDrawSurface7
,
(
void
**
)
&
surface7
);
ok
(
SUCCEEDED
(
hr
),
"IDirectDrawSurface_QueryInterface failed, hr %#x.
\n
"
,
hr
);
reset_ddsd
(
&
out
);
hr
=
IDirectDrawSurface_GetSurfaceDesc
(
surface
,
&
out
);
ok
(
SUCCEEDED
(
hr
),
"IDirectDrawSurface_GetSurfaceDesc failed, hr %#x.
\n
"
,
hr
);
memset
(
&
out2
,
0
,
sizeof
(
out2
));
out2
.
dwSize
=
sizeof
(
out2
);
hr
=
IDirectDrawSurface7_GetSurfaceDesc
(
surface7
,
&
out2
);
ok
(
SUCCEEDED
(
hr
),
"IDirectDrawSurface_GetSurfaceDesc failed, hr %#x.
\n
"
,
hr
);
if
(
expect_pf
)
{
ok
(
out
.
dwFlags
&
DDSD_PIXELFORMAT
,
"%s surface: Expected DDSD_PIXELFORMAT to be set
\n
"
,
name
);
}
else
{
ok
(
!
(
out
.
dwFlags
&
DDSD_PIXELFORMAT
),
"%s surface: Expected DDSD_PIXELFORMAT not to be set
\n
"
,
name
);
ok
(
out2
.
dwFlags
&
DDSD_PIXELFORMAT
,
"%s surface: Expected DDSD_PIXELFORMAT to be set in DDSURFACEDESC2
\n
"
,
name
);
}
if
(
expect_zd
)
{
ok
(
out
.
dwFlags
&
DDSD_ZBUFFERBITDEPTH
,
"%s surface: Expected DDSD_ZBUFFERBITDEPTH to be set
\n
"
,
name
);
ok
(
!
(
out2
.
dwFlags
&
DDSD_ZBUFFERBITDEPTH
),
"%s surface: Did not expect DDSD_ZBUFFERBITDEPTH to be set in DDSURFACEDESC2
\n
"
,
name
);
}
else
{
ok
(
!
(
out
.
dwFlags
&
DDSD_ZBUFFERBITDEPTH
),
"%s surface: Expected DDSD_ZBUFFERBITDEPTH not to be set
\n
"
,
name
);
}
IDirectDrawSurface7_Release
(
surface7
);
IDirectDrawSurface_Release
(
surface
);
}
static
void
pixelformat_flag_test
(
void
)
{
DDSURFACEDESC
ddsd
;
DDCAPS
caps
;
HRESULT
hr
;
memset
(
&
caps
,
0
,
sizeof
(
caps
));
caps
.
dwSize
=
sizeof
(
caps
);
hr
=
IDirectDraw_GetCaps
(
lpDD
,
&
caps
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"IDirectDraw_GetCaps failed, hr %#x.
\n
"
,
hr
);
if
(
!
(
caps
.
ddsCaps
.
dwCaps
&
DDSCAPS_ZBUFFER
))
{
skip
(
"Z buffers not supported, skipping DDSD_PIXELFORMAT test
\n
"
);
return
;
}
reset_ddsd
(
&
ddsd
);
ddsd
.
dwFlags
=
DDSD_CAPS
|
DDSD_WIDTH
|
DDSD_HEIGHT
;
ddsd
.
dwWidth
=
64
;
ddsd
.
dwHeight
=
64
;
ddsd
.
ddsCaps
.
dwCaps
=
DDSCAPS_OFFSCREENPLAIN
;
test_ddsd
(
&
ddsd
,
TRUE
,
FALSE
,
"offscreen plain"
);
reset_ddsd
(
&
ddsd
);
ddsd
.
dwFlags
=
DDSD_CAPS
;
ddsd
.
ddsCaps
.
dwCaps
=
DDSCAPS_PRIMARYSURFACE
;
test_ddsd
(
&
ddsd
,
TRUE
,
FALSE
,
"primary"
);
reset_ddsd
(
&
ddsd
);
ddsd
.
dwFlags
=
DDSD_CAPS
|
DDSD_WIDTH
|
DDSD_HEIGHT
|
DDSD_ZBUFFERBITDEPTH
;
ddsd
.
dwWidth
=
64
;
ddsd
.
dwHeight
=
64
;
ddsd
.
dwZBufferBitDepth
=
16
;
ddsd
.
ddsCaps
.
dwCaps
=
DDSCAPS_ZBUFFER
;
test_ddsd
(
&
ddsd
,
FALSE
,
TRUE
,
"Z buffer"
);
}
START_TEST
(
dsurface
)
{
HRESULT
ret
;
...
...
@@ -4085,5 +4173,6 @@ START_TEST(dsurface)
CreateSurfaceBadCapsSizeTest
();
no_ddsd_caps_test
();
zbufferbitdepth_test
();
pixelformat_flag_test
();
ReleaseDirectDraw
();
}
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