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
3c899df3
Commit
3c899df3
authored
Aug 19, 2022
by
Zhiyi Zhang
Committed by
Alexandre Julliard
Aug 24, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw/tests: Move the capability tests for enumerated devices.
Move the capability tests for enumerated devices from d3d.c to ddraw{1,2,4}.c.
parent
21beb2a8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
492 additions
and
165 deletions
+492
-165
d3d.c
dlls/ddraw/tests/d3d.c
+0
-165
ddraw1.c
dlls/ddraw/tests/ddraw1.c
+164
-0
ddraw2.c
dlls/ddraw/tests/ddraw2.c
+164
-0
ddraw4.c
dlls/ddraw/tests/ddraw4.c
+164
-0
No files found.
dlls/ddraw/tests/d3d.c
View file @
3c899df3
...
@@ -488,133 +488,6 @@ static void SceneTest(void)
...
@@ -488,133 +488,6 @@ static void SceneTest(void)
/* TODO: Verify that blitting works in the same way as in d3d9 */
/* TODO: Verify that blitting works in the same way as in d3d9 */
}
}
static
HRESULT
WINAPI
enumDevicesCallback
(
GUID
*
Guid
,
char
*
DeviceDescription
,
char
*
DeviceName
,
D3DDEVICEDESC
*
hal
,
D3DDEVICEDESC
*
hel
,
void
*
ctx
)
{
UINT
ver
=
*
((
UINT
*
)
ctx
);
if
(
IsEqualGUID
(
&
IID_IDirect3DRGBDevice
,
Guid
))
{
ok
((
hal
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
==
0
,
"RGB Device %d hal line caps has D3DPTEXTURECAPS_POW2 flag set
\n
"
,
ver
);
ok
((
hal
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
==
0
,
"RGB Device %d hal tri caps has D3DPTEXTURECAPS_POW2 flag set
\n
"
,
ver
);
ok
(
hel
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
,
"RGB Device %d hel line caps does not have D3DPTEXTURECAPS_POW2 flag set
\n
"
,
ver
);
ok
(
hel
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
,
"RGB Device %d hel tri caps does not have D3DPTEXTURECAPS_POW2 flag set
\n
"
,
ver
);
ok
((
hal
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
)
==
0
,
"RGB Device %d hal line caps has D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
,
ver
);
ok
((
hal
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
)
==
0
,
"RGB Device %d hal tri caps has D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
,
ver
);
ok
(
hel
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
,
"RGB Device %d hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
,
ver
);
ok
(
hel
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
,
"RGB Device %d hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
,
ver
);
ok
(
hal
->
dcmColorModel
==
0
,
"RGB Device %u hal caps has colormodel %lu
\n
"
,
ver
,
hal
->
dcmColorModel
);
ok
(
hel
->
dcmColorModel
==
D3DCOLOR_RGB
,
"RGB Device %u hel caps has colormodel %lu
\n
"
,
ver
,
hel
->
dcmColorModel
);
ok
(
hal
->
dwFlags
==
0
,
"RGB Device %u hal caps has hardware flags %#lx
\n
"
,
ver
,
hal
->
dwFlags
);
ok
(
hel
->
dwFlags
!=
0
,
"RGB Device %u hel caps has hardware flags %#lx
\n
"
,
ver
,
hel
->
dwFlags
);
}
else
if
(
IsEqualGUID
(
&
IID_IDirect3DHALDevice
,
Guid
))
{
trace
(
"HAL Device %d
\n
"
,
ver
);
ok
(
hal
->
dcmColorModel
==
D3DCOLOR_RGB
,
"HAL Device %u hal caps has colormodel %lu
\n
"
,
ver
,
hel
->
dcmColorModel
);
ok
(
hel
->
dcmColorModel
==
0
,
"HAL Device %u hel caps has colormodel %lu
\n
"
,
ver
,
hel
->
dcmColorModel
);
ok
(
hal
->
dwFlags
!=
0
,
"HAL Device %u hal caps has hardware flags %#lx
\n
"
,
ver
,
hal
->
dwFlags
);
ok
(
hel
->
dwFlags
!=
0
,
"HAL Device %u hel caps has hardware flags %#lx
\n
"
,
ver
,
hel
->
dwFlags
);
}
else
if
(
IsEqualGUID
(
&
IID_IDirect3DRefDevice
,
Guid
))
{
ok
((
hal
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
==
0
,
"REF Device %d hal line caps has D3DPTEXTURECAPS_POW2 flag set
\n
"
,
ver
);
ok
((
hal
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
==
0
,
"REF Device %d hal tri caps has D3DPTEXTURECAPS_POW2 flag set
\n
"
,
ver
);
ok
(
hel
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
,
"REF Device %d hel line caps does not have D3DPTEXTURECAPS_POW2 flag set
\n
"
,
ver
);
ok
(
hel
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
,
"REF Device %d hel tri caps does not have D3DPTEXTURECAPS_POW2 flag set
\n
"
,
ver
);
ok
((
hal
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
)
==
0
,
"REF Device %d hal line caps has D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
,
ver
);
ok
((
hal
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
)
==
0
,
"REF Device %d hal tri caps has D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
,
ver
);
ok
(
hel
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
,
"REF Device %d hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
,
ver
);
ok
(
hel
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
,
"REF Device %d hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
,
ver
);
}
else
if
(
IsEqualGUID
(
&
IID_IDirect3DRampDevice
,
Guid
))
{
ok
((
hal
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
==
0
,
"Ramp Device %d hal line caps has D3DPTEXTURECAPS_POW2 flag set
\n
"
,
ver
);
ok
((
hal
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
==
0
,
"Ramp Device %d hal tri caps has D3DPTEXTURECAPS_POW2 flag set
\n
"
,
ver
);
ok
(
hel
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
,
"Ramp Device %d hel line caps does not have D3DPTEXTURECAPS_POW2 flag set
\n
"
,
ver
);
ok
(
hel
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
,
"Ramp Device %d hel tri caps does not have D3DPTEXTURECAPS_POW2 flag set
\n
"
,
ver
);
ok
((
hal
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
)
==
0
,
"Ramp Device %d hal line caps has D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
,
ver
);
ok
((
hal
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
)
==
0
,
"Ramp Device %d hal tri caps has D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
,
ver
);
ok
(
hel
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
,
"Ramp Device %d hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
,
ver
);
ok
(
hel
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
,
"Ramp Device %d hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
,
ver
);
ok
(
hal
->
dcmColorModel
==
0
,
"Ramp Device %u hal caps has colormodel %lu
\n
"
,
ver
,
hal
->
dcmColorModel
);
ok
(
hel
->
dcmColorModel
==
D3DCOLOR_MONO
,
"Ramp Device %u hel caps has colormodel %lu
\n
"
,
ver
,
hel
->
dcmColorModel
);
ok
(
hal
->
dwFlags
==
0
,
"Ramp Device %u hal caps has hardware flags %#lx
\n
"
,
ver
,
hal
->
dwFlags
);
ok
(
hel
->
dwFlags
!=
0
,
"Ramp Device %u hel caps has hardware flags %#lx
\n
"
,
ver
,
hel
->
dwFlags
);
}
else
if
(
IsEqualGUID
(
&
IID_IDirect3DMMXDevice
,
Guid
))
{
ok
((
hal
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
==
0
,
"MMX Device %d hal line caps has D3DPTEXTURECAPS_POW2 flag set
\n
"
,
ver
);
ok
((
hal
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
==
0
,
"MMX Device %d hal tri caps has D3DPTEXTURECAPS_POW2 flag set
\n
"
,
ver
);
ok
(
hel
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
,
"MMX Device %d hel line caps does not have D3DPTEXTURECAPS_POW2 flag set
\n
"
,
ver
);
ok
(
hel
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
,
"MMX Device %d hel tri caps does not have D3DPTEXTURECAPS_POW2 flag set
\n
"
,
ver
);
ok
((
hal
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
)
==
0
,
"MMX Device %d hal line caps has D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
,
ver
);
ok
((
hal
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
)
==
0
,
"MMX Device %d hal tri caps has D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
,
ver
);
ok
(
hel
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
,
"MMX Device %d hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
,
ver
);
ok
(
hel
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
,
"MMX Device %d hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
,
ver
);
ok
(
hal
->
dcmColorModel
==
0
,
"MMX Device %u hal caps has colormodel %lu
\n
"
,
ver
,
hal
->
dcmColorModel
);
ok
(
hel
->
dcmColorModel
==
D3DCOLOR_RGB
,
"MMX Device %u hel caps has colormodel %lu
\n
"
,
ver
,
hel
->
dcmColorModel
);
ok
(
hal
->
dwFlags
==
0
,
"MMX Device %u hal caps has hardware flags %#lx
\n
"
,
ver
,
hal
->
dwFlags
);
ok
(
hel
->
dwFlags
!=
0
,
"MMX Device %u hel caps has hardware flags %#lx
\n
"
,
ver
,
hel
->
dwFlags
);
}
else
{
ok
(
FALSE
,
"Unexpected device enumerated:
\"
%s
\"
\"
%s
\"\n
"
,
DeviceDescription
,
DeviceName
);
if
(
hal
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
trace
(
"hal line has pow2 set
\n
"
);
else
trace
(
"hal line does NOT have pow2 set
\n
"
);
if
(
hal
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
trace
(
"hal tri has pow2 set
\n
"
);
else
trace
(
"hal tri does NOT have pow2 set
\n
"
);
if
(
hel
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
trace
(
"hel line has pow2 set
\n
"
);
else
trace
(
"hel line does NOT have pow2 set
\n
"
);
if
(
hel
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
trace
(
"hel tri has pow2 set
\n
"
);
else
trace
(
"hel tri does NOT have pow2 set
\n
"
);
}
return
DDENUMRET_OK
;
}
static
HRESULT
WINAPI
enumDevicesCallbackTest7
(
char
*
DeviceDescription
,
char
*
DeviceName
,
static
HRESULT
WINAPI
enumDevicesCallbackTest7
(
char
*
DeviceDescription
,
char
*
DeviceName
,
D3DDEVICEDESC7
*
lpdd7
,
void
*
Context
)
D3DDEVICEDESC7
*
lpdd7
,
void
*
Context
)
{
{
...
@@ -774,43 +647,6 @@ static void D3D7EnumLifetimeTest(void)
...
@@ -774,43 +647,6 @@ static void D3D7EnumLifetimeTest(void)
}
}
}
}
static
void
CapsTest
(
void
)
{
IDirect3D3
*
d3d3
;
IDirect3D3
*
d3d2
;
IDirectDraw
*
dd1
;
HRESULT
hr
;
UINT
ver
;
hr
=
DirectDrawCreate
(
NULL
,
&
dd1
,
NULL
);
ok
(
hr
==
DD_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirectDraw_QueryInterface
(
dd1
,
&
IID_IDirect3D3
,
(
void
**
)
&
d3d3
);
ok
(
hr
==
D3D_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3D3_EnumDevices
(
d3d3
,
NULL
,
NULL
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"Got hr %#lx.
\n
"
,
hr
);
ver
=
3
;
IDirect3D3_EnumDevices
(
d3d3
,
enumDevicesCallback
,
&
ver
);
IDirect3D3_Release
(
d3d3
);
IDirectDraw_Release
(
dd1
);
hr
=
DirectDrawCreate
(
NULL
,
&
dd1
,
NULL
);
ok
(
hr
==
DD_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirectDraw_QueryInterface
(
dd1
,
&
IID_IDirect3D2
,
(
void
**
)
&
d3d2
);
ok
(
hr
==
D3D_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3D2_EnumDevices
(
d3d2
,
NULL
,
NULL
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"Got hr %#lx.
\n
"
,
hr
);
ver
=
2
;
IDirect3D2_EnumDevices
(
d3d2
,
enumDevicesCallback
,
&
ver
);
IDirect3D2_Release
(
d3d2
);
IDirectDraw_Release
(
dd1
);
}
struct
v_in
{
struct
v_in
{
float
x
,
y
,
z
;
float
x
,
y
,
z
;
};
};
...
@@ -2243,7 +2079,6 @@ START_TEST(d3d)
...
@@ -2243,7 +2079,6 @@ START_TEST(d3d)
D3D7EnumTest
();
D3D7EnumTest
();
D3D7EnumLifetimeTest
();
D3D7EnumLifetimeTest
();
SetMaterialTest
();
SetMaterialTest
();
CapsTest
();
VertexBufferDescTest
();
VertexBufferDescTest
();
SetRenderTargetTest
();
SetRenderTargetTest
();
VertexBufferLockRest
();
VertexBufferLockRest
();
...
...
dlls/ddraw/tests/ddraw1.c
View file @
3c899df3
...
@@ -15145,6 +15145,169 @@ static void test_filling_convention(void)
...
@@ -15145,6 +15145,169 @@ static void test_filling_convention(void)
DestroyWindow
(
window
);
DestroyWindow
(
window
);
}
}
static
HRESULT
WINAPI
test_enum_devices_caps_callback
(
GUID
*
guid
,
char
*
device_desc
,
char
*
device_name
,
D3DDEVICEDESC
*
hal
,
D3DDEVICEDESC
*
hel
,
void
*
ctx
)
{
if
(
IsEqualGUID
(
&
IID_IDirect3DRGBDevice
,
guid
))
{
ok
((
hal
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
==
0
,
"RGB Device hal line caps has D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
((
hal
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
==
0
,
"RGB Device hal tri caps has D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
(
hel
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
,
"RGB Device hel line caps does not have D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
(
hel
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
,
"RGB Device hel tri caps does not have D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
((
hal
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
)
==
0
,
"RGB Device hal line caps has D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
((
hal
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
)
==
0
,
"RGB Device hal tri caps has D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
(
hel
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
,
"RGB Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
(
hel
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
,
"RGB Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
(
hal
->
dcmColorModel
==
0
,
"RGB Device hal caps has colormodel %lu
\n
"
,
hal
->
dcmColorModel
);
ok
(
hel
->
dcmColorModel
==
D3DCOLOR_RGB
,
"RGB Device hel caps has colormodel %lu
\n
"
,
hel
->
dcmColorModel
);
ok
(
hal
->
dwFlags
==
0
,
"RGB Device hal caps has hardware flags %#lx
\n
"
,
hal
->
dwFlags
);
ok
(
hel
->
dwFlags
!=
0
,
"RGB Device hel caps has hardware flags %#lx
\n
"
,
hel
->
dwFlags
);
}
else
if
(
IsEqualGUID
(
&
IID_IDirect3DHALDevice
,
guid
))
{
ok
(
hal
->
dcmColorModel
==
D3DCOLOR_RGB
,
"HAL Device hal caps has colormodel %lu
\n
"
,
hel
->
dcmColorModel
);
ok
(
hel
->
dcmColorModel
==
0
,
"HAL Device hel caps has colormodel %lu
\n
"
,
hel
->
dcmColorModel
);
ok
(
hal
->
dwFlags
!=
0
,
"HAL Device hal caps has hardware flags %#lx
\n
"
,
hal
->
dwFlags
);
ok
(
hel
->
dwFlags
!=
0
,
"HAL Device hel caps has hardware flags %#lx
\n
"
,
hel
->
dwFlags
);
}
else
if
(
IsEqualGUID
(
&
IID_IDirect3DRefDevice
,
guid
))
{
ok
((
hal
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
==
0
,
"REF Device hal line caps has D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
((
hal
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
==
0
,
"REF Device hal tri caps has D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
(
hel
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
,
"REF Device hel line caps does not have D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
(
hel
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
,
"REF Device hel tri caps does not have D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
((
hal
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
)
==
0
,
"REF Device hal line caps has D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
((
hal
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
)
==
0
,
"REF Device hal tri caps has D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
(
hel
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
,
"REF Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
(
hel
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
,
"REF Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
}
else
if
(
IsEqualGUID
(
&
IID_IDirect3DRampDevice
,
guid
))
{
ok
((
hal
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
==
0
,
"Ramp Device hal line caps has D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
((
hal
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
==
0
,
"Ramp Device hal tri caps has D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
(
hel
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
,
"Ramp Device hel line caps does not have D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
(
hel
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
,
"Ramp Device hel tri caps does not have D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
((
hal
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
)
==
0
,
"Ramp Device hal line caps has D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
((
hal
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
)
==
0
,
"Ramp Device hal tri caps has D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
(
hel
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
,
"Ramp Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
(
hel
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
,
"Ramp Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
(
hal
->
dcmColorModel
==
0
,
"Ramp Device hal caps has colormodel %lu
\n
"
,
hal
->
dcmColorModel
);
ok
(
hel
->
dcmColorModel
==
D3DCOLOR_MONO
,
"Ramp Device hel caps has colormodel %lu
\n
"
,
hel
->
dcmColorModel
);
ok
(
hal
->
dwFlags
==
0
,
"Ramp Device hal caps has hardware flags %#lx
\n
"
,
hal
->
dwFlags
);
ok
(
hel
->
dwFlags
!=
0
,
"Ramp Device hel caps has hardware flags %#lx
\n
"
,
hel
->
dwFlags
);
}
else
if
(
IsEqualGUID
(
&
IID_IDirect3DMMXDevice
,
guid
))
{
ok
((
hal
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
==
0
,
"MMX Device hal line caps has D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
((
hal
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
==
0
,
"MMX Device hal tri caps has D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
(
hel
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
,
"MMX Device hel line caps does not have D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
(
hel
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
,
"MMX Device hel tri caps does not have D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
((
hal
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
)
==
0
,
"MMX Device hal line caps has D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
((
hal
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
)
==
0
,
"MMX Device hal tri caps has D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
(
hel
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
,
"MMX Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
(
hel
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
,
"MMX Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
(
hal
->
dcmColorModel
==
0
,
"MMX Device hal caps has colormodel %lu
\n
"
,
hal
->
dcmColorModel
);
ok
(
hel
->
dcmColorModel
==
D3DCOLOR_RGB
,
"MMX Device hel caps has colormodel %lu
\n
"
,
hel
->
dcmColorModel
);
ok
(
hal
->
dwFlags
==
0
,
"MMX Device hal caps has hardware flags %#lx
\n
"
,
hal
->
dwFlags
);
ok
(
hel
->
dwFlags
!=
0
,
"MMX Device hel caps has hardware flags %#lx
\n
"
,
hel
->
dwFlags
);
}
else
{
ok
(
FALSE
,
"Unexpected device enumerated:
\"
%s
\"
\"
%s
\"\n
"
,
device_desc
,
device_name
);
if
(
hal
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
trace
(
"hal line has pow2 set
\n
"
);
else
trace
(
"hal line does NOT have pow2 set
\n
"
);
if
(
hal
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
trace
(
"hal tri has pow2 set
\n
"
);
else
trace
(
"hal tri does NOT have pow2 set
\n
"
);
if
(
hel
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
trace
(
"hel line has pow2 set
\n
"
);
else
trace
(
"hel line does NOT have pow2 set
\n
"
);
if
(
hel
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
trace
(
"hel tri has pow2 set
\n
"
);
else
trace
(
"hel tri does NOT have pow2 set
\n
"
);
}
return
DDENUMRET_OK
;
}
static
void
test_enum_devices
(
void
)
{
IDirectDraw
*
ddraw
;
IDirect3D
*
d3d
;
ULONG
refcount
;
HRESULT
hr
;
ddraw
=
create_ddraw
();
ok
(
!!
ddraw
,
"Failed to create a ddraw object.
\n
"
);
hr
=
IDirectDraw_QueryInterface
(
ddraw
,
&
IID_IDirect3D
,
(
void
**
)
&
d3d
);
if
(
FAILED
(
hr
))
{
skip
(
"D3D interface is not available, skipping test.
\n
"
);
IDirectDraw_Release
(
ddraw
);
return
;
}
hr
=
IDirect3D_EnumDevices
(
d3d
,
NULL
,
NULL
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3D_EnumDevices
(
d3d
,
test_enum_devices_caps_callback
,
NULL
);
ok
(
hr
==
D3D_OK
,
"Got hr %#lx.
\n
"
,
hr
);
IDirect3D_Release
(
d3d
);
refcount
=
IDirectDraw_Release
(
ddraw
);
ok
(
!
refcount
,
"Device has %lu references left.
\n
"
,
refcount
);
}
START_TEST
(
ddraw1
)
START_TEST
(
ddraw1
)
{
{
DDDEVICEIDENTIFIER
identifier
;
DDDEVICEIDENTIFIER
identifier
;
...
@@ -15263,4 +15426,5 @@ START_TEST(ddraw1)
...
@@ -15263,4 +15426,5 @@ START_TEST(ddraw1)
test_get_display_mode
();
test_get_display_mode
();
run_for_each_device_type
(
test_texture_wrong_caps
);
run_for_each_device_type
(
test_texture_wrong_caps
);
test_filling_convention
();
test_filling_convention
();
test_enum_devices
();
}
}
dlls/ddraw/tests/ddraw2.c
View file @
3c899df3
...
@@ -16091,6 +16091,169 @@ static void test_filling_convention(void)
...
@@ -16091,6 +16091,169 @@ static void test_filling_convention(void)
DestroyWindow
(
window
);
DestroyWindow
(
window
);
}
}
static
HRESULT
WINAPI
test_enum_devices_caps_callback
(
GUID
*
guid
,
char
*
device_desc
,
char
*
device_name
,
D3DDEVICEDESC
*
hal
,
D3DDEVICEDESC
*
hel
,
void
*
ctx
)
{
if
(
IsEqualGUID
(
&
IID_IDirect3DRGBDevice
,
guid
))
{
ok
((
hal
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
==
0
,
"RGB Device hal line caps has D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
((
hal
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
==
0
,
"RGB Device hal tri caps has D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
(
hel
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
,
"RGB Device hel line caps does not have D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
(
hel
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
,
"RGB Device hel tri caps does not have D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
((
hal
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
)
==
0
,
"RGB Device hal line caps has D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
((
hal
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
)
==
0
,
"RGB Device hal tri caps has D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
(
hel
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
,
"RGB Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
(
hel
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
,
"RGB Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
(
hal
->
dcmColorModel
==
0
,
"RGB Device hal caps has colormodel %lu
\n
"
,
hal
->
dcmColorModel
);
ok
(
hel
->
dcmColorModel
==
D3DCOLOR_RGB
,
"RGB Device hel caps has colormodel %lu
\n
"
,
hel
->
dcmColorModel
);
ok
(
hal
->
dwFlags
==
0
,
"RGB Device hal caps has hardware flags %#lx
\n
"
,
hal
->
dwFlags
);
ok
(
hel
->
dwFlags
!=
0
,
"RGB Device hel caps has hardware flags %#lx
\n
"
,
hel
->
dwFlags
);
}
else
if
(
IsEqualGUID
(
&
IID_IDirect3DHALDevice
,
guid
))
{
ok
(
hal
->
dcmColorModel
==
D3DCOLOR_RGB
,
"HAL Device hal caps has colormodel %lu
\n
"
,
hel
->
dcmColorModel
);
ok
(
hel
->
dcmColorModel
==
0
,
"HAL Device hel caps has colormodel %lu
\n
"
,
hel
->
dcmColorModel
);
ok
(
hal
->
dwFlags
!=
0
,
"HAL Device hal caps has hardware flags %#lx
\n
"
,
hal
->
dwFlags
);
ok
(
hel
->
dwFlags
!=
0
,
"HAL Device hel caps has hardware flags %#lx
\n
"
,
hel
->
dwFlags
);
}
else
if
(
IsEqualGUID
(
&
IID_IDirect3DRefDevice
,
guid
))
{
ok
((
hal
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
==
0
,
"REF Device hal line caps has D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
((
hal
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
==
0
,
"REF Device hal tri caps has D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
(
hel
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
,
"REF Device hel line caps does not have D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
(
hel
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
,
"REF Device hel tri caps does not have D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
((
hal
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
)
==
0
,
"REF Device hal line caps has D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
((
hal
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
)
==
0
,
"REF Device hal tri caps has D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
(
hel
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
,
"REF Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
(
hel
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
,
"REF Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
}
else
if
(
IsEqualGUID
(
&
IID_IDirect3DRampDevice
,
guid
))
{
ok
((
hal
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
==
0
,
"Ramp Device hal line caps has D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
((
hal
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
==
0
,
"Ramp Device hal tri caps has D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
(
hel
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
,
"Ramp Device hel line caps does not have D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
(
hel
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
,
"Ramp Device hel tri caps does not have D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
((
hal
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
)
==
0
,
"Ramp Device hal line caps has D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
((
hal
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
)
==
0
,
"Ramp Device hal tri caps has D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
(
hel
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
,
"Ramp Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
(
hel
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
,
"Ramp Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
(
hal
->
dcmColorModel
==
0
,
"Ramp Device hal caps has colormodel %lu
\n
"
,
hal
->
dcmColorModel
);
ok
(
hel
->
dcmColorModel
==
D3DCOLOR_MONO
,
"Ramp Device hel caps has colormodel %lu
\n
"
,
hel
->
dcmColorModel
);
ok
(
hal
->
dwFlags
==
0
,
"Ramp Device hal caps has hardware flags %#lx
\n
"
,
hal
->
dwFlags
);
ok
(
hel
->
dwFlags
!=
0
,
"Ramp Device hel caps has hardware flags %#lx
\n
"
,
hel
->
dwFlags
);
}
else
if
(
IsEqualGUID
(
&
IID_IDirect3DMMXDevice
,
guid
))
{
ok
((
hal
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
==
0
,
"MMX Device hal line caps has D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
((
hal
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
==
0
,
"MMX Device hal tri caps has D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
(
hel
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
,
"MMX Device hel line caps does not have D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
(
hel
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
,
"MMX Device hel tri caps does not have D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
((
hal
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
)
==
0
,
"MMX Device hal line caps has D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
((
hal
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
)
==
0
,
"MMX Device hal tri caps has D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
(
hel
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
,
"MMX Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
(
hel
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
,
"MMX Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
(
hal
->
dcmColorModel
==
0
,
"MMX Device hal caps has colormodel %lu
\n
"
,
hal
->
dcmColorModel
);
ok
(
hel
->
dcmColorModel
==
D3DCOLOR_RGB
,
"MMX Device hel caps has colormodel %lu
\n
"
,
hel
->
dcmColorModel
);
ok
(
hal
->
dwFlags
==
0
,
"MMX Device hal caps has hardware flags %#lx
\n
"
,
hal
->
dwFlags
);
ok
(
hel
->
dwFlags
!=
0
,
"MMX Device hel caps has hardware flags %#lx
\n
"
,
hel
->
dwFlags
);
}
else
{
ok
(
FALSE
,
"Unexpected device enumerated:
\"
%s
\"
\"
%s
\"\n
"
,
device_desc
,
device_name
);
if
(
hal
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
trace
(
"hal line has pow2 set
\n
"
);
else
trace
(
"hal line does NOT have pow2 set
\n
"
);
if
(
hal
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
trace
(
"hal tri has pow2 set
\n
"
);
else
trace
(
"hal tri does NOT have pow2 set
\n
"
);
if
(
hel
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
trace
(
"hel line has pow2 set
\n
"
);
else
trace
(
"hel line does NOT have pow2 set
\n
"
);
if
(
hel
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
trace
(
"hel tri has pow2 set
\n
"
);
else
trace
(
"hel tri does NOT have pow2 set
\n
"
);
}
return
DDENUMRET_OK
;
}
static
void
test_enum_devices
(
void
)
{
IDirectDraw2
*
ddraw
;
IDirect3D2
*
d3d
;
ULONG
refcount
;
HRESULT
hr
;
ddraw
=
create_ddraw
();
ok
(
!!
ddraw
,
"Failed to create a ddraw object.
\n
"
);
hr
=
IDirectDraw2_QueryInterface
(
ddraw
,
&
IID_IDirect3D2
,
(
void
**
)
&
d3d
);
if
(
FAILED
(
hr
))
{
skip
(
"D3D interface is not available, skipping test.
\n
"
);
IDirectDraw2_Release
(
ddraw
);
return
;
}
hr
=
IDirect3D2_EnumDevices
(
d3d
,
NULL
,
NULL
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3D2_EnumDevices
(
d3d
,
test_enum_devices_caps_callback
,
NULL
);
ok
(
hr
==
D3D_OK
,
"Got hr %#lx.
\n
"
,
hr
);
IDirect3D2_Release
(
d3d
);
refcount
=
IDirectDraw2_Release
(
ddraw
);
ok
(
!
refcount
,
"Device has %lu references left.
\n
"
,
refcount
);
}
static
void
run_for_each_device_type
(
void
(
*
test_func
)(
const
GUID
*
))
static
void
run_for_each_device_type
(
void
(
*
test_func
)(
const
GUID
*
))
{
{
test_func
(
&
IID_IDirect3DHALDevice
);
test_func
(
&
IID_IDirect3DHALDevice
);
...
@@ -16221,4 +16384,5 @@ START_TEST(ddraw2)
...
@@ -16221,4 +16384,5 @@ START_TEST(ddraw2)
test_get_display_mode
();
test_get_display_mode
();
run_for_each_device_type
(
test_texture_wrong_caps
);
run_for_each_device_type
(
test_texture_wrong_caps
);
test_filling_convention
();
test_filling_convention
();
test_enum_devices
();
}
}
dlls/ddraw/tests/ddraw4.c
View file @
3c899df3
...
@@ -19160,6 +19160,169 @@ static void test_filling_convention(void)
...
@@ -19160,6 +19160,169 @@ static void test_filling_convention(void)
DestroyWindow
(
window
);
DestroyWindow
(
window
);
}
}
static
HRESULT
WINAPI
test_enum_devices_caps_callback
(
GUID
*
guid
,
char
*
device_desc
,
char
*
device_name
,
D3DDEVICEDESC
*
hal
,
D3DDEVICEDESC
*
hel
,
void
*
ctx
)
{
if
(
IsEqualGUID
(
&
IID_IDirect3DRGBDevice
,
guid
))
{
ok
((
hal
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
==
0
,
"RGB Device hal line caps has D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
((
hal
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
==
0
,
"RGB Device hal tri caps has D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
(
hel
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
,
"RGB Device hel line caps does not have D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
(
hel
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
,
"RGB Device hel tri caps does not have D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
((
hal
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
)
==
0
,
"RGB Device hal line caps has D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
((
hal
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
)
==
0
,
"RGB Device hal tri caps has D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
(
hel
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
,
"RGB Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
(
hel
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
,
"RGB Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
(
hal
->
dcmColorModel
==
0
,
"RGB Device hal caps has colormodel %lu
\n
"
,
hal
->
dcmColorModel
);
ok
(
hel
->
dcmColorModel
==
D3DCOLOR_RGB
,
"RGB Device hel caps has colormodel %lu
\n
"
,
hel
->
dcmColorModel
);
ok
(
hal
->
dwFlags
==
0
,
"RGB Device hal caps has hardware flags %#lx
\n
"
,
hal
->
dwFlags
);
ok
(
hel
->
dwFlags
!=
0
,
"RGB Device hel caps has hardware flags %#lx
\n
"
,
hel
->
dwFlags
);
}
else
if
(
IsEqualGUID
(
&
IID_IDirect3DHALDevice
,
guid
))
{
ok
(
hal
->
dcmColorModel
==
D3DCOLOR_RGB
,
"HAL Device hal caps has colormodel %lu
\n
"
,
hel
->
dcmColorModel
);
ok
(
hel
->
dcmColorModel
==
0
,
"HAL Device hel caps has colormodel %lu
\n
"
,
hel
->
dcmColorModel
);
ok
(
hal
->
dwFlags
!=
0
,
"HAL Device hal caps has hardware flags %#lx
\n
"
,
hal
->
dwFlags
);
ok
(
hel
->
dwFlags
!=
0
,
"HAL Device hel caps has hardware flags %#lx
\n
"
,
hel
->
dwFlags
);
}
else
if
(
IsEqualGUID
(
&
IID_IDirect3DRefDevice
,
guid
))
{
ok
((
hal
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
==
0
,
"REF Device hal line caps has D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
((
hal
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
==
0
,
"REF Device hal tri caps has D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
(
hel
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
,
"REF Device hel line caps does not have D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
(
hel
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
,
"REF Device hel tri caps does not have D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
((
hal
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
)
==
0
,
"REF Device hal line caps has D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
((
hal
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
)
==
0
,
"REF Device hal tri caps has D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
(
hel
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
,
"REF Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
(
hel
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
,
"REF Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
}
else
if
(
IsEqualGUID
(
&
IID_IDirect3DRampDevice
,
guid
))
{
ok
((
hal
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
==
0
,
"Ramp Device hal line caps has D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
((
hal
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
==
0
,
"Ramp Device hal tri caps has D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
(
hel
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
,
"Ramp Device hel line caps does not have D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
(
hel
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
,
"Ramp Device hel tri caps does not have D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
((
hal
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
)
==
0
,
"Ramp Device hal line caps has D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
((
hal
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
)
==
0
,
"Ramp Device hal tri caps has D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
(
hel
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
,
"Ramp Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
(
hel
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
,
"Ramp Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
(
hal
->
dcmColorModel
==
0
,
"Ramp Device hal caps has colormodel %lu
\n
"
,
hal
->
dcmColorModel
);
ok
(
hel
->
dcmColorModel
==
D3DCOLOR_MONO
,
"Ramp Device hel caps has colormodel %lu
\n
"
,
hel
->
dcmColorModel
);
ok
(
hal
->
dwFlags
==
0
,
"Ramp Device hal caps has hardware flags %#lx
\n
"
,
hal
->
dwFlags
);
ok
(
hel
->
dwFlags
!=
0
,
"Ramp Device hel caps has hardware flags %#lx
\n
"
,
hel
->
dwFlags
);
}
else
if
(
IsEqualGUID
(
&
IID_IDirect3DMMXDevice
,
guid
))
{
ok
((
hal
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
==
0
,
"MMX Device hal line caps has D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
((
hal
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
==
0
,
"MMX Device hal tri caps has D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
(
hel
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
,
"MMX Device hel line caps does not have D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
(
hel
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
,
"MMX Device hel tri caps does not have D3DPTEXTURECAPS_POW2 flag set
\n
"
);
ok
((
hal
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
)
==
0
,
"MMX Device hal line caps has D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
((
hal
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
)
==
0
,
"MMX Device hal tri caps has D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
(
hel
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
,
"MMX Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
(
hel
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_PERSPECTIVE
,
"MMX Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set
\n
"
);
ok
(
hal
->
dcmColorModel
==
0
,
"MMX Device hal caps has colormodel %lu
\n
"
,
hal
->
dcmColorModel
);
ok
(
hel
->
dcmColorModel
==
D3DCOLOR_RGB
,
"MMX Device hel caps has colormodel %lu
\n
"
,
hel
->
dcmColorModel
);
ok
(
hal
->
dwFlags
==
0
,
"MMX Device hal caps has hardware flags %#lx
\n
"
,
hal
->
dwFlags
);
ok
(
hel
->
dwFlags
!=
0
,
"MMX Device hel caps has hardware flags %#lx
\n
"
,
hel
->
dwFlags
);
}
else
{
ok
(
FALSE
,
"Unexpected device enumerated:
\"
%s
\"
\"
%s
\"\n
"
,
device_desc
,
device_name
);
if
(
hal
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
trace
(
"hal line has pow2 set
\n
"
);
else
trace
(
"hal line does NOT have pow2 set
\n
"
);
if
(
hal
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
trace
(
"hal tri has pow2 set
\n
"
);
else
trace
(
"hal tri does NOT have pow2 set
\n
"
);
if
(
hel
->
dpcLineCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
trace
(
"hel line has pow2 set
\n
"
);
else
trace
(
"hel line does NOT have pow2 set
\n
"
);
if
(
hel
->
dpcTriCaps
.
dwTextureCaps
&
D3DPTEXTURECAPS_POW2
)
trace
(
"hel tri has pow2 set
\n
"
);
else
trace
(
"hel tri does NOT have pow2 set
\n
"
);
}
return
DDENUMRET_OK
;
}
static
void
test_enum_devices
(
void
)
{
IDirectDraw4
*
ddraw
;
IDirect3D3
*
d3d
;
ULONG
refcount
;
HRESULT
hr
;
ddraw
=
create_ddraw
();
ok
(
!!
ddraw
,
"Failed to create a ddraw object.
\n
"
);
hr
=
IDirectDraw4_QueryInterface
(
ddraw
,
&
IID_IDirect3D3
,
(
void
**
)
&
d3d
);
if
(
FAILED
(
hr
))
{
skip
(
"D3D interface is not available, skipping test.
\n
"
);
IDirectDraw4_Release
(
ddraw
);
return
;
}
hr
=
IDirect3D3_EnumDevices
(
d3d
,
NULL
,
NULL
);
ok
(
hr
==
DDERR_INVALIDPARAMS
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3D3_EnumDevices
(
d3d
,
test_enum_devices_caps_callback
,
NULL
);
ok
(
hr
==
D3D_OK
,
"Got hr %#lx.
\n
"
,
hr
);
IDirect3D3_Release
(
d3d
);
refcount
=
IDirectDraw4_Release
(
ddraw
);
ok
(
!
refcount
,
"Device has %lu references left.
\n
"
,
refcount
);
}
START_TEST
(
ddraw4
)
START_TEST
(
ddraw4
)
{
{
DDDEVICEIDENTIFIER
identifier
;
DDDEVICEIDENTIFIER
identifier
;
...
@@ -19300,4 +19463,5 @@ START_TEST(ddraw4)
...
@@ -19300,4 +19463,5 @@ START_TEST(ddraw4)
test_get_display_mode
();
test_get_display_mode
();
run_for_each_device_type
(
test_texture_wrong_caps
);
run_for_each_device_type
(
test_texture_wrong_caps
);
test_filling_convention
();
test_filling_convention
();
test_enum_devices
();
}
}
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