- int mode;
- int width = 640, height = 480, depth = 16;
- int refresh = MGL_DEFAULT_REFRESH;
-
-#if wxUSE_SYSTEM_OPTIONS
- // FIXME_MGL -- so what is The Proper Way?
- if ( wxSystemOptions::HasOption(wxT("mgl.screen-width") )
- width = wxSystemOptions::GetOptionInt(wxT("mgl.screen-width"));
- if ( wxSystemOptions::HasOption(wxT("mgl.screen-height") )
- height = wxSystemOptions::GetOptionInt(wxT("mgl.screen-height"));
- if ( wxSystemOptions::HasOption(wxT("mgl.screen-depth") )
- depth = wxSystemOptions::GetOptionInt(wxT("mgl.screen-depth"));
- if ( wxSystemOptions::HasOption(wxT("mgl.screen-refresh") )
- refresh = wxSystemOptions::GetOptionInt(wxT("mgl.screen-refresh"));
-#endif
-
- mode = MGL_findMode(width, height, depth);
- if ( mode == -1 )
- {
- wxLogWarning(_("Mode %ix%i-%i not available, falling back to default mode."), width, height, depth);
- mode = 0; // always available
- }
- g_displayDC = new MGLDisplayDC(mode, 1, refresh);
- if ( !g_displayDC->isValid() )
- {
- delete g_displayDC;
- g_displayDC = NULL;
- return FALSE;
- }
-
- g_winMng = MGL_wmCreate(g_displayDC->getDC());
- if (!g_winMng)
- return FALSE;
-
- MGL_wmSetWindowPainter(MGL_wmGetRootWindow(g_winMng), wxDesktopPainter);