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
0ed3eb01
Commit
0ed3eb01
authored
Jun 05, 2012
by
Józef Kucia
Committed by
Alexandre Julliard
Jun 06, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Implement ID3DXRenderToSurface::GetDesc.
parent
5c6438e8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
18 deletions
+49
-18
render.c
dlls/d3dx9_36/render.c
+16
-3
core.c
dlls/d3dx9_36/tests/core.c
+33
-15
No files found.
dlls/d3dx9_36/render.c
View file @
0ed3eb01
...
...
@@ -28,6 +28,7 @@ struct render_to_surface
LONG
ref
;
IDirect3DDevice9
*
device
;
D3DXRTS_DESC
desc
;
};
static
inline
struct
render_to_surface
*
impl_from_ID3DXRenderToSurface
(
ID3DXRenderToSurface
*
iface
)
...
...
@@ -91,8 +92,14 @@ static HRESULT WINAPI D3DXRenderToSurface_GetDevice(ID3DXRenderToSurface *iface,
static
HRESULT
WINAPI
D3DXRenderToSurface_GetDesc
(
ID3DXRenderToSurface
*
iface
,
D3DXRTS_DESC
*
desc
)
{
FIXME
(
"(%p)->(%p): stub
\n
"
,
iface
,
desc
);
return
E_NOTIMPL
;
struct
render_to_surface
*
render
=
impl_from_ID3DXRenderToSurface
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
iface
,
desc
);
if
(
!
desc
)
return
D3DERR_INVALIDCALL
;
*
desc
=
render
->
desc
;
return
D3D_OK
;
}
static
HRESULT
WINAPI
D3DXRenderToSurface_BeginScene
(
ID3DXRenderToSurface
*
iface
,
...
...
@@ -147,7 +154,7 @@ HRESULT WINAPI D3DXCreateRenderToSurface(IDirect3DDevice9 *device,
{
struct
render_to_surface
*
render
;
FIXME
(
"(%p, %u, %u, %#x, %d, %#x, %p): semi-stub
\n
"
,
device
,
width
,
height
,
format
,
TRACE
(
"(%p, %u, %u, %#x, %d, %#x, %p)
\n
"
,
device
,
width
,
height
,
format
,
depth_stencil
,
depth_stencil_format
,
out
);
if
(
!
device
||
!
out
)
return
D3DERR_INVALIDCALL
;
...
...
@@ -161,6 +168,12 @@ HRESULT WINAPI D3DXCreateRenderToSurface(IDirect3DDevice9 *device,
IDirect3DDevice9_AddRef
(
device
);
render
->
device
=
device
;
render
->
desc
.
Width
=
width
;
render
->
desc
.
Height
=
height
;
render
->
desc
.
Format
=
format
;
render
->
desc
.
DepthStencil
=
depth_stencil
;
render
->
desc
.
DepthStencilFormat
=
depth_stencil_format
;
*
out
=
&
render
->
ID3DXRenderToSurface_iface
;
return
D3D_OK
;
}
dlls/d3dx9_36/tests/core.c
View file @
0ed3eb01
...
...
@@ -448,9 +448,20 @@ static void test_ID3DXFont(IDirect3DDevice9 *device)
void
test_D3DXCreateRenderToSurface
(
IDirect3DDevice9
*
device
)
{
int
i
;
HRESULT
hr
;
ULONG
ref_count
;
D3DXRTS_DESC
desc
;
ID3DXRenderToSurface
*
render
=
(
void
*
)
0xdeadbeef
;
static
const
D3DXRTS_DESC
tests
[]
=
{
{
0
,
256
,
D3DFMT_A8R8G8B8
,
FALSE
,
D3DFMT_UNKNOWN
},
{
256
,
0
,
D3DFMT_A8R8G8B8
,
FALSE
,
D3DFMT_UNKNOWN
},
{
256
,
0
,
D3DFMT_A8R8G8B8
,
FALSE
,
D3DFMT_D24S8
},
{
256
,
256
,
D3DFMT_UNKNOWN
,
FALSE
,
D3DFMT_R8G8B8
},
{
0
,
0
,
D3DFMT_UNKNOWN
,
FALSE
,
D3DFMT_UNKNOWN
},
{
-
1
,
-
1
,
MAKEFOURCC
(
'B'
,
'A'
,
'D'
,
'F'
),
TRUE
,
MAKEFOURCC
(
'B'
,
'A'
,
'D'
,
'F'
)
}
};
hr
=
D3DXCreateRenderToSurface
(
NULL
/* device */
,
256
,
256
,
D3DFMT_A8R8G8B8
,
FALSE
,
D3DFMT_UNKNOWN
,
&
render
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"D3DXCreateRenderToSurface returned %#x, expected %#x
\n
"
,
hr
,
D3DERR_INVALIDCALL
);
...
...
@@ -459,21 +470,28 @@ void test_D3DXCreateRenderToSurface(IDirect3DDevice9 *device)
hr
=
D3DXCreateRenderToSurface
(
device
,
256
,
256
,
D3DFMT_A8R8G8B8
,
FALSE
,
D3DFMT_UNKNOWN
,
NULL
/* out */
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"D3DXCreateRenderToSurface returned %#x, expected %#x
\n
"
,
hr
,
D3DERR_INVALIDCALL
);
hr
=
D3DXCreateRenderToSurface
(
device
,
0
/* width */
,
256
,
D3DFMT_A8R8G8B8
,
FALSE
,
D3DFMT_UNKNOWN
,
&
render
);
ok
(
hr
==
D3D_OK
,
"D3DXCreateRenderToSurface returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
if
(
SUCCEEDED
(
hr
))
ID3DXRenderToSurface_Release
(
render
);
hr
=
D3DXCreateRenderToSurface
(
device
,
256
,
0
/* height */
,
D3DFMT_A8R8G8B8
,
FALSE
,
D3DFMT_UNKNOWN
,
&
render
);
ok
(
hr
==
D3D_OK
,
"D3DXCreateRenderToSurface returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
if
(
SUCCEEDED
(
hr
))
ID3DXRenderToSurface_Release
(
render
);
hr
=
D3DXCreateRenderToSurface
(
device
,
256
,
256
,
D3DFMT_UNKNOWN
/* format */
,
FALSE
,
D3DFMT_UNKNOWN
,
&
render
);
ok
(
hr
==
D3D_OK
,
"D3DXCreateRenderToSurface returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
if
(
SUCCEEDED
(
hr
))
ID3DXRenderToSurface_Release
(
render
);
hr
=
D3DXCreateRenderToSurface
(
device
,
0
,
0
,
D3DFMT_UNKNOWN
,
FALSE
,
D3DFMT_UNKNOWN
,
&
render
);
ok
(
hr
==
D3D_OK
,
"D3DXCreateRenderToSurface returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
if
(
SUCCEEDED
(
hr
))
ID3DXRenderToSurface_Release
(
render
);
for
(
i
=
0
;
i
<
sizeof
(
tests
)
/
sizeof
(
tests
[
0
]);
i
++
)
{
hr
=
D3DXCreateRenderToSurface
(
device
,
tests
[
i
].
Width
,
tests
[
i
].
Height
,
tests
[
i
].
Format
,
tests
[
i
].
DepthStencil
,
tests
[
i
].
DepthStencilFormat
,
&
render
);
ok
(
hr
==
D3D_OK
,
"%d: D3DXCreateRenderToSurface returned %#x, expected %#x
\n
"
,
i
,
hr
,
D3D_OK
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
ID3DXRenderToSurface_GetDesc
(
render
,
&
desc
);
ok
(
hr
==
D3D_OK
,
"%d: GetDesc failed %#x
\n
"
,
i
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
ok
(
desc
.
Width
==
tests
[
i
].
Width
,
"%d: Got width %u, expected %u
\n
"
,
i
,
desc
.
Width
,
tests
[
i
].
Width
);
ok
(
desc
.
Height
==
tests
[
i
].
Height
,
"%d: Got height %u, expected %u
\n
"
,
i
,
desc
.
Height
,
tests
[
i
].
Height
);
ok
(
desc
.
Format
==
tests
[
i
].
Format
,
"%d: Got format %#x, expected %#x
\n
"
,
i
,
desc
.
Format
,
tests
[
i
].
Format
);
ok
(
desc
.
DepthStencil
==
tests
[
i
].
DepthStencil
,
"%d: Got depth stencil %d, expected %d
\n
"
,
i
,
desc
.
DepthStencil
,
tests
[
i
].
DepthStencil
);
ok
(
desc
.
DepthStencilFormat
==
tests
[
i
].
DepthStencilFormat
,
"%d: Got depth stencil format %#x, expected %#x
\n
"
,
i
,
desc
.
DepthStencilFormat
,
tests
[
i
].
DepthStencilFormat
);
}
ID3DXRenderToSurface_Release
(
render
);
}
}
/* check device ref count */
ref_count
=
get_ref
((
IUnknown
*
)
device
);
...
...
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