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
51868820
Commit
51868820
authored
Sep 15, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 16, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Store the primary surface.
parent
9ea45ac6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
36 deletions
+16
-36
ddraw.c
dlls/ddraw/ddraw.c
+11
-36
ddraw_private.h
dlls/ddraw/ddraw_private.h
+2
-0
surface.c
dlls/ddraw/surface.c
+3
-0
No files found.
dlls/ddraw/ddraw.c
View file @
51868820
...
...
@@ -1974,41 +1974,21 @@ static HRESULT WINAPI ddraw4_TestCooperativeLevel(IDirectDraw4 *iface)
static
HRESULT
WINAPI
ddraw7_GetGDISurface
(
IDirectDraw7
*
iface
,
IDirectDrawSurface7
**
GDISurface
)
{
IDirectDrawImpl
*
This
=
impl_from_IDirectDraw7
(
iface
);
struct
wined3d_surface
*
wined3d_surface
;
IDirectDrawSurface7
*
ddsurf
;
HRESULT
hr
;
DDSCAPS2
ddsCaps
;
TRACE
(
"iface %p, surface %p.
\n
"
,
iface
,
GDISurface
);
/* Get the back buffer from the wineD3DDevice and search its
* attached surfaces for the front buffer. */
EnterCriticalSection
(
&
ddraw_cs
);
hr
=
wined3d_device_get_back_buffer
(
This
->
wined3d_device
,
0
,
0
,
WINED3DBACKBUFFER_TYPE_MONO
,
&
wined3d_surface
);
if
(
FAILED
(
hr
)
||
!
wined3d_surface
)
if
(
!
(
*
GDISurface
=
&
This
->
primary
->
IDirectDrawSurface7_iface
))
{
ERR
(
"IWineD3DDevice::GetBackBuffer failed
\n
"
);
WARN
(
"Primary not created yet.
\n
"
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
DDERR_NOTFOUND
;
}
IDirectDrawSurface7_AddRef
(
*
GDISurface
);
ddsurf
=
wined3d_surface_get_parent
(
wined3d_surface
);
wined3d_surface_decref
(
wined3d_surface
);
/* Find the front buffer */
ddsCaps
.
dwCaps
=
DDSCAPS_FRONTBUFFER
;
hr
=
IDirectDrawSurface7_GetAttachedSurface
(
ddsurf
,
&
ddsCaps
,
GDISurface
);
if
(
hr
!=
DD_OK
)
{
ERR
(
"IDirectDrawSurface7::GetAttachedSurface failed, hr = %x
\n
"
,
hr
);
}
/* The AddRef is OK this time */
LeaveCriticalSection
(
&
ddraw_cs
);
return
hr
;
return
DD_OK
;
}
static
HRESULT
WINAPI
ddraw4_GetGDISurface
(
IDirectDraw4
*
iface
,
IDirectDrawSurface4
**
surface
)
...
...
@@ -2803,19 +2783,11 @@ static HRESULT ddraw_create_swapchain(IDirectDrawImpl *ddraw, IDirectDrawSurface
WINED3DPRESENT_PARAMETERS
presentation_parameters
;
IDirectDrawSurfaceImpl
*
target
=
surface
;
HRESULT
hr
=
WINED3D_OK
;
struct
list
*
entry
;
/* Search for the primary to use as render target. */
LIST_FOR_EACH
(
entry
,
&
ddraw
->
surface_list
)
if
(
ddraw
->
primary
)
{
IDirectDrawSurfaceImpl
*
primary
=
LIST_ENTRY
(
entry
,
IDirectDrawSurfaceImpl
,
surface_list_entry
);
if
((
primary
->
surface_desc
.
ddsCaps
.
dwCaps
&
(
DDSCAPS_PRIMARYSURFACE
|
DDSCAPS_FRONTBUFFER
))
==
(
DDSCAPS_PRIMARYSURFACE
|
DDSCAPS_FRONTBUFFER
))
{
TRACE
(
"Using primary %p as render target.
\n
"
,
target
);
target
=
primary
;
break
;
}
TRACE
(
"Using primary %p.
\n
"
,
ddraw
->
primary
);
target
=
ddraw
->
primary
;
}
memset
(
&
presentation_parameters
,
0
,
sizeof
(
presentation_parameters
));
...
...
@@ -3251,6 +3223,9 @@ static HRESULT CreateSurface(IDirectDrawImpl *ddraw, DDSURFACEDESC2 *DDSD,
}
}
if
(
desc2
.
ddsCaps
.
dwCaps
&
DDSCAPS_PRIMARYSURFACE
)
ddraw
->
primary
=
object
;
/* Create a WineD3DTexture if a texture was requested */
if
(
desc2
.
ddsCaps
.
dwCaps
&
DDSCAPS_TEXTURE
)
{
...
...
dlls/ddraw/ddraw_private.h
View file @
51868820
...
...
@@ -88,6 +88,8 @@ struct IDirectDrawImpl
struct
wined3d_device
*
wined3d_device
;
BOOL
d3d_initialized
;
IDirectDrawSurfaceImpl
*
primary
;
/* DirectDraw things, which are not handled by WineD3D */
DWORD
cooperative_level
;
...
...
dlls/ddraw/surface.c
View file @
51868820
...
...
@@ -5100,6 +5100,9 @@ static void STDMETHODCALLTYPE ddraw_surface_wined3d_object_destroyed(void *paren
/* Reduce the ddraw surface count. */
list_remove
(
&
surface
->
surface_list_entry
);
if
(
surface
==
surface
->
ddraw
->
primary
)
surface
->
ddraw
->
primary
=
NULL
;
HeapFree
(
GetProcessHeap
(),
0
,
surface
);
}
...
...
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