Commit 0eb8acd7 authored by twinaphex's avatar twinaphex
Browse files

(Win32 display server) Try to set current resolution

parent 7d9e5646
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment