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
5c6438e8
Commit
5c6438e8
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: Add ID3DXRenderToSurface interface stub.
parent
42001983
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
129 additions
and
4 deletions
+129
-4
render.c
dlls/d3dx9_36/render.c
+129
-2
core.c
dlls/d3dx9_36/tests/core.c
+0
-2
No files found.
dlls/d3dx9_36/render.c
View file @
5c6438e8
...
...
@@ -22,6 +22,121 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
d3dx
);
struct
render_to_surface
{
ID3DXRenderToSurface
ID3DXRenderToSurface_iface
;
LONG
ref
;
IDirect3DDevice9
*
device
;
};
static
inline
struct
render_to_surface
*
impl_from_ID3DXRenderToSurface
(
ID3DXRenderToSurface
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
render_to_surface
,
ID3DXRenderToSurface_iface
);
}
static
HRESULT
WINAPI
D3DXRenderToSurface_QueryInterface
(
ID3DXRenderToSurface
*
iface
,
REFIID
riid
,
void
**
out
)
{
TRACE
(
"iface %p, riid %s, out %p
\n
"
,
iface
,
debugstr_guid
(
riid
),
out
);
if
(
IsEqualGUID
(
riid
,
&
IID_ID3DXRenderToSurface
)
||
IsEqualGUID
(
riid
,
&
IID_IUnknown
))
{
IUnknown_AddRef
(
iface
);
*
out
=
iface
;
return
S_OK
;
}
WARN
(
"%s not implemented, returning E_NOINTERFACE
\n
"
,
debugstr_guid
(
riid
));
*
out
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
D3DXRenderToSurface_AddRef
(
ID3DXRenderToSurface
*
iface
)
{
struct
render_to_surface
*
render
=
impl_from_ID3DXRenderToSurface
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
render
->
ref
);
TRACE
(
"%p increasing refcount to %u
\n
"
,
iface
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
D3DXRenderToSurface_Release
(
ID3DXRenderToSurface
*
iface
)
{
struct
render_to_surface
*
render
=
impl_from_ID3DXRenderToSurface
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
render
->
ref
);
TRACE
(
"%p decreasing refcount to %u
\n
"
,
iface
,
ref
);
if
(
!
ref
)
{
IDirect3DDevice9_Release
(
render
->
device
);
HeapFree
(
GetProcessHeap
(),
0
,
render
);
}
return
ref
;
}
static
HRESULT
WINAPI
D3DXRenderToSurface_GetDevice
(
ID3DXRenderToSurface
*
iface
,
IDirect3DDevice9
**
device
)
{
FIXME
(
"(%p)->(%p): stub
\n
"
,
iface
,
device
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
D3DXRenderToSurface_GetDesc
(
ID3DXRenderToSurface
*
iface
,
D3DXRTS_DESC
*
desc
)
{
FIXME
(
"(%p)->(%p): stub
\n
"
,
iface
,
desc
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
D3DXRenderToSurface_BeginScene
(
ID3DXRenderToSurface
*
iface
,
IDirect3DSurface9
*
surface
,
const
D3DVIEWPORT9
*
viewport
)
{
FIXME
(
"(%p)->(%p, %p): stub
\n
"
,
iface
,
surface
,
viewport
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
D3DXRenderToSurface_EndScene
(
ID3DXRenderToSurface
*
iface
,
DWORD
mip_filter
)
{
FIXME
(
"(%p)->(%#x): stub
\n
"
,
iface
,
mip_filter
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
D3DXRenderToSurface_OnLostDevice
(
ID3DXRenderToSurface
*
iface
)
{
FIXME
(
"(%p)->(): stub
\n
"
,
iface
);
return
D3D_OK
;
}
static
HRESULT
WINAPI
D3DXRenderToSurface_OnResetDevice
(
ID3DXRenderToSurface
*
iface
)
{
FIXME
(
"(%p)->(): stub
\n
"
,
iface
);
return
D3D_OK
;
}
static
const
ID3DXRenderToSurfaceVtbl
d3dx_render_to_surface_vtbl
=
{
/* IUnknown methods */
D3DXRenderToSurface_QueryInterface
,
D3DXRenderToSurface_AddRef
,
D3DXRenderToSurface_Release
,
/* ID3DXRenderToSurface methods */
D3DXRenderToSurface_GetDevice
,
D3DXRenderToSurface_GetDesc
,
D3DXRenderToSurface_BeginScene
,
D3DXRenderToSurface_EndScene
,
D3DXRenderToSurface_OnLostDevice
,
D3DXRenderToSurface_OnResetDevice
};
HRESULT
WINAPI
D3DXCreateRenderToSurface
(
IDirect3DDevice9
*
device
,
UINT
width
,
UINT
height
,
...
...
@@ -30,10 +145,22 @@ HRESULT WINAPI D3DXCreateRenderToSurface(IDirect3DDevice9 *device,
D3DFORMAT
depth_stencil_format
,
ID3DXRenderToSurface
**
out
)
{
FIXME
(
"(%p, %u, %u, %#x, %d, %#x, %p): stub
\n
"
,
device
,
width
,
height
,
format
,
struct
render_to_surface
*
render
;
FIXME
(
"(%p, %u, %u, %#x, %d, %#x, %p): semi-stub
\n
"
,
device
,
width
,
height
,
format
,
depth_stencil
,
depth_stencil_format
,
out
);
if
(
!
device
||
!
out
)
return
D3DERR_INVALIDCALL
;
return
E_NOTIMPL
;
render
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
struct
render_to_surface
));
if
(
!
render
)
return
E_OUTOFMEMORY
;
render
->
ID3DXRenderToSurface_iface
.
lpVtbl
=
&
d3dx_render_to_surface_vtbl
;
render
->
ref
=
1
;
IDirect3DDevice9_AddRef
(
device
);
render
->
device
=
device
;
*
out
=
&
render
->
ID3DXRenderToSurface_iface
;
return
D3D_OK
;
}
dlls/d3dx9_36/tests/core.c
View file @
5c6438e8
...
...
@@ -459,7 +459,6 @@ 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
);
todo_wine
{
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
);
...
...
@@ -481,7 +480,6 @@ void test_D3DXCreateRenderToSurface(IDirect3DDevice9 *device)
hr
=
D3DXCreateRenderToSurface
(
device
,
0
,
0
,
D3DFMT_UNKNOWN
,
FALSE
,
D3DFMT_UNKNOWN
,
&
render
);
check_ref
((
IUnknown
*
)
device
,
ref_count
+
1
);
if
(
SUCCEEDED
(
hr
))
ID3DXRenderToSurface_Release
(
render
);
}
}
START_TEST
(
core
)
...
...
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