Commit fdb4d2b6 authored by twinaphex's avatar twinaphex
Browse files

Add get_resolution_list for Win32

parent 5d8666e2
......@@ -48,9 +48,10 @@ const video_display_server_t dispserv_null = {
null_display_server_destroy,
null_display_server_set_window_opacity,
null_display_server_set_window_progress,
NULL,
NULL,
NULL,
NULL, /* set_window_decorations */
NULL, /* set_resolution */
NULL, /* get_resolution_list */
NULL, /* get_output_options */
"null"
};
......@@ -282,6 +282,39 @@ static bool win32_display_server_set_resolution(void *data,
return true;
}
unsigned win32_display_server_get_resolution_list(struct video_display_config **conf)
{
unsigned i;
unsigned len = 0;
for (i = 0;; i++)
{
void *optr = NULL;
DEVMODE dm;
if (!win32_get_video_output(&dm, i, sizeof(dm)))
continue;
len++;
if (*conf)
optr = realloc(*conf, len);
else
optr = malloc(len);
if (optr)
*conf = optr;
conf[i]->width = dm.dmPelsWidth;
conf[i]->height = dm.dmPelsHeight;
conf[i]->bpp = dm.dmBitsPerPel;
conf[i]->refreshrate = dm.dmDisplayFrequency;
conf[i]->idx = i;
}
return len;
}
const video_display_server_t dispserv_win32 = {
win32_display_server_init,
win32_display_server_destroy,
......@@ -289,6 +322,7 @@ const video_display_server_t dispserv_win32 = {
win32_display_server_set_window_progress,
win32_display_server_set_window_decorations,
win32_display_server_set_resolution,
win32_display_server_get_resolution_list,
NULL, /* get_output_options */
"win32"
};
......@@ -306,9 +306,10 @@ const video_display_server_t dispserv_x11 = {
x11_display_server_init,
x11_display_server_destroy,
x11_display_server_set_window_opacity,
NULL,
NULL, /* set_window_progress */
x11_display_server_set_window_decorations,
x11_display_server_set_resolution,
NULL, /* get_resolution_list */
x11_display_server_get_output_options,
"x11"
};
......@@ -23,6 +23,16 @@
RETRO_BEGIN_DECLS
typedef struct video_display_config
{
unsigned width;
unsigned height;
unsigned bpp;
unsigned refreshrate;
unsigned idx;
bool current;
} video_display_config_t;
typedef struct video_display_server
{
void *(*init)(void);
......@@ -32,6 +42,7 @@ typedef struct video_display_server
bool (*set_window_decorations)(void *data, bool on);
bool (*switch_resolution)(void *data, unsigned width,
unsigned height, int int_hz, float hz, int center);
unsigned (*get_resolution_list)(struct video_display_config **conf);
const char *(*get_output_options)(void *data);
const char *ident;
} video_display_server_t;
......
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