#include "wx/univ/theme.h"
#include "wx/univ/renderer.h"
#include "wx/univ/colschem.h"
+#include "wx/sysopt.h"
#include "wx/mgl/private.h"
//-----------------------------------------------------------------------------
int refresh = MGL_DEFAULT_REFRESH;
#if wxUSE_SYSTEM_OPTIONS
- if ( wxSystemOptions::HasOption(wxT("mgl.screen-refresh") )
+ if ( wxSystemOptions::HasOption(wxT("mgl.screen-refresh")) )
refresh = wxSystemOptions::GetOptionInt(wxT("mgl.screen-refresh"));
#endif
{
}
+wxDisplayModeInfo wxGetDefaultDisplayMode()
+{
+ wxString mode;
+ unsigned w, h, bpp;
+
+ if ( !wxGetEnv(wxT("WXMODE"), &mode) ||
+ (wxSscanf(mode.c_str(), _T("%ux%u-%u"), &w, &h, &bpp) != 3) )
+ {
+ w = 640, h = 480, bpp = 16;
+ }
+
+ return wxDisplayModeInfo(w, h, bpp);
+}
+
bool wxApp::SetDisplayMode(const wxDisplayModeInfo& mode)
{
if ( !mode.IsOk() )
wxClassInfo::InitializeClasses();
- wxSystemSettings::Init();
-
#if wxUSE_INTL
wxFont::SetDefaultEncoding(wxLocale::GetSystemEncoding());
#endif
wxDeleteStockObjects();
wxDeleteStockLists();
- // Can't do this in wxModule, because fonts are needed by stock lists
- delete wxTheFontsManager;
- wxTheFontsManager = (wxFontsManager*) NULL;
-
delete wxTheApp;
wxTheApp = (wxApp*) NULL;
+
// GL: I'm annoyed ... I don't know where to put this and I don't want to
// create a module for that as it's part of the core.
#if wxUSE_THREADS
delete wxPendingEventsLocker;
#endif
- wxSystemSettings::Done();
+ wxClassInfo::CleanUpClasses();
- delete[] wxBuffer;
+ // Can't do this in wxModule, because fonts are needed by stock lists
+ // (do it after deleting wxTheApp and cleaning modules up, since somebody
+ // may be deleting fonts that lately)
+ delete wxTheFontsManager;
+ wxTheFontsManager = (wxFontsManager*) NULL;
- wxClassInfo::CleanUpClasses();
+ delete[] wxBuffer;
// check for memory leaks
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT