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
044a989d
Commit
044a989d
authored
Dec 28, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Dec 29, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxgi: Add a separate function for swapchain initialization.
parent
d588d2b4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
10 deletions
+29
-10
device.c
dlls/dxgi/device.c
+6
-8
dxgi_private.h
dlls/dxgi/dxgi_private.h
+3
-1
swapchain.c
dlls/dxgi/swapchain.c
+20
-1
No files found.
dlls/dxgi/device.c
View file @
044a989d
...
...
@@ -291,10 +291,12 @@ static HRESULT STDMETHODCALLTYPE dxgi_device_create_surface(IWineDXGIDevice *ifa
static
HRESULT
STDMETHODCALLTYPE
dxgi_device_create_swapchain
(
IWineDXGIDevice
*
iface
,
WINED3DPRESENT_PARAMETERS
*
present_parameters
,
IWineD3DSwapChain
**
wined3d_swapchain
)
{
struct
dxgi_device
*
This
=
(
struct
dxgi_device
*
)
iface
;
struct
dxgi_swapchain
*
object
;
HRESULT
hr
;
TRACE
(
"iface %p, present_parameters %p, wined3d_swapchain %p.
\n
"
,
iface
,
present_parameters
,
wined3d_swapchain
);
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
if
(
!
object
)
{
...
...
@@ -302,20 +304,16 @@ static HRESULT STDMETHODCALLTYPE dxgi_device_create_swapchain(IWineDXGIDevice *i
return
E_OUTOFMEMORY
;
}
object
->
vtbl
=
&
dxgi_swapchain_vtbl
;
object
->
refcount
=
1
;
hr
=
IWineD3DDevice_CreateSwapChain
(
This
->
wined3d_device
,
present_parameters
,
&
object
->
wined3d_swapchain
,
(
IUnknown
*
)
object
,
SURFACE_OPENGL
);
hr
=
dxgi_swapchain_init
(
object
,
(
struct
dxgi_device
*
)
iface
,
present_parameters
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to
create a swapchain, returning %#x
\n
"
,
hr
);
WARN
(
"Failed to
initialize swapchain, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
hr
;
}
*
wined3d_swapchain
=
object
->
wined3d_swapchain
;
TRACE
(
"Created IDXGISwapChain %p
\n
"
,
object
);
*
wined3d_swapchain
=
object
->
wined3d_swapchain
;
return
S_OK
;
}
...
...
dlls/dxgi/dxgi_private.h
View file @
044a989d
...
...
@@ -121,7 +121,6 @@ struct dxgi_adapter
HRESULT
dxgi_adapter_init
(
struct
dxgi_adapter
*
adapter
,
IWineDXGIFactory
*
parent
,
UINT
ordinal
)
DECLSPEC_HIDDEN
;
/* IDXGISwapChain */
extern
const
struct
IDXGISwapChainVtbl
dxgi_swapchain_vtbl
DECLSPEC_HIDDEN
;
struct
dxgi_swapchain
{
const
struct
IDXGISwapChainVtbl
*
vtbl
;
...
...
@@ -129,6 +128,9 @@ struct dxgi_swapchain
IWineD3DSwapChain
*
wined3d_swapchain
;
};
HRESULT
dxgi_swapchain_init
(
struct
dxgi_swapchain
*
swapchain
,
struct
dxgi_device
*
device
,
WINED3DPRESENT_PARAMETERS
*
present_parameters
)
DECLSPEC_HIDDEN
;
/* IDXGISurface */
struct
dxgi_surface
{
...
...
dlls/dxgi/swapchain.c
View file @
044a989d
...
...
@@ -249,7 +249,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetLastPresentCount(IDXGISwapCha
return
E_NOTIMPL
;
}
const
struct
IDXGISwapChainVtbl
dxgi_swapchain_vtbl
=
static
const
struct
IDXGISwapChainVtbl
dxgi_swapchain_vtbl
=
{
/* IUnknown methods */
dxgi_swapchain_QueryInterface
,
...
...
@@ -274,3 +274,22 @@ const struct IDXGISwapChainVtbl dxgi_swapchain_vtbl =
dxgi_swapchain_GetFrameStatistics
,
dxgi_swapchain_GetLastPresentCount
,
};
HRESULT
dxgi_swapchain_init
(
struct
dxgi_swapchain
*
swapchain
,
struct
dxgi_device
*
device
,
WINED3DPRESENT_PARAMETERS
*
present_parameters
)
{
HRESULT
hr
;
swapchain
->
vtbl
=
&
dxgi_swapchain_vtbl
;
swapchain
->
refcount
=
1
;
hr
=
IWineD3DDevice_CreateSwapChain
(
device
->
wined3d_device
,
present_parameters
,
&
swapchain
->
wined3d_swapchain
,
(
IUnknown
*
)
swapchain
,
SURFACE_OPENGL
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to create wined3d swapchain, hr %#x.
\n
"
,
hr
);
return
hr
;
}
return
S_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