diff --git a/obs/obs-app.cpp b/obs/obs-app.cpp index ca2288c0e4aae7e37d679506ef326f5d516bc640..7d419805bd1a6ba70308316aabfa459f1cb2d602 100644 --- a/obs/obs-app.cpp +++ b/obs/obs-app.cpp @@ -69,6 +69,14 @@ bool OBSApp::InitGlobalConfigDefaults() uint32_t cx = monitors[0].cx; uint32_t cy = monitors[0].cy; +#if _WIN32 + config_set_default_string(globalConfig, "Video", "Renderer", + "Direct3D 11"); +#else + config_set_default_string(globalConfig, "Video", "Renderer", + "OpenGL"); +#endif + config_set_default_uint(globalConfig, "Video", "BaseCX", cx); config_set_default_uint(globalConfig, "Video", "BaseCY", cy); diff --git a/obs/platform-windows.cpp b/obs/platform-windows.cpp index e5af5ae42e88aa2f10884c851960ab53c7118325..9e1dfc122bb319dcb70ee296a603632339f1f47a 100644 --- a/obs/platform-windows.cpp +++ b/obs/platform-windows.cpp @@ -36,12 +36,11 @@ static BOOL CALLBACK OBSMonitorEnumProc(HMONITOR hMonitor, HDC hdcMonitor, { vector &monitors = *(vector *)param; - MonitorInfo monitor; - monitor.x = rect->left; - monitor.y = rect->top; - monitor.cx = rect->right - rect->left; - monitor.cy = rect->bottom - rect->top; - monitors.push_back(monitor); + monitors.emplace_back( + rect->left, + rect->top, + rect->right - rect->left, + rect->bottom - rect->top); return true; } diff --git a/obs/settings-basic-video.cpp b/obs/settings-basic-video.cpp index 36ce69f35c1425c70d2457f006f584728fc31356..d59af46e913fc840ee661c0a129e0c2f75303eaa 100644 --- a/obs/settings-basic-video.cpp +++ b/obs/settings-basic-video.cpp @@ -30,6 +30,7 @@ class BasicVideoData : public BasicSettingsData { ConnectorList connections; int AddRes(uint32_t cx, uint32_t cy); + void LoadOther(); void LoadResolutionData(); void LoadFPSData(); void LoadFPSCommon(); @@ -41,6 +42,7 @@ class BasicVideoData : public BasicSettingsData { void BaseResListChanged(wxCommandEvent &event); void OutputResListChanged(wxCommandEvent &event); + void SaveOther(); void SaveFPSData(); void SaveFPSCommon(); void SaveFPSInteger(); @@ -107,6 +109,24 @@ int BasicVideoData::AddRes(uint32_t cx, uint32_t cy) return window->baseResList->Append(res.str().c_str()); } +void BasicVideoData::LoadOther() +{ + const char *renderer = config_get_string(GetGlobalConfig(), "Video", + "Renderer"); + + window->rendererList->Clear(); + window->rendererList->Append("OpenGL"); +#ifdef _WIN32 + window->rendererList->Append("Direct3D 11"); +#endif + + int sel = window->rendererList->FindString(renderer); + if (sel == wxNOT_FOUND) + sel = 0; + + window->rendererList->SetSelection(sel); +} + void BasicVideoData::LoadResolutionData() { window->baseResList->Clear(); @@ -243,6 +263,7 @@ BasicVideoData::BasicVideoData(OBSBasicSettings *window) { LoadResolutionData(); LoadFPSData(); + LoadOther(); /* load connectors after loading data to prevent them from triggering */ connections.Add(window->baseResList, wxEVT_TEXT, @@ -289,6 +310,17 @@ void BasicVideoData::OutputResListChanged(wxCommandEvent &event) window->videoChangedText->Show(); } +void BasicVideoData::SaveOther() +{ + int sel = window->rendererList->GetSelection(); + if (sel == wxNOT_FOUND) + return; + + wxString renderer = window->rendererList->GetString(sel); + config_set_string(GetGlobalConfig(), "Video", "Renderer", + renderer.c_str()); +} + void BasicVideoData::SaveFPSData() { int id = window->fpsTypeList->GetCurrentPage()->GetId(); @@ -302,6 +334,7 @@ void BasicVideoData::SaveFPSData() } config_set_string(GetGlobalConfig(), "Video", "FPSType", type); + SaveOther(); SaveFPSCommon(); SaveFPSInteger(); SaveFPSFraction();