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
9603125e
Commit
9603125e
authored
Aug 20, 2015
by
Aaryaman Vasishta
Committed by
Alexandre Julliard
Aug 21, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3drm: Implement IDirect3DRM::CreateDeviceFromD3D.
parent
e29a0cf4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
12 deletions
+36
-12
d3drm.c
dlls/d3drm/d3drm.c
+13
-1
d3drm_private.h
dlls/d3drm/d3drm_private.h
+2
-0
device.c
dlls/d3drm/device.c
+10
-0
d3drm.c
dlls/d3drm/tests/d3drm.c
+11
-11
No files found.
dlls/d3drm/d3drm.c
View file @
9603125e
...
...
@@ -279,13 +279,25 @@ static HRESULT WINAPI d3drm1_CreateDeviceFromD3D(IDirect3DRM *iface,
{
struct
d3drm_device
*
object
;
HRESULT
hr
;
FIXME
(
"iface %p, d3d %p, d3d_device %p, device %p partial stub
.
\n
"
,
TRACE
(
"iface %p, d3d %p, d3d_device %p, device %p
.
\n
"
,
iface
,
d3d
,
d3d_device
,
device
);
if
(
!
device
)
return
D3DRMERR_BADVALUE
;
*
device
=
NULL
;
if
(
!
d3d
||
!
d3d_device
)
return
D3DRMERR_BADVALUE
;
hr
=
d3drm_device_create
(
&
object
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
d3drm_device_set_ddraw_device_d3d
(
object
,
iface
,
d3d
,
d3d_device
);
if
(
FAILED
(
hr
))
{
d3drm_device_destroy
(
object
);
return
hr
;
}
*
device
=
IDirect3DRMDevice_from_impl
(
object
);
return
D3DRM_OK
;
...
...
dlls/d3drm/d3drm_private.h
View file @
9603125e
...
...
@@ -50,6 +50,8 @@ HRESULT d3drm_device_create_surfaces_from_clipper(struct d3drm_device *object, I
HRESULT
d3drm_device_init
(
struct
d3drm_device
*
device
,
UINT
version
,
IDirect3DRM
*
d3drm
,
IDirectDraw
*
ddraw
,
IDirectDrawSurface
*
surface
,
BOOL
create_z_surface
)
DECLSPEC_HIDDEN
;
HRESULT
d3drm_device_set_ddraw_device_d3d
(
struct
d3drm_device
*
device
,
IDirect3DRM
*
d3drm
,
IDirect3D
*
d3d
,
IDirect3DDevice
*
d3d_device
)
DECLSPEC_HIDDEN
;
struct
d3drm_file_header
{
WORD
major
;
...
...
dlls/d3drm/device.c
View file @
9603125e
...
...
@@ -241,6 +241,16 @@ HRESULT d3drm_device_init(struct d3drm_device *device, UINT version, IDirect3DRM
return
hr
;
}
HRESULT
d3drm_device_set_ddraw_device_d3d
(
struct
d3drm_device
*
device
,
IDirect3DRM
*
d3drm
,
IDirect3D
*
d3d
,
IDirect3DDevice
*
d3d_device
)
{
device
->
d3drm
=
d3drm
;
IDirect3DRM_AddRef
(
d3drm
);
device
->
device
=
d3d_device
;
IDirect3DDevice_AddRef
(
d3d_device
);
return
IDirect3D_QueryInterface
(
d3d
,
&
IID_IDirectDraw
,
(
void
**
)
&
device
->
ddraw
);
}
static
HRESULT
WINAPI
d3drm_device1_QueryInterface
(
IDirect3DRMDevice
*
iface
,
REFIID
riid
,
void
**
out
)
{
struct
d3drm_device
*
device
=
impl_from_IDirect3DRMDevice
(
iface
);
...
...
dlls/d3drm/tests/d3drm.c
View file @
9603125e
...
...
@@ -3117,7 +3117,7 @@ static void test_create_device_from_d3d1(void)
IDirectDraw
*
ddraw1
=
NULL
;
IDirect3D
*
d3d1
=
NULL
;
IDirect3DRM
*
d3drm1
=
NULL
;
IDirect3DRMDevice
*
device1
=
NULL
;
IDirect3DRMDevice
*
device1
=
(
IDirect3DRMDevice
*
)
0xdeadbeef
;
IDirect3DDevice
*
d3ddevice1
=
NULL
,
*
d3drm_d3ddevice1
=
NULL
;
IDirectDrawSurface
*
surface
=
NULL
,
*
ds
=
NULL
,
*
d3drm_ds
=
NULL
;
DWORD
expected_flags
;
...
...
@@ -3152,13 +3152,20 @@ static void test_create_device_from_d3d1(void)
ok
(
hr
==
D3DRM_OK
,
"Cannot get IDirect3DRM interface (hr = %x).
\n
"
,
hr
);
ref1
=
get_refcount
((
IUnknown
*
)
d3drm1
);
hr
=
IDirect3DRM_CreateDeviceFromD3D
(
d3drm1
,
NULL
,
d3ddevice1
,
&
device1
);
ok
(
hr
==
D3DRMERR_BADVALUE
,
"Expected hr == D3DRMERR_BADVALUE, got %x.
\n
"
,
hr
);
ok
(
device1
==
NULL
,
"Expected device returned == NULL, got %p.
\n
"
,
device1
);
hr
=
IDirect3DRM_CreateDeviceFromD3D
(
d3drm1
,
d3d1
,
NULL
,
&
device1
);
ok
(
hr
==
D3DRMERR_BADVALUE
,
"Expected hr == D3DRMERR_BADVALUE, got %x.
\n
"
,
hr
);
hr
=
IDirect3DRM_CreateDeviceFromD3D
(
d3drm1
,
d3d1
,
d3ddevice1
,
NULL
);
ok
(
hr
==
D3DRMERR_BADVALUE
,
"Expected hr == D3DRMERR_BADVALUE, got %x.
\n
"
,
hr
);
hr
=
IDirect3DRM_CreateDeviceFromD3D
(
d3drm1
,
d3d1
,
d3ddevice1
,
&
device1
);
ok
(
hr
==
DD_OK
,
"Failed to create IDirect3DRMDevice interface (hr = %x)
\n
"
,
hr
);
ref2
=
get_refcount
((
IUnknown
*
)
d3drm1
);
todo_wine
ok
(
ref2
>
ref1
,
"expected ref2 > ref1, got ref1 = %u , ref2 = %u.
\n
"
,
ref1
,
ref2
);
ok
(
ref2
>
ref1
,
"expected ref2 > ref1, got ref1 = %u , ref2 = %u.
\n
"
,
ref1
,
ref2
);
device_ref2
=
get_refcount
((
IUnknown
*
)
d3ddevice1
);
todo_wine
ok
(
device_ref2
>
device_ref1
,
"Expected device_ref2 > device_ref1, got device_ref1 = %u, device_ref2 = %u.
\n
"
,
device_ref1
,
device_ref2
);
ok
(
device_ref2
>
device_ref1
,
"Expected device_ref2 > device_ref1, got device_ref1 = %u, device_ref2 = %u.
\n
"
,
device_ref1
,
device_ref2
);
hr
=
IDirectDraw_EnumSurfaces
(
ddraw1
,
DDENUMSURFACES_ALL
|
DDENUMSURFACES_DOESEXIST
,
NULL
,
&
surface
,
surface_callback
);
...
...
@@ -3166,9 +3173,7 @@ static void test_create_device_from_d3d1(void)
ok
(
surface
==
NULL
,
"No primary surface should have enumerated (%p).
\n
"
,
surface
);
hr
=
IDirect3DRMDevice_GetDirect3DDevice
(
device1
,
&
d3drm_d3ddevice1
);
todo_wine
ok
(
hr
==
D3DRM_OK
,
"Cannot get IDirect3DDevice interface (hr = %x).
\n
"
,
hr
);
if
(
FAILED
(
hr
))
goto
cleanup
;
ok
(
hr
==
D3DRM_OK
,
"Cannot get IDirect3DDevice interface (hr = %x).
\n
"
,
hr
);
ok
(
d3ddevice1
==
d3drm_d3ddevice1
,
"Expected Immediate Mode deivce created == %p, got %p.
\n
"
,
d3ddevice1
,
d3drm_d3ddevice1
);
/* Check properties of render target and depth surfaces */
...
...
@@ -3203,13 +3208,8 @@ static void test_create_device_from_d3d1(void)
IDirectDrawSurface_Release
(
d3drm_ds
);
IDirectDrawSurface_Release
(
ds
);
ds
=
NULL
;
IDirectDrawSurface_Release
(
surface
);
IDirect3DDevice_Release
(
d3drm_d3ddevice1
);
cleanup:
if
(
ds
)
IDirectDrawSurface_Release
(
ds
);
IDirect3DRMDevice_Release
(
device1
);
ref2
=
get_refcount
((
IUnknown
*
)
d3drm1
);
ok
(
ref1
==
ref2
,
"expected ref1 == ref2, got ref1 = %u, ref2 = %u.
\n
"
,
ref1
,
ref2
);
...
...
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