Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Switch
RetroArch
RetroArch
Commits
0eb8acd7
Commit
0eb8acd7
authored
Nov 24, 2018
by
twinaphex
Browse files
(Win32 display server) Try to set current resolution
parent
7d9e5646
Changes
1
Hide whitespace changes
Inline
Side-by-side
gfx/display_servers/dispserv_win32.c
View file @
0eb8acd7
...
...
@@ -285,19 +285,30 @@ static bool win32_display_server_set_resolution(void *data,
void
*
win32_display_server_get_resolution_list
(
void
*
data
,
unsigned
*
len
)
{
unsigned
i
,
count
=
0
;
DEVMODE
dm
;
unsigned
i
,
count
=
0
;
unsigned
curr_width
=
0
;
unsigned
curr_height
=
0
;
unsigned
curr_bpp
=
0
;
unsigned
curr_refreshrate
=
0
;
struct
video_display_config
*
conf
=
NULL
;
for
(
i
=
0
;;
i
++
)
{
DEVMODE
dm
;
if
(
!
win32_get_video_output
(
&
dm
,
i
,
sizeof
(
dm
)))
break
;
count
++
;
}
if
(
win32_get_video_output
(
&
dm
,
-
1
,
sizeof
(
dm
)))
{
curr_width
=
dm
.
dmPelsWidth
;
curr_height
=
dm
.
dmPelsHeight
;
curr_bpp
=
dm
.
dmBitsPerPel
;
curr_refreshrate
=
dm
.
dmDisplayFrequency
;
}
*
len
=
count
;
conf
=
(
struct
video_display_config
*
)
calloc
(
*
len
,
sizeof
(
struct
video_display_config
));
...
...
@@ -306,8 +317,6 @@ void *win32_display_server_get_resolution_list(void *data,
for
(
i
=
0
;;
i
++
)
{
DEVMODE
dm
;
if
(
!
win32_get_video_output
(
&
dm
,
i
,
sizeof
(
dm
)))
break
;
...
...
@@ -316,6 +325,14 @@ void *win32_display_server_get_resolution_list(void *data,
conf
[
i
].
bpp
=
dm
.
dmBitsPerPel
;
conf
[
i
].
refreshrate
=
dm
.
dmDisplayFrequency
;
conf
[
i
].
idx
=
i
;
conf
[
i
].
current
=
false
;
if
(
(
conf
[
i
].
width
==
curr_width
)
&&
(
conf
[
i
].
height
==
curr_height
)
&&
(
conf
[
i
].
refreshrate
==
curr_refreshrate
)
&&
(
conf
[
i
].
bpp
==
curr_bpp
)
)
conf
[
i
].
current
=
true
;
}
return
conf
;
...
...
Write
Preview
Supports
Markdown
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