Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
9329efa8
Commit
9329efa8
authored
Oct 25, 2006
by
Stefan Dösinger
Committed by
Alexandre Julliard
Oct 25, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Forward the depth stencil buffer to wined3d.
parent
7bee505d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
direct3d.c
dlls/ddraw/direct3d.c
+15
-0
surface.c
dlls/ddraw/surface.c
+17
-0
No files found.
dlls/ddraw/direct3d.c
View file @
9329efa8
...
...
@@ -737,6 +737,8 @@ IDirect3DImpl_7_CreateDevice(IDirect3D7 *iface,
IParentImpl
*
IndexBufferParent
;
HRESULT
hr
;
IDirectDrawSurfaceImpl
*
target
=
ICOM_OBJECT
(
IDirectDrawSurfaceImpl
,
IDirectDrawSurface7
,
Surface
);
IDirectDrawSurface7
*
depthbuffer
=
NULL
;
static
DDSCAPS2
depthcaps
=
{
DDSCAPS_ZBUFFER
,
0
,
0
,
0
};
TRACE
(
"(%p)->(%s,%p,%p)
\n
"
,
iface
,
debugstr_guid
(
refiid
),
Surface
,
Device
);
*
Device
=
NULL
;
...
...
@@ -872,6 +874,19 @@ IDirect3DImpl_7_CreateDevice(IDirect3D7 *iface,
This
->
d3ddevice
=
object
;
/* Look for a depth buffer and enable the Z test if one is found */
hr
=
IDirectDrawSurface7_GetAttachedSurface
(
Surface
,
&
depthcaps
,
&
depthbuffer
);
if
(
depthbuffer
)
{
TRACE
(
"(%p) Depth buffer found, enabling Z test
\n
"
,
object
);
IWineD3DDevice_SetRenderState
(
This
->
wineD3DDevice
,
WINED3DRS_ZENABLE
,
TRUE
);
IDirectDrawSurface7_Release
(
depthbuffer
);
}
return
D3D_OK
;
}
...
...
dlls/ddraw/surface.c
View file @
9329efa8
...
...
@@ -309,6 +309,7 @@ IDirectDrawSurfaceImpl_Release(IDirectDrawSurface7 *iface)
/* Unset any index buffer, just to be sure */
IWineD3DDevice_SetIndices
(
ddraw
->
wineD3DDevice
,
NULL
,
0
);
IWineD3DDevice_SetDepthStencilSurface
(
ddraw
->
wineD3DDevice
,
NULL
);
if
(
IWineD3DDevice_Uninit3D
(
ddraw
->
wineD3DDevice
)
!=
D3D_OK
)
{
...
...
@@ -779,6 +780,14 @@ IDirectDrawSurfaceImpl_AddAttachedSurface(IDirectDrawSurface7 *iface,
Surf
->
first_attached
=
This
->
first_attached
;
This
->
next_attached
=
Surf
;
/* Check if we attach a back buffer to the primary */
if
(
Surf
->
surface_desc
.
ddsCaps
.
dwCaps
&
DDSCAPS_ZBUFFER
&&
This
->
surface_desc
.
ddsCaps
.
dwCaps
&
DDSCAPS_PRIMARYSURFACE
)
{
IWineD3DDevice_SetDepthStencilSurface
(
This
->
ddraw
->
wineD3DDevice
,
Surf
->
WineD3DSurface
);
}
/* MSDN:
* "This method increments the reference count of the surface being attached."
*/
...
...
@@ -838,6 +847,14 @@ IDirectDrawSurfaceImpl_DeleteAttachedSurface(IDirectDrawSurface7 *iface,
Surf
->
next_attached
=
NULL
;
Surf
->
first_attached
=
Surf
;
/* Check if we attach a back buffer to the primary */
if
(
Surf
->
surface_desc
.
ddsCaps
.
dwCaps
&
DDSCAPS_ZBUFFER
&&
This
->
surface_desc
.
ddsCaps
.
dwCaps
&
DDSCAPS_PRIMARYSURFACE
)
{
IWineD3DDevice_SetDepthStencilSurface
(
This
->
ddraw
->
wineD3DDevice
,
NULL
);
}
IDirectDrawSurface7_Release
(
Attach
);
return
DD_OK
;
}
...
...
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