mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
(Win32 display server) Try to set current resolution
This commit is contained in:
parent
7d9e564667
commit
0eb8acd766
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user