-#ifdef WIN32
- (void)disp_name;
-
- for(unsigned i=0;; ++i)
- {
- DEVMODE info;
- if(!EnumDisplaySettings(0, i, &info))
- break;
-
- VideoMode mode(info.dmPelsWidth, info.dmPelsHeight);
- mode.rate = info.dmDisplayFrequency;
- modes.push_back(mode);
- }
-
- DEVMODE info;
- if(EnumDisplaySettings(0, ENUM_CURRENT_SETTINGS, &info))
- {
- orig_mode = VideoMode(info.dmPelsWidth, info.dmPelsHeight);
- orig_mode.rate = info.dmDisplayFrequency;
- }
-#else
- if(disp_name.empty())
- priv->display = XOpenDisplay(0);
- else
- priv->display = XOpenDisplay(disp_name.c_str());
- if(!priv->display)
- throw runtime_error("XOpenDisplay");
-
- XSetErrorHandler(x_error_handler);
-
-#ifdef WITH_XF86VIDMODE
- int screen = DefaultScreen(priv->display);
-
- int nmodes;
- XF86VidModeModeInfo **infos;
- XF86VidModeGetAllModeLines(priv->display, screen, &nmodes, &infos);
- for(int i=0; i<nmodes; ++i)
- {
- XF86VidModeModeInfo &info = *infos[i];
-
- VideoMode mode(info.hdisplay, info.vdisplay);
- if(info.htotal && info.vtotal)
- mode.rate = info.dotclock/(info.htotal*info.vtotal);
- modes.push_back(mode);
- }
-
- XFree(infos);
-
- XF86VidModeModeLine modeline;
- int dotclock;
- XF86VidModeGetModeLine(priv->display, screen, &dotclock, &modeline);
- orig_mode = VideoMode(modeline.hdisplay, modeline.vdisplay);
- if(modeline.htotal && modeline.vtotal)
- orig_mode.rate = dotclock/(modeline.htotal*modeline.vtotal);
-#endif
-#endif