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
7e7bd87b
Commit
7e7bd87b
authored
Aug 20, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
Aug 20, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Store the original display mode in the swapchain.
parent
d04d1c17
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
34 deletions
+14
-34
device.c
dlls/wined3d/device.c
+1
-5
swapchain.c
dlls/wined3d/swapchain.c
+12
-27
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-2
No files found.
dlls/wined3d/device.c
View file @
7e7bd87b
...
...
@@ -5012,11 +5012,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
}
else
if
(
swapchain_desc
->
windowed
)
{
m
.
width
=
swapchain
->
orig_width
;
m
.
height
=
swapchain
->
orig_height
;
m
.
refresh_rate
=
0
;
m
.
format_id
=
swapchain
->
desc
.
backbuffer_format
;
m
.
scanline_ordering
=
WINED3D_SCANLINE_ORDERING_UNKNOWN
;
m
=
swapchain
->
original_mode
;
}
else
{
...
...
dlls/wined3d/swapchain.c
View file @
7e7bd87b
...
...
@@ -30,7 +30,6 @@ WINE_DECLARE_DEBUG_CHANNEL(fps);
/* Do not call while under the GL lock. */
static
void
swapchain_cleanup
(
struct
wined3d_swapchain
*
swapchain
)
{
struct
wined3d_display_mode
mode
;
HRESULT
hr
;
UINT
i
;
...
...
@@ -76,13 +75,8 @@ static void swapchain_cleanup(struct wined3d_swapchain *swapchain)
* orig_height will be equal to the modes in the presentation params. */
if
(
!
swapchain
->
desc
.
windowed
&&
swapchain
->
desc
.
auto_restore_display_mode
)
{
mode
.
width
=
swapchain
->
orig_width
;
mode
.
height
=
swapchain
->
orig_height
;
mode
.
refresh_rate
=
0
;
mode
.
format_id
=
swapchain
->
orig_fmt
;
mode
.
scanline_ordering
=
WINED3D_SCANLINE_ORDERING_UNKNOWN
;
if
(
FAILED
(
hr
=
wined3d_set_adapter_display_mode
(
swapchain
->
device
->
wined3d
,
swapchain
->
device
->
adapter
->
ordinal
,
&
mode
)))
swapchain
->
device
->
adapter
->
ordinal
,
&
swapchain
->
original_
mode
)))
ERR
(
"Failed to restore display mode, hr %#x.
\n
"
,
hr
);
}
...
...
@@ -818,8 +812,6 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3
{
const
struct
wined3d_adapter
*
adapter
=
device
->
adapter
;
struct
wined3d_resource_desc
surface_desc
;
const
struct
wined3d_format
*
format
;
struct
wined3d_display_mode
mode
;
BOOL
displaymode_set
=
FALSE
;
RECT
client_rect
;
HWND
window
;
...
...
@@ -853,11 +845,12 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3
swapchain
->
win_handle
=
window
;
swapchain
->
device_window
=
window
;
wined3d_get_adapter_display_mode
(
device
->
wined3d
,
adapter
->
ordinal
,
&
mode
,
NULL
);
swapchain
->
orig_width
=
mode
.
width
;
swapchain
->
orig_height
=
mode
.
height
;
swapchain
->
orig_fmt
=
mode
.
format_id
;
format
=
wined3d_get_format
(
&
adapter
->
gl_info
,
mode
.
format_id
);
if
(
FAILED
(
hr
=
wined3d_get_adapter_display_mode
(
device
->
wined3d
,
adapter
->
ordinal
,
&
swapchain
->
original_mode
,
NULL
)))
{
ERR
(
"Failed to get current display mode, hr %#x.
\n
"
,
hr
);
goto
err
;
}
GetClientRect
(
window
,
&
client_rect
);
if
(
desc
->
windowed
...
...
@@ -879,8 +872,8 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3
if
(
desc
->
backbuffer_format
==
WINED3DFMT_UNKNOWN
)
{
desc
->
backbuffer_format
=
swapchain
->
orig
_fmt
;
TRACE
(
"Updating format to %s.
\n
"
,
debug_d3dformat
(
swapchain
->
orig
_fmt
));
desc
->
backbuffer_format
=
swapchain
->
orig
inal_mode
.
format_id
;
TRACE
(
"Updating format to %s.
\n
"
,
debug_d3dformat
(
swapchain
->
orig
inal_mode
.
format_id
));
}
}
swapchain
->
desc
=
*
desc
;
...
...
@@ -1040,18 +1033,10 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3
err:
if
(
displaymode_set
)
{
DEVMODEW
devmode
;
if
(
FAILED
(
wined3d_set_adapter_display_mode
(
device
->
wined3d
,
adapter
->
ordinal
,
&
swapchain
->
original_mode
)))
ERR
(
"Failed to restore display mode.
\n
"
);
ClipCursor
(
NULL
);
/* Change the display settings */
memset
(
&
devmode
,
0
,
sizeof
(
devmode
));
devmode
.
dmSize
=
sizeof
(
devmode
);
devmode
.
dmFields
=
DM_BITSPERPEL
|
DM_PELSWIDTH
|
DM_PELSHEIGHT
;
devmode
.
dmBitsPerPel
=
format
->
byte_count
*
CHAR_BIT
;
devmode
.
dmPelsWidth
=
swapchain
->
orig_width
;
devmode
.
dmPelsHeight
=
swapchain
->
orig_height
;
ChangeDisplaySettingsExW
(
adapter
->
DeviceName
,
&
devmode
,
NULL
,
CDS_FULLSCREEN
,
NULL
);
}
if
(
swapchain
->
back_buffers
)
...
...
dlls/wined3d/wined3d_private.h
View file @
7e7bd87b
...
...
@@ -2543,8 +2543,7 @@ struct wined3d_swapchain
struct
wined3d_surface
**
back_buffers
;
struct
wined3d_surface
*
front_buffer
;
struct
wined3d_swapchain_desc
desc
;
DWORD
orig_width
,
orig_height
;
enum
wined3d_format_id
orig_fmt
;
struct
wined3d_display_mode
original_mode
;
struct
wined3d_gamma_ramp
orig_gamma
;
BOOL
render_to_fbo
;
const
struct
wined3d_format
*
ds_format
;
...
...
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