diff --git a/Source/Plugins/Plugin_VideoOGL/Src/BPStructs.cpp b/Source/Plugins/Plugin_VideoOGL/Src/BPStructs.cpp index ffd8b339df..1bf7614974 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/BPStructs.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/BPStructs.cpp @@ -666,7 +666,7 @@ void BPWritten(int addr, int changes, int newval) case 0xA0: case 0xB0: - // Just update the bpmem struct, don't do anything else. + // Just update the bpmem struct, don't do anything else default: if (changes) { diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GLWindow.h b/Source/Plugins/Plugin_VideoOGL/Src/GLWindow.h index 89d6c70db2..e56e1bc265 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GLWindow.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/GLWindow.h @@ -72,10 +72,12 @@ public: virtual void Update() {}; virtual bool MakeCurrent() {return false;}; - virtual void updateDim() { + virtual void updateDim() + { if (GetProperty(OGL_FULLSCREEN)) SetWinSize(currFullRes.x, currFullRes.y); else + // Set the windowed resolution SetWinSize(currWinRes.x, currWinRes.y); float FactorX = 640.0f / (float)GetXwin(); @@ -118,8 +120,8 @@ public: static bool valid() { return false;} - GLWindow() { - + GLWindow() + { // Load defaults sscanf(g_Config.iFSResolution, "%dx%d", &currFullRes.x, &currFullRes.y); diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp b/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp index 9906e7787a..7126a128a6 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.cpp @@ -73,12 +73,56 @@ ConfigDialog::ConfigDialog(wxWindow *parent, wxWindowID id, const wxString &titl : wxDialog(parent, id, title, position, size, style) { g_Config.Load(); - CreateGUIControls(); } +/////////////////////////////////////////////////////////////////////////////////////////////// +// Close and unload the window +// --------------- ConfigDialog::~ConfigDialog() { } +void ConfigDialog::OnClose(wxCloseEvent& event) +{ + // notice that we don't run wxEntryCleanup(); here so the dll will still be loaded + g_Config.Save(); + //EndModal(0); + + // Allow wxWidgets to close and unload the window + event.Skip(); +} + +void ConfigDialog::CloseClick(wxCommandEvent& WXUNUSED (event)) +{ + Close(); +} +/////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////////////////////// +// Add avaliable redolutions and other settings +// --------------- +void ConfigDialog::AddFSReso(char *reso) +{ + arrayStringFor_FullscreenCB.Add(wxString::FromAscii(reso)); +} + +void ConfigDialog::AddWindowReso(char *reso) +{ + arrayStringFor_WindowResolutionCB.Add(wxString::FromAscii(reso)); +} + +void ConfigDialog::AddRenderBackend(const char *backend) +{ + m_RenderBackend->Append(wxString::FromAscii(backend)); +} + +void ConfigDialog::AddAAMode(int mode) +{ + wxString tmp; + tmp<Append(tmp); +} +/////////////////////////////////////// + void ConfigDialog::CreateGUIControls() { @@ -130,11 +174,11 @@ void ConfigDialog::CreateGUIControls() #endif wxStaticText *FSText = new wxStaticText(m_PageGeneral, ID_FSTEXT, wxT("Fullscreen video mode:"), wxDefaultPosition, wxDefaultSize, 0); - m_FullscreenCB = new wxComboBox(m_PageGeneral, ID_FULLSCREENCB, wxEmptyString, wxDefaultPosition, wxDefaultSize, arrayStringFor_FullscreenCB, 0, wxDefaultValidator); + m_FullscreenCB = new wxComboBox(m_PageGeneral, ID_FULLSCREENCB, arrayStringFor_FullscreenCB[0], wxDefaultPosition, wxDefaultSize, arrayStringFor_FullscreenCB, wxCB_READONLY, wxDefaultValidator); m_FullscreenCB->SetValue(wxString::FromAscii(g_Config.iFSResolution)); wxStaticText *WMText = new wxStaticText(m_PageGeneral, ID_WMTEXT, wxT("Windowed resolution:"), wxDefaultPosition, wxDefaultSize, 0); - m_WindowResolutionCB = new wxComboBox(m_PageGeneral, ID_WINDOWRESOLUTIONCB, wxEmptyString, wxDefaultPosition, wxDefaultSize, arrayStringFor_WindowResolutionCB, 0, wxDefaultValidator); + m_WindowResolutionCB = new wxComboBox(m_PageGeneral, ID_WINDOWRESOLUTIONCB, arrayStringFor_WindowResolutionCB[0], wxDefaultPosition, wxDefaultSize, arrayStringFor_WindowResolutionCB, wxCB_READONLY, wxDefaultValidator); m_WindowResolutionCB->SetValue(wxString::FromAscii(g_Config.iWindowedRes)); wxStaticText *BEText = new wxStaticText(m_PageGeneral, ID_BETEXT, wxT("Rendering backend:"), wxDefaultPosition, wxDefaultSize, 0); @@ -392,41 +436,6 @@ void ConfigDialog::CreateGUIControls() UpdateGUI(); } -void ConfigDialog::OnClose(wxCloseEvent& WXUNUSED (event)) -{ - /* notice that we don't run wxEntryCleanup(); here so the dll will - still be loaded */ - g_Config.Save(); - EndModal(0); -} - -void ConfigDialog::CloseClick(wxCommandEvent& WXUNUSED (event)) -{ - Close(); -} - -void ConfigDialog::AddFSReso(char *reso) -{ - m_FullscreenCB->Append(wxString::FromAscii(reso)); -} - -void ConfigDialog::AddWindowReso(char *reso) -{ - m_WindowResolutionCB->Append(wxString::FromAscii(reso)); -} - -void ConfigDialog::AddRenderBackend(const char *backend) -{ - m_RenderBackend->Append(wxString::FromAscii(backend)); -} - - -void ConfigDialog::AddAAMode(int mode) -{ - wxString tmp; - tmp<Append(tmp); -} void ConfigDialog::AboutClick(wxCommandEvent& WXUNUSED (event)) { diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.h b/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.h index 97590c46a1..2081510291 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/GUI/ConfigDlg.h @@ -47,6 +47,7 @@ class ConfigDialog : public wxDialog void AddWindowReso(char *reso); void AddRenderBackend(const char *backend); void AddAAMode(int mode); + void CreateGUIControls(); private: DECLARE_EVENT_TABLE(); @@ -172,7 +173,6 @@ class ConfigDialog : public wxDialog }; void OnClose(wxCloseEvent& event); - void CreateGUIControls(); void UpdateGUI(); void AboutClick(wxCommandEvent& event); diff --git a/Source/Plugins/Plugin_VideoOGL/Src/main.cpp b/Source/Plugins/Plugin_VideoOGL/Src/main.cpp index 7c1080dc24..313ff9af51 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/main.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/main.cpp @@ -134,6 +134,9 @@ void DllConfig(HWND _hParent) std::string resos[100]; int i = 0; + // --------------------------------------------------------------- + // Search for avaliable resolutions + // --------------------- while (EnumDisplaySettings(NULL, iModeNum++, &dmi) != 0) { char szBuffer[100]; @@ -158,7 +161,12 @@ void DllConfig(HWND _hParent) } ZeroMemory(&dmi, sizeof(dmi)); } - frame->ShowModal(); + // ---------------------------- + + // Create the controls and show the window + frame->CreateGUIControls(); + frame->Show(); + #elif defined(USE_WX) && USE_WX ConfigDialog frame(NULL);