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
9e0d03e6
Commit
9e0d03e6
authored
Jul 02, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Jul 02, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8: Pass a wined3d_swapchain_desc structure to swapchain_init().
parent
2457d343
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
35 deletions
+36
-35
d3d8_private.h
dlls/d3d8/d3d8_private.h
+1
-1
device.c
dlls/d3d8/device.c
+33
-1
swapchain.c
dlls/d3d8/swapchain.c
+2
-33
No files found.
dlls/d3d8/d3d8_private.h
View file @
9e0d03e6
...
...
@@ -187,7 +187,7 @@ struct d3d8_swapchain
};
HRESULT
swapchain_init
(
struct
d3d8_swapchain
*
swapchain
,
struct
d3d8_device
*
device
,
D3DPRESENT_PARAMETERS
*
present_parameters
)
DECLSPEC_HIDDEN
;
struct
wined3d_swapchain_desc
*
desc
)
DECLSPEC_HIDDEN
;
struct
d3d8_surface
{
...
...
dlls/d3d8/device.c
View file @
9e0d03e6
...
...
@@ -504,6 +504,7 @@ static HRESULT WINAPI d3d8_device_CreateAdditionalSwapChain(IDirect3DDevice8 *if
D3DPRESENT_PARAMETERS
*
present_parameters
,
IDirect3DSwapChain8
**
swapchain
)
{
struct
d3d8_device
*
device
=
impl_from_IDirect3DDevice8
(
iface
);
struct
wined3d_swapchain_desc
desc
;
struct
d3d8_swapchain
*
object
;
HRESULT
hr
;
...
...
@@ -517,7 +518,38 @@ static HRESULT WINAPI d3d8_device_CreateAdditionalSwapChain(IDirect3DDevice8 *if
return
E_OUTOFMEMORY
;
}
hr
=
swapchain_init
(
object
,
device
,
present_parameters
);
desc
.
backbuffer_width
=
present_parameters
->
BackBufferWidth
;
desc
.
backbuffer_height
=
present_parameters
->
BackBufferHeight
;
desc
.
backbuffer_format
=
wined3dformat_from_d3dformat
(
present_parameters
->
BackBufferFormat
);
desc
.
backbuffer_count
=
max
(
1
,
present_parameters
->
BackBufferCount
);
desc
.
multisample_type
=
present_parameters
->
MultiSampleType
;
desc
.
multisample_quality
=
0
;
/* d3d9 only */
desc
.
swap_effect
=
present_parameters
->
SwapEffect
;
desc
.
device_window
=
present_parameters
->
hDeviceWindow
;
desc
.
windowed
=
present_parameters
->
Windowed
;
desc
.
enable_auto_depth_stencil
=
present_parameters
->
EnableAutoDepthStencil
;
desc
.
auto_depth_stencil_format
=
wined3dformat_from_d3dformat
(
present_parameters
->
AutoDepthStencilFormat
);
desc
.
flags
=
present_parameters
->
Flags
;
desc
.
refresh_rate
=
present_parameters
->
FullScreen_RefreshRateInHz
;
desc
.
swap_interval
=
present_parameters
->
FullScreen_PresentationInterval
;
desc
.
auto_restore_display_mode
=
TRUE
;
hr
=
swapchain_init
(
object
,
device
,
&
desc
);
present_parameters
->
BackBufferWidth
=
desc
.
backbuffer_width
;
present_parameters
->
BackBufferHeight
=
desc
.
backbuffer_height
;
present_parameters
->
BackBufferFormat
=
d3dformat_from_wined3dformat
(
desc
.
backbuffer_format
);
present_parameters
->
BackBufferCount
=
desc
.
backbuffer_count
;
present_parameters
->
MultiSampleType
=
desc
.
multisample_type
;
present_parameters
->
SwapEffect
=
desc
.
swap_effect
;
present_parameters
->
hDeviceWindow
=
desc
.
device_window
;
present_parameters
->
Windowed
=
desc
.
windowed
;
present_parameters
->
EnableAutoDepthStencil
=
desc
.
enable_auto_depth_stencil
;
present_parameters
->
AutoDepthStencilFormat
=
d3dformat_from_wined3dformat
(
desc
.
auto_depth_stencil_format
);
present_parameters
->
Flags
=
desc
.
flags
;
present_parameters
->
FullScreen_RefreshRateInHz
=
desc
.
refresh_rate
;
present_parameters
->
FullScreen_PresentationInterval
=
desc
.
swap_interval
;
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to initialize swapchain, hr %#x.
\n
"
,
hr
);
...
...
dlls/d3d8/swapchain.c
View file @
9e0d03e6
...
...
@@ -150,50 +150,19 @@ static const struct wined3d_parent_ops d3d8_swapchain_wined3d_parent_ops =
};
HRESULT
swapchain_init
(
struct
d3d8_swapchain
*
swapchain
,
struct
d3d8_device
*
device
,
D3DPRESENT_PARAMETERS
*
present_parameters
)
struct
wined3d_swapchain_desc
*
desc
)
{
struct
wined3d_swapchain_desc
desc
;
HRESULT
hr
;
swapchain
->
refcount
=
1
;
swapchain
->
IDirect3DSwapChain8_iface
.
lpVtbl
=
&
d3d8_swapchain_vtbl
;
desc
.
backbuffer_width
=
present_parameters
->
BackBufferWidth
;
desc
.
backbuffer_height
=
present_parameters
->
BackBufferHeight
;
desc
.
backbuffer_format
=
wined3dformat_from_d3dformat
(
present_parameters
->
BackBufferFormat
);
desc
.
backbuffer_count
=
max
(
1
,
present_parameters
->
BackBufferCount
);
desc
.
multisample_type
=
present_parameters
->
MultiSampleType
;
desc
.
multisample_quality
=
0
;
/* d3d9 only */
desc
.
swap_effect
=
present_parameters
->
SwapEffect
;
desc
.
device_window
=
present_parameters
->
hDeviceWindow
;
desc
.
windowed
=
present_parameters
->
Windowed
;
desc
.
enable_auto_depth_stencil
=
present_parameters
->
EnableAutoDepthStencil
;
desc
.
auto_depth_stencil_format
=
wined3dformat_from_d3dformat
(
present_parameters
->
AutoDepthStencilFormat
);
desc
.
flags
=
present_parameters
->
Flags
;
desc
.
refresh_rate
=
present_parameters
->
FullScreen_RefreshRateInHz
;
desc
.
swap_interval
=
present_parameters
->
FullScreen_PresentationInterval
;
desc
.
auto_restore_display_mode
=
TRUE
;
wined3d_mutex_lock
();
hr
=
wined3d_swapchain_create
(
device
->
wined3d_device
,
&
desc
,
hr
=
wined3d_swapchain_create
(
device
->
wined3d_device
,
desc
,
WINED3D_SURFACE_TYPE_OPENGL
,
swapchain
,
&
d3d8_swapchain_wined3d_parent_ops
,
&
swapchain
->
wined3d_swapchain
);
wined3d_mutex_unlock
();
present_parameters
->
BackBufferWidth
=
desc
.
backbuffer_width
;
present_parameters
->
BackBufferHeight
=
desc
.
backbuffer_height
;
present_parameters
->
BackBufferFormat
=
d3dformat_from_wined3dformat
(
desc
.
backbuffer_format
);
present_parameters
->
BackBufferCount
=
desc
.
backbuffer_count
;
present_parameters
->
MultiSampleType
=
desc
.
multisample_type
;
present_parameters
->
SwapEffect
=
desc
.
swap_effect
;
present_parameters
->
hDeviceWindow
=
desc
.
device_window
;
present_parameters
->
Windowed
=
desc
.
windowed
;
present_parameters
->
EnableAutoDepthStencil
=
desc
.
enable_auto_depth_stencil
;
present_parameters
->
AutoDepthStencilFormat
=
d3dformat_from_wined3dformat
(
desc
.
auto_depth_stencil_format
);
present_parameters
->
Flags
=
desc
.
flags
;
present_parameters
->
FullScreen_RefreshRateInHz
=
desc
.
refresh_rate
;
present_parameters
->
FullScreen_PresentationInterval
=
desc
.
swap_interval
;
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to create wined3d swapchain, hr %#x.
\n
"
,
hr
);
...
...
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