primary_monitor(0),
priv(new Private)
{
+ static ErrorDialog err_dlg(0);
+
for(unsigned i=0;; ++i)
{
DISPLAY_DEVICE adapter_dev;
monitors.push_back(Monitor());
Monitor &monitor = monitors.back();
monitor.index = monitors.size()-1;
+ monitor.name = adapter_dev.DeviceString;
priv->monitors.push_back(adapter_dev.DeviceName);
if(adapter_dev.StateFlags&DISPLAY_DEVICE_PRIMARY_DEVICE)
mode.index = modes.size();
mode.monitor = &monitor;
mode.rate = info.dmDisplayFrequency;
- if(find_matching_mode(mode))
+ if(find_mode(mode))
continue;
modes.push_back(mode);
void Display::set_mode(const VideoMode &requested_mode, bool)
{
- const VideoMode *mode = find_matching_mode(requested_mode);
+ const VideoMode *mode = find_mode(requested_mode);
if(!mode)
throw unsupported_video_mode(requested_mode);
DEVMODE info;
+ info.dmDeviceName[0] = 0;
+ info.dmSpecVersion = DM_SPECVERSION;
+ info.dmDriverVersion = 0;
info.dmSize = sizeof(DEVMODE);
+ info.dmDriverExtra = 0;
info.dmFields = DM_PELSWIDTH|DM_PELSHEIGHT;
info.dmPelsWidth = mode->width;
info.dmPelsHeight = mode->height;
MSG msg;
if(PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
{
+ TranslateMessage(&msg);
DispatchMessage(&msg);
return true;
}