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
c2ffffe1
Commit
c2ffffe1
authored
Apr 22, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Apr 27, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Use EnumAttachedSurfaces to search for a render target.
parent
86eb79b0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
9 deletions
+35
-9
ddraw.c
dlls/ddraw/ddraw.c
+35
-9
No files found.
dlls/ddraw/ddraw.c
View file @
c2ffffe1
...
...
@@ -2574,6 +2574,28 @@ IDirectDrawImpl_EnumSurfaces(IDirectDraw7 *iface,
return
DD_OK
;
}
static
HRESULT
WINAPI
findRenderTarget
(
IDirectDrawSurface7
*
surface
,
DDSURFACEDESC2
*
desc
,
void
*
ctx
)
{
IDirectDrawSurfaceImpl
*
surf
=
ICOM_OBJECT
(
IDirectDrawSurfaceImpl
,
IDirectDrawSurface7
,
surface
);
IDirectDrawSurfaceImpl
**
target
=
(
IDirectDrawSurfaceImpl
**
)
ctx
;
if
(
!
surf
->
isRenderTarget
)
{
*
target
=
surf
;
IDirectDrawSurface7_Release
(
surface
);
return
DDENUMRET_CANCEL
;
}
/* Recurse into the surface tree */
IDirectDrawSurface7_EnumAttachedSurfaces
(
surface
,
ctx
,
findRenderTarget
);
IDirectDrawSurface7_Release
(
surface
);
if
(
*
target
)
return
DDENUMRET_CANCEL
;
else
return
DDENUMRET_OK
;
/* Continue with the next neighbor surface */
}
/*****************************************************************************
* D3D7CB_CreateRenderTarget
*
...
...
@@ -2606,25 +2628,29 @@ D3D7CB_CreateRenderTarget(IUnknown *device, IUnknown *pSuperior,
HANDLE
*
pSharedHandle
)
{
ICOM_THIS_FROM
(
IDirectDrawImpl
,
IDirectDraw7
,
device
);
IDirectDrawSurfaceImpl
*
d3dSurface
=
(
IDirectDrawSurfaceImpl
*
)
This
->
d3d_target
->
first_complex
;
IDirectDrawSurfaceImpl
*
d3dSurface
=
This
->
d3d_target
->
first_complex
,
*
target
=
NULL
;
TRACE
(
"(%p) call back
\n
"
,
device
);
/* Loop through the complex chain and try to find unused primary surfaces */
while
(
d3dSurface
->
isRenderTarget
)
if
(
d3dSurface
->
isRenderTarget
)
{
IDirectDrawSurface7_EnumAttachedSurfaces
(
ICOM_INTERFACE
(
d3dSurface
,
IDirectDrawSurface7
),
&
target
,
findRenderTarget
);
}
else
{
d3dSurface
=
d3dSurface
->
next_complex
;
if
(
!
d3dSurface
)
break
;
target
=
d3dSurface
;
}
if
(
!
d3dSurface
)
if
(
!
target
)
{
d3dSurface
=
This
->
d3d_target
;
target
=
This
->
d3d_target
;
ERR
(
" (%p) : No DirectDrawSurface found to create the back buffer. Using the front buffer as back buffer. Uncertain consequences
\n
"
,
This
);
}
/* TODO: Return failure if the dimensions do not match, but this shouldn't happen */
*
ppSurface
=
d3dSurface
->
WineD3DSurface
;
d3dSurface
->
isRenderTarget
=
TRUE
;
*
ppSurface
=
target
->
WineD3DSurface
;
target
->
isRenderTarget
=
TRUE
;
TRACE
(
"Returning wineD3DSurface %p, it belongs to surface %p
\n
"
,
*
ppSurface
,
d3dSurface
);
return
D3D_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