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
019cc506
Commit
019cc506
authored
Sep 07, 2007
by
David Hedberg
Committed by
Alexandre Julliard
Sep 10, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Enumerate additional devices in IDirect3D7_EnumDevices.
parent
8d32a490
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
4 deletions
+68
-4
direct3d.c
dlls/ddraw/direct3d.c
+14
-4
d3d.c
dlls/ddraw/tests/d3d.c
+54
-0
No files found.
dlls/ddraw/direct3d.c
View file @
019cc506
...
...
@@ -230,7 +230,7 @@ IDirect3DImpl_1_Initialize(IDirect3D *iface,
* IDirect3D7::EnumDevices
*
* The EnumDevices method for IDirect3D7. It enumerates all supported
* D3D7 devices. Currently the
re's only one
.
* D3D7 devices. Currently the
T&L, HAL and RGB devices are enumerated
.
*
* Params:
* Callback: Function to call for each enumerated device
...
...
@@ -246,8 +246,12 @@ IDirect3DImpl_7_EnumDevices(IDirect3D7 *iface,
void
*
Context
)
{
ICOM_THIS_FROM
(
IDirectDrawImpl
,
IDirect3D7
,
iface
);
char
interface_name
[]
=
"WINE Direct3D7 using WineD3D"
;
char
device_name
[]
=
"Wine D3D7 device"
;
char
interface_name_tnl
[]
=
"WINE Direct3D7 Hardware Transform and Lighting acceleration using WineD3D"
;
char
device_name_tnl
[]
=
"Wine D3D7 T&L HAL"
;
char
interface_name_hal
[]
=
"WINE Direct3D7 Hardware acceleration using WineD3D"
;
char
device_name_hal
[]
=
"Wine D3D7 HAL"
;
char
interface_name_rgb
[]
=
"WINE Direct3D7 RGB Software Emulation using WineD3D"
;
char
device_name_rgb
[]
=
"Wine D3D7 RGB"
;
D3DDEVICEDESC7
ddesc
;
D3DDEVICEDESC
oldDesc
;
HRESULT
hr
;
...
...
@@ -262,7 +266,13 @@ IDirect3DImpl_7_EnumDevices(IDirect3D7 *iface,
LeaveCriticalSection
(
&
ddraw_cs
);
return
hr
;
}
Callback
(
interface_name
,
device_name
,
&
ddesc
,
Context
);
Callback
(
interface_name_tnl
,
device_name_tnl
,
&
ddesc
,
Context
);
ddesc
.
deviceGUID
=
IID_IDirect3DHALDevice
;
Callback
(
interface_name_hal
,
device_name_hal
,
&
ddesc
,
Context
);
ddesc
.
deviceGUID
=
IID_IDirect3DRGBDevice
;
Callback
(
interface_name_rgb
,
device_name_rgb
,
&
ddesc
,
Context
);
TRACE
(
"(%p) End of enumeration
\n
"
,
This
);
LeaveCriticalSection
(
&
ddraw_cs
);
...
...
dlls/ddraw/tests/d3d.c
View file @
019cc506
...
...
@@ -33,6 +33,14 @@ static LPDIRECT3DVERTEXBUFFER7 lpVBufSrc = NULL;
static
LPDIRECT3DVERTEXBUFFER7
lpVBufDest1
=
NULL
;
static
LPDIRECT3DVERTEXBUFFER7
lpVBufDest2
=
NULL
;
typedef
struct
{
int
total
;
int
rgb
;
int
hal
;
int
tnlhal
;
int
unk
;
}
D3D7ETest
;
/* To compare bad floating point numbers. Not the ideal way to do it,
* but it should be enough for here */
#define comparefloat(a, b) ( (((a) - (b)) < 0.0001) && (((a) - (b)) > -0.0001) )
...
...
@@ -789,6 +797,51 @@ static HRESULT WINAPI enumDevicesCallback(GUID *Guid,LPSTR DeviceDescription,LPS
return
DDENUMRET_OK
;
}
static
HRESULT
WINAPI
enumDevicesCallbackTest7
(
LPSTR
DeviceDescription
,
LPSTR
DeviceName
,
LPD3DDEVICEDESC7
lpdd7
,
LPVOID
Context
)
{
D3D7ETest
*
d3d7et
=
(
D3D7ETest
*
)
Context
;
if
(
IsEqualGUID
(
&
lpdd7
->
deviceGUID
,
&
IID_IDirect3DRGBDevice
))
d3d7et
->
rgb
++
;
else
if
(
IsEqualGUID
(
&
lpdd7
->
deviceGUID
,
&
IID_IDirect3DHALDevice
))
d3d7et
->
hal
++
;
else
if
(
IsEqualGUID
(
&
lpdd7
->
deviceGUID
,
&
IID_IDirect3DTnLHalDevice
))
d3d7et
->
tnlhal
++
;
else
d3d7et
->
unk
++
;
d3d7et
->
total
++
;
return
DDENUMRET_OK
;
}
/* Check the deviceGUID of devices enumerated by
IDirect3D7_EnumDevices. */
static
void
D3D7EnumTest
(
void
)
{
D3D7ETest
d3d7et
;
if
(
!
lpD3D
)
{
skip
(
"No Direct3D7 interface.
\n
"
);
return
;
}
memset
(
&
d3d7et
,
0
,
sizeof
(
d3d7et
));
IDirect3D7_EnumDevices
(
lpD3D
,
enumDevicesCallbackTest7
,
(
LPVOID
)
&
d3d7et
);
/* A couple of games (Delta Force LW and TFD) rely on this behaviour */
ok
(
d3d7et
.
tnlhal
<
d3d7et
.
total
,
"TnLHal device enumerated as only device.
\n
"
);
/* We make two additional assumptions. */
ok
(
d3d7et
.
rgb
,
"No RGB Device enumerated.
\n
"
);
if
(
d3d7et
.
tnlhal
)
ok
(
d3d7et
.
hal
,
"TnLHal device enumerated, but no Hal device found.
\n
"
);
return
;
}
static
void
CapsTest
(
void
)
{
IDirect3D3
*
d3d3
;
...
...
@@ -1221,6 +1274,7 @@ START_TEST(d3d)
StateTest
();
SceneTest
();
LimitTest
();
D3D7EnumTest
();
CapsTest
();
ReleaseDirect3D
();
Direct3D1Test
();
...
...
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