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
35c13b08
Commit
35c13b08
authored
Jun 10, 2012
by
Józef Kucia
Committed by
Alexandre Julliard
Jun 11, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Add ID3DXRenderToEnvMap interface stub.
parent
f072404f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
195 additions
and
6 deletions
+195
-6
render.c
dlls/d3dx9_36/render.c
+193
-4
core.c
dlls/d3dx9_36/tests/core.c
+2
-2
No files found.
dlls/d3dx9_36/render.c
View file @
35c13b08
...
...
@@ -315,7 +315,7 @@ static HRESULT WINAPI D3DXRenderToSurface_OnResetDevice(ID3DXRenderToSurface *if
return
D3D_OK
;
}
static
const
ID3DXRenderToSurfaceVtbl
d3dx_
render_to_surface_vtbl
=
static
const
ID3DXRenderToSurfaceVtbl
render_to_surface_vtbl
=
{
/* IUnknown methods */
D3DXRenderToSurface_QueryInterface
,
...
...
@@ -354,7 +354,7 @@ HRESULT WINAPI D3DXCreateRenderToSurface(IDirect3DDevice9 *device,
render
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
struct
render_to_surface
));
if
(
!
render
)
return
E_OUTOFMEMORY
;
render
->
ID3DXRenderToSurface_iface
.
lpVtbl
=
&
d3dx_
render_to_surface_vtbl
;
render
->
ID3DXRenderToSurface_iface
.
lpVtbl
=
&
render_to_surface_vtbl
;
render
->
ref
=
1
;
render
->
desc
.
Width
=
width
;
...
...
@@ -387,6 +387,172 @@ HRESULT WINAPI D3DXCreateRenderToSurface(IDirect3DDevice9 *device,
return
D3D_OK
;
}
struct
render_to_envmap
{
ID3DXRenderToEnvMap
ID3DXRenderToEnvMap_iface
;
LONG
ref
;
IDirect3DDevice9
*
device
;
D3DXRTE_DESC
desc
;
};
static
inline
struct
render_to_envmap
*
impl_from_ID3DXRenderToEnvMap
(
ID3DXRenderToEnvMap
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
render_to_envmap
,
ID3DXRenderToEnvMap_iface
);
}
static
HRESULT
WINAPI
D3DXRenderToEnvMap_QueryInterface
(
ID3DXRenderToEnvMap
*
iface
,
REFIID
riid
,
void
**
out
)
{
TRACE
(
"iface %p, riid %s, out %p
\n
"
,
iface
,
debugstr_guid
(
riid
),
out
);
if
(
IsEqualGUID
(
riid
,
&
IID_ID3DXRenderToEnvMap
)
||
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
D3DXRenderToEnvMap_AddRef
(
ID3DXRenderToEnvMap
*
iface
)
{
struct
render_to_envmap
*
render
=
impl_from_ID3DXRenderToEnvMap
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
render
->
ref
);
TRACE
(
"%p increasing refcount to %u
\n
"
,
iface
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
D3DXRenderToEnvMap_Release
(
ID3DXRenderToEnvMap
*
iface
)
{
struct
render_to_envmap
*
render
=
impl_from_ID3DXRenderToEnvMap
(
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
D3DXRenderToEnvMap_GetDevice
(
ID3DXRenderToEnvMap
*
iface
,
IDirect3DDevice9
**
device
)
{
struct
render_to_envmap
*
render
=
impl_from_ID3DXRenderToEnvMap
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
iface
,
device
);
if
(
!
device
)
return
D3DERR_INVALIDCALL
;
IDirect3DDevice9_AddRef
(
render
->
device
);
*
device
=
render
->
device
;
return
D3D_OK
;
}
static
HRESULT
WINAPI
D3DXRenderToEnvMap_GetDesc
(
ID3DXRenderToEnvMap
*
iface
,
D3DXRTE_DESC
*
desc
)
{
struct
render_to_envmap
*
render
=
impl_from_ID3DXRenderToEnvMap
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
iface
,
desc
);
if
(
!
desc
)
return
D3DERR_INVALIDCALL
;
*
desc
=
render
->
desc
;
return
D3D_OK
;
}
static
HRESULT
WINAPI
D3DXRenderToEnvMap_BeginCube
(
ID3DXRenderToEnvMap
*
iface
,
IDirect3DCubeTexture9
*
texture
)
{
FIXME
(
"(%p)->(%p): stub
\n
"
,
iface
,
texture
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
D3DXRenderToEnvMap_BeginSphere
(
ID3DXRenderToEnvMap
*
iface
,
IDirect3DTexture9
*
texture
)
{
FIXME
(
"(%p)->(%p): stub
\n
"
,
iface
,
texture
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
D3DXRenderToEnvMap_BeginHemisphere
(
ID3DXRenderToEnvMap
*
iface
,
IDirect3DTexture9
*
pos_z_texture
,
IDirect3DTexture9
*
neg_z_texture
)
{
FIXME
(
"(%p)->(%p, %p): stub
\n
"
,
iface
,
pos_z_texture
,
neg_z_texture
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
D3DXRenderToEnvMap_BeginParabolic
(
ID3DXRenderToEnvMap
*
iface
,
IDirect3DTexture9
*
pos_z_texture
,
IDirect3DTexture9
*
neg_z_texture
)
{
FIXME
(
"(%p)->(%p, %p): stub
\n
"
,
iface
,
pos_z_texture
,
neg_z_texture
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
D3DXRenderToEnvMap_Face
(
ID3DXRenderToEnvMap
*
iface
,
D3DCUBEMAP_FACES
face
,
DWORD
filter
)
{
FIXME
(
"(%p)->(%u, %#x): stub
\n
"
,
iface
,
face
,
filter
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
D3DXRenderToEnvMap_End
(
ID3DXRenderToEnvMap
*
iface
,
DWORD
filter
)
{
FIXME
(
"(%p)->(%#x): stub
\n
"
,
iface
,
filter
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
D3DXRenderToEnvMap_OnLostDevice
(
ID3DXRenderToEnvMap
*
iface
)
{
FIXME
(
"(%p)->(): stub
\n
"
,
iface
);
return
D3D_OK
;
}
static
HRESULT
WINAPI
D3DXRenderToEnvMap_OnResetDevice
(
ID3DXRenderToEnvMap
*
iface
)
{
FIXME
(
"(%p)->(): stub
\n
"
,
iface
);
return
D3D_OK
;
}
static
const
ID3DXRenderToEnvMapVtbl
render_to_envmap_vtbl
=
{
/* IUnknown methods */
D3DXRenderToEnvMap_QueryInterface
,
D3DXRenderToEnvMap_AddRef
,
D3DXRenderToEnvMap_Release
,
/* ID3DXRenderToEnvMap methods */
D3DXRenderToEnvMap_GetDevice
,
D3DXRenderToEnvMap_GetDesc
,
D3DXRenderToEnvMap_BeginCube
,
D3DXRenderToEnvMap_BeginSphere
,
D3DXRenderToEnvMap_BeginHemisphere
,
D3DXRenderToEnvMap_BeginParabolic
,
D3DXRenderToEnvMap_Face
,
D3DXRenderToEnvMap_End
,
D3DXRenderToEnvMap_OnLostDevice
,
D3DXRenderToEnvMap_OnResetDevice
};
HRESULT
WINAPI
D3DXCreateRenderToEnvMap
(
IDirect3DDevice9
*
device
,
UINT
size
,
UINT
mip_levels
,
...
...
@@ -395,10 +561,33 @@ HRESULT WINAPI D3DXCreateRenderToEnvMap(IDirect3DDevice9 *device,
D3DFORMAT
depth_stencil_format
,
ID3DXRenderToEnvMap
**
out
)
{
FIXME
(
"(%p, %u, %u, %#x, %d, %#x, %p): stub
\n
"
,
device
,
size
,
mip_levels
,
HRESULT
hr
;
struct
render_to_envmap
*
render
;
TRACE
(
"(%p, %u, %u, %#x, %d, %#x, %p)
\n
"
,
device
,
size
,
mip_levels
,
format
,
depth_stencil
,
depth_stencil_format
,
out
);
if
(
!
device
||
!
out
)
return
D3DERR_INVALIDCALL
;
return
E_NOTIMPL
;
hr
=
D3DXCheckTextureRequirements
(
device
,
&
size
,
&
size
,
&
mip_levels
,
D3DUSAGE_RENDERTARGET
,
&
format
,
D3DPOOL_DEFAULT
);
if
(
FAILED
(
hr
))
return
hr
;
render
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
struct
render_to_envmap
));
if
(
!
render
)
return
E_OUTOFMEMORY
;
render
->
ID3DXRenderToEnvMap_iface
.
lpVtbl
=
&
render_to_envmap_vtbl
;
render
->
ref
=
1
;
render
->
desc
.
Size
=
size
;
render
->
desc
.
MipLevels
=
mip_levels
;
render
->
desc
.
Format
=
format
;
render
->
desc
.
DepthStencil
=
depth_stencil
;
render
->
desc
.
DepthStencilFormat
=
depth_stencil_format
;
IDirect3DDevice9_AddRef
(
device
);
render
->
device
=
device
;
*
out
=
&
render
->
ID3DXRenderToEnvMap_iface
;
return
D3D_OK
;
}
dlls/d3dx9_36/tests/core.c
View file @
35c13b08
...
...
@@ -908,7 +908,7 @@ void test_D3DXCreateRenderToEnvMap(IDirect3DDevice9 *device)
const
D3DXRTE_DESC
*
expected
=
&
tests
[
i
].
expected_values
;
hr
=
D3DXCreateRenderToEnvMap
(
device
,
parameters
->
Size
,
parameters
->
MipLevels
,
parameters
->
Format
,
parameters
->
DepthStencil
,
parameters
->
DepthStencilFormat
,
&
render
);
todo_wine
ok
(
hr
==
D3D_OK
,
"%d: D3DXCreateRenderToEnvMap returned %#x, expected %#x
\n
"
,
i
,
hr
,
D3D_OK
);
ok
(
hr
==
D3D_OK
,
"%d: D3DXCreateRenderToEnvMap returned %#x, expected %#x
\n
"
,
i
,
hr
,
D3D_OK
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
ID3DXRenderToEnvMap_GetDesc
(
render
,
&
desc
);
...
...
@@ -930,7 +930,7 @@ void test_D3DXCreateRenderToEnvMap(IDirect3DDevice9 *device)
/* check device ref count */
ref_count
=
get_ref
((
IUnknown
*
)
device
);
hr
=
D3DXCreateRenderToEnvMap
(
device
,
0
,
0
,
D3DFMT_UNKNOWN
,
FALSE
,
D3DFMT_UNKNOWN
,
&
render
);
todo_wine
check_ref
((
IUnknown
*
)
device
,
ref_count
+
1
);
check_ref
((
IUnknown
*
)
device
,
ref_count
+
1
);
if
(
SUCCEEDED
(
hr
))
ID3DXRenderToEnvMap_Release
(
render
);
}
...
...
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