diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 5b20c47eb..5b0386fb4 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -5488,10 +5488,32 @@ bool FurnaceGUI::init() { } #endif + int numDrivers=SDL_GetNumRenderDrivers(); + if (numDrivers<0) { + logW("could not list render drivers! %s",SDL_GetError()); + } else { + SDL_RendererInfo ri; + for (int i=0; isetConf("renderDriver",""); + e->saveConf(); + lastError=fmt::sprintf("\r\nthe render driver has been set to a safe value. please restart Furnace."); + } return false; } diff --git a/src/gui/gui.h b/src/gui/gui.h index ba8dc933f..381b3b427 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -1105,7 +1105,7 @@ class FurnaceGUI { std::vector newSongSearchResults; std::deque recentFile; std::vector makeInsTypeList; - + std::vector availRenderDrivers; bool quit, warnQuit, willCommit, edit, modified, displayError, displayExporting, vgmExportLoop, zsmExportLoop, vgmExportPatternHints; bool vgmExportDirectStream, displayInsTypeList; @@ -1307,6 +1307,7 @@ class FurnaceGUI { String midiInDevice; String midiOutDevice; String c163Name; + String renderDriver; String initialSysName; String noteOffLabel; String noteRelLabel; @@ -1443,6 +1444,7 @@ class FurnaceGUI { midiInDevice(""), midiOutDevice(""), c163Name(""), + renderDriver(""), initialSysName("Sega Genesis/Mega Drive"), noteOffLabel("OFF"), noteRelLabel("==="), diff --git a/src/gui/settings.cpp b/src/gui/settings.cpp index 50a36a9e8..70a435fc5 100644 --- a/src/gui/settings.cpp +++ b/src/gui/settings.cpp @@ -1207,6 +1207,18 @@ void FurnaceGUI::drawSettings() { ImVec2 settingsViewSize=ImGui::GetContentRegionAvail(); settingsViewSize.y-=ImGui::GetFrameHeight()+ImGui::GetStyle().WindowPadding.y; if (ImGui::BeginChild("SettingsView",settingsViewSize)) { + if (ImGui::BeginCombo("Render driver",settings.renderDriver.empty()?"Automatic":settings.renderDriver.c_str())) { + if (ImGui::Selectable("Automatic",settings.renderDriver.empty())) { + settings.renderDriver=""; + } + for (String& i: availRenderDrivers) { + if (ImGui::Selectable(i.c_str(),i==settings.renderDriver)) { + settings.renderDriver=i; + } + } + ImGui::EndCombo(); + } + bool dpiScaleAuto=(settings.dpiScale<0.5f); if (ImGui::Checkbox("Automatic UI scaling factor",&dpiScaleAuto)) { if (dpiScaleAuto) { @@ -2447,6 +2459,7 @@ void FurnaceGUI::syncSettings() { settings.midiInDevice=e->getConfString("midiInDevice",""); settings.midiOutDevice=e->getConfString("midiOutDevice",""); settings.c163Name=e->getConfString("c163Name",DIV_C163_DEFAULT_NAME); + settings.renderDriver=e->getConfString("renderDriver",""); settings.audioQuality=e->getConfInt("audioQuality",0); settings.audioBufSize=e->getConfInt("audioBufSize",1024); settings.audioRate=e->getConfInt("audioRate",44100); @@ -2762,6 +2775,7 @@ void FurnaceGUI::commitSettings() { e->setConf("midiInDevice",settings.midiInDevice); e->setConf("midiOutDevice",settings.midiOutDevice); e->setConf("c163Name",settings.c163Name); + e->setConf("renderDriver",settings.renderDriver); e->setConf("audioQuality",settings.audioQuality); e->setConf("audioBufSize",settings.audioBufSize); e->setConf("audioRate",settings.audioRate);