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
8b95d8d2
Commit
8b95d8d2
authored
Apr 10, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 11, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9: Introduce a separate function for swapchain creation.
parent
31f6f48b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
26 deletions
+35
-26
d3d9_private.h
dlls/d3d9/d3d9_private.h
+2
-2
device.c
dlls/d3d9/device.c
+7
-23
swapchain.c
dlls/d3d9/swapchain.c
+26
-1
No files found.
dlls/d3d9/d3d9_private.h
View file @
8b95d8d2
...
...
@@ -211,8 +211,8 @@ typedef struct IDirect3DSwapChain9Impl
IDirect3DDevice9Ex
*
parentDevice
;
}
IDirect3DSwapChain9Impl
;
HRESULT
swapchain_init
(
IDirect3DSwapChain9Impl
*
swapchain
,
IDirect3DDevice9Impl
*
device
,
D3DPRESENT_PARAMETERS
*
present_parameters
)
DECLSPEC_HIDDEN
;
HRESULT
d3d9_swapchain_create
(
IDirect3DDevice9Impl
*
device
,
D3DPRESENT_PARAMETERS
*
present_parameters
,
IDirect3DSwapChain9Impl
**
swapchain
)
DECLSPEC_HIDDEN
;
/* ----------------- */
/* IDirect3DSurface9 */
...
...
dlls/d3d9/device.c
View file @
8b95d8d2
...
...
@@ -443,32 +443,17 @@ static BOOL WINAPI IDirect3DDevice9Impl_ShowCursor(IDirect3DDevice9Ex *iface, BO
static
HRESULT
WINAPI
DECLSPEC_HOTPATCH
IDirect3DDevice9Impl_CreateAdditionalSwapChain
(
IDirect3DDevice9Ex
*
iface
,
D3DPRESENT_PARAMETERS
*
present_parameters
,
IDirect3DSwapChain9
**
swapchain
)
{
IDirect3DDevice9Impl
*
This
=
impl_from_IDirect3DDevice9Ex
(
iface
);
IDirect3DDevice9Impl
*
device
=
impl_from_IDirect3DDevice9Ex
(
iface
);
IDirect3DSwapChain9Impl
*
object
;
HRESULT
hr
;
TRACE
(
"iface %p, present_parameters %p, swapchain %p.
\n
"
,
iface
,
present_parameters
,
swapchain
);
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
if
(
!
object
)
{
ERR
(
"Failed to allocate swapchain memory.
\n
"
);
return
E_OUTOFMEMORY
;
}
if
(
SUCCEEDED
(
hr
=
d3d9_swapchain_create
(
device
,
present_parameters
,
&
object
)))
*
swapchain
=
(
IDirect3DSwapChain9
*
)
object
;
hr
=
swapchain_init
(
object
,
This
,
present_parameters
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to initialize swapchain, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
hr
;
}
TRACE
(
"Created swapchain %p.
\n
"
,
object
);
*
swapchain
=
(
IDirect3DSwapChain9
*
)
object
;
return
D3D_OK
;
return
hr
;
}
static
HRESULT
WINAPI
DECLSPEC_HOTPATCH
IDirect3DDevice9Impl_GetSwapChain
(
IDirect3DDevice9Ex
*
iface
,
...
...
@@ -3291,7 +3276,7 @@ static HRESULT CDECL device_parent_create_swapchain(struct wined3d_device_parent
{
struct
IDirect3DDevice9Impl
*
device
=
device_from_device_parent
(
device_parent
);
D3DPRESENT_PARAMETERS
local_parameters
;
IDirect3DSwapChain9
*
d3d_swapchain
;
IDirect3DSwapChain9
Impl
*
d3d_swapchain
;
HRESULT
hr
;
TRACE
(
"device_parent %p, desc %p, swapchain %p
\n
"
,
device_parent
,
desc
,
swapchain
);
...
...
@@ -3312,8 +3297,7 @@ static HRESULT CDECL device_parent_create_swapchain(struct wined3d_device_parent
local_parameters
.
FullScreen_RefreshRateInHz
=
desc
->
refresh_rate
;
local_parameters
.
PresentationInterval
=
desc
->
swap_interval
;
hr
=
IDirect3DDevice9Impl_CreateAdditionalSwapChain
(
&
device
->
IDirect3DDevice9Ex_iface
,
&
local_parameters
,
&
d3d_swapchain
);
hr
=
d3d9_swapchain_create
(
device
,
&
local_parameters
,
&
d3d_swapchain
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to create swapchain, hr %#x.
\n
"
,
hr
);
...
...
@@ -3321,7 +3305,7 @@ static HRESULT CDECL device_parent_create_swapchain(struct wined3d_device_parent
return
hr
;
}
*
swapchain
=
((
IDirect3DSwapChain9Impl
*
)
d3d_swapchain
)
->
wined3d_swapchain
;
*
swapchain
=
d3d_swapchain
->
wined3d_swapchain
;
wined3d_swapchain_incref
(
*
swapchain
);
IDirect3DSwapChain9_Release
((
IDirect3DSwapChain9
*
)
d3d_swapchain
);
...
...
dlls/d3d9/swapchain.c
View file @
8b95d8d2
...
...
@@ -237,7 +237,7 @@ static const struct wined3d_parent_ops d3d9_swapchain_wined3d_parent_ops =
d3d9_swapchain_wined3d_object_released
,
};
HRESULT
swapchain_init
(
IDirect3DSwapChain9Impl
*
swapchain
,
IDirect3DDevice9Impl
*
device
,
static
HRESULT
swapchain_init
(
IDirect3DSwapChain9Impl
*
swapchain
,
IDirect3DDevice9Impl
*
device
,
D3DPRESENT_PARAMETERS
*
present_parameters
)
{
struct
wined3d_swapchain_desc
desc
;
...
...
@@ -294,3 +294,28 @@ HRESULT swapchain_init(IDirect3DSwapChain9Impl *swapchain, IDirect3DDevice9Impl
return
D3D_OK
;
}
HRESULT
d3d9_swapchain_create
(
IDirect3DDevice9Impl
*
device
,
D3DPRESENT_PARAMETERS
*
present_parameters
,
IDirect3DSwapChain9Impl
**
swapchain
)
{
IDirect3DSwapChain9Impl
*
object
;
HRESULT
hr
;
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
{
ERR
(
"Failed to allocate swapchain memory.
\n
"
);
return
E_OUTOFMEMORY
;
}
if
(
FAILED
(
hr
=
swapchain_init
(
object
,
device
,
present_parameters
)))
{
WARN
(
"Failed to initialize swapchain, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
hr
;
}
TRACE
(
"Created swapchain %p.
\n
"
,
object
);
*
swapchain
=
object
;
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