Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zsolt Vadász
wine
Commits
044a989d
Commit
044a989d
authored
15 years ago
by
Henri Verbeet
Committed by
Alexandre Julliard
15 years ago
Browse files
Options
Downloads
Patches
Plain Diff
dxgi: Add a separate function for swapchain initialization.
parent
d588d2b4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dlls/dxgi/device.c
+6
-8
6 additions, 8 deletions
dlls/dxgi/device.c
dlls/dxgi/dxgi_private.h
+3
-1
3 additions, 1 deletion
dlls/dxgi/dxgi_private.h
dlls/dxgi/swapchain.c
+20
-1
20 additions, 1 deletion
dlls/dxgi/swapchain.c
with
29 additions
and
10 deletions
dlls/dxgi/device.c
+
6
−
8
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, r
eturning
%#x
\n
"
,
hr
);
WARN
(
"Failed to
initialize
swapchain,
h
r %#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
;
}
...
...
This diff is collapsed.
Click to expand it.
dlls/dxgi/dxgi_private.h
+
3
−
1
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
{
...
...
This diff is collapsed.
Click to expand it.
dlls/dxgi/swapchain.c
+
20
−
1
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
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment