OpenGL GUI: Disabled render to separate window options when we are not using that option

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2312 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson 2009-02-19 11:28:55 +00:00
parent bdd02fb1b6
commit a1cd6c982e
3 changed files with 35 additions and 8 deletions

View File

@ -159,11 +159,6 @@ void ConfigDialog::CreateGUIControls()
m_RenderToMainWindow = new wxCheckBox(m_PageGeneral, ID_RENDERTOMAINWINDOW, wxT("Render to main window"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_RenderToMainWindow->SetValue(g_Config.renderToMainframe);
m_StretchToFit = new wxCheckBox(m_PageGeneral, ID_STRETCHTOFIT, wxT("Stretch to fit"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_StretchToFit->SetToolTip
(wxT("This will use the game's native resolution and stretch it to fill the"
"\nwindow instead of changing the internal display resolution. It"
"\nmay result in a slightly blurrier image, but it may also give a higher"
"\nFPS if you have a slow graphics card."));
m_StretchToFit->SetValue(g_Config.bStretchToFit);
m_KeepAR = new wxCheckBox(m_PageGeneral, ID_KEEPAR, wxT("Keep 4:3 aspect ratio"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_KeepAR->SetValue(g_Config.bKeepAR);
@ -185,6 +180,23 @@ void ConfigDialog::CreateGUIControls()
m_RenderBackend = new wxComboBox(m_PageGeneral, ID_RENDERBACKEND, wxEmptyString, wxDefaultPosition, wxDefaultSize, arrayStringFor_RenderBackend, 0, wxDefaultValidator);
m_RenderBackend->SetValue(wxString::FromAscii(g_Config.iBackend));
// Tool tips
m_Fullscreen->SetToolTip(wxT(
"This option use a separate rendering window and can only be used when"
" 'Render to main window' is unchecked. The only way to exit this mode\n"
" is with Alt + F4 (that also close Dolphin)."
));
m_StretchToFit->SetToolTip(wxT(
"This will use the game's native resolution and stretch it to fill the"
"\nwindow instead of changing the internal display resolution. It"
"\nmay result in a slightly blurrier image, but it may also give a higher"
"\nFPS if you have a slow graphics card."));
m_FullscreenCB->SetToolTip(wxT(
"Select resolution for the (separate window) fullscreen mode."));
// This almost sounds like an unnecessary option
m_WindowResolutionCB->SetToolTip(wxT(
"Select initial resolution for the separate rendering window."));
// Enhancements
sbEnhancements = new wxStaticBoxSizer(wxVERTICAL, m_PageGeneral, wxT("Enhancements"));
@ -603,6 +615,11 @@ void ConfigDialog::TexturePathChange(wxFileDirPickerEvent& event)
void ConfigDialog::UpdateGUI()
{
// These options are for the separate rendering window
m_Fullscreen->Enable(!g_Config.renderToMainframe);
m_FullscreenCB->Enable(!g_Config.renderToMainframe);
m_WindowResolutionCB->Enable(!g_Config.renderToMainframe);
// Update screen size labels
m_TextScreenWidth->SetLabel(wxString::Format("Width: %i", g_Config.iScreenWidth));
m_TextScreenHeight->SetLabel(wxString::Format("Height: %i", g_Config.iScreenHeight));

View File

@ -49,6 +49,9 @@ class ConfigDialog : public wxDialog
void AddAAMode(int mode);
void CreateGUIControls();
// Combo box lists, this one needs to be public
wxArrayString arrayStringFor_FullscreenCB;
private:
DECLARE_EVENT_TABLE();
@ -79,7 +82,6 @@ class ConfigDialog : public wxDialog
#ifndef _WIN32
wxCheckBox *m_HideCursor;
#endif
wxArrayString arrayStringFor_FullscreenCB;
wxComboBox *m_FullscreenCB;
wxArrayString arrayStringFor_WindowResolutionCB;
wxComboBox *m_WindowResolutionCB;

View File

@ -142,7 +142,7 @@ void DllConfig(HWND _hParent)
char szBuffer[100];
sprintf(szBuffer,"%dx%d", dmi.dmPelsWidth, dmi.dmPelsHeight);
std::string strBuffer(szBuffer);
// Create a check loop to check every pointer of resos to see if the res is added or not
// Create a check loop to check every pointer of resolutions to see if the res is added or not
int b = 0;
bool resFound = false;
while (b < i && !resFound)
@ -151,8 +151,8 @@ void DllConfig(HWND _hParent)
resFound = (resos[b] == strBuffer);
b++;
}
// Add the resolution
if (!resFound)
// Add the res
{
resos[i] = strBuffer;
i++;
@ -161,6 +161,14 @@ void DllConfig(HWND _hParent)
}
ZeroMemory(&dmi, sizeof(dmi));
}
// Check if at least one resolution was found. If we don't and the resolution array is empty
// CreateGUIControls() will crash because the array is empty.
if (frame->arrayStringFor_FullscreenCB.size() == 0)
{
frame->AddFSReso("<No resolutions found>");
frame->AddWindowReso("<No resolutions found>");
}
// ----------------------------
// Create the controls and show the window