mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-11 21:46:23 +02:00
merged with upstream / amended SDL2 multi monitor support
This commit is contained in:
1 parent
fadedee75f
commit
ce5edeb589
115 files changed
+14495
-2425
No files matched your search
+31
-3
@@ -3,11 +3,13 @@
|
||||
#include "base/timeutil.h"
|
||||
#include "base/NativeApp.h"
|
||||
#include "base/mutex.h"
|
||||
#include "i18n/i18n.h"
|
||||
#include "util/text/utf8.h"
|
||||
#include "Common/Log.h"
|
||||
#include "Common/StringUtils.h"
|
||||
#include "../Globals.h"
|
||||
#include "Windows/EmuThread.h"
|
||||
#include "Windows/W32Util/Misc.h"
|
||||
#include "Windows/WndMainWindow.h"
|
||||
#include "Windows/resource.h"
|
||||
#include "Core/Reporting.h"
|
||||
@@ -126,12 +128,38 @@ unsigned int WINAPI TheThread(void *)
|
||||
|
||||
std::string error_string;
|
||||
if (!host->InitGraphics(&error_string)) {
|
||||
I18NCategory *err = GetI18NCategory("Error");
|
||||
Reporting::ReportMessage("Graphics init error: %s", error_string.c_str());
|
||||
std::string full_error = StringFromFormat( "Failed initializing OpenGL. Try upgrading your graphics drivers.\n\nError message:\n\n%s", error_string.c_str());
|
||||
MessageBox(0, ConvertUTF8ToWString(full_error).c_str(), L"OpenGL Error", MB_OK | MB_ICONERROR);
|
||||
|
||||
const char *defaultErrorOpenGL = "Failed initializing graphics. Try upgrading your graphics drivers.\n\nWould you like to try switching to DirectX 9?\n\nError message:";
|
||||
const char *defaultErrorDirect3D9 = "Failed initializing graphics. Try upgrading your graphics drivers and directx 9 runtime.\n\nWould you like to try switching to OpenGL?\n\nError message:";
|
||||
const char *genericError;
|
||||
int nextBackend = GPU_BACKEND_DIRECT3D9;
|
||||
switch (g_Config.iGPUBackend) {
|
||||
case GPU_BACKEND_DIRECT3D9:
|
||||
nextBackend = GPU_BACKEND_OPENGL;
|
||||
genericError = err->T("GenericDirect3D9Error", defaultErrorDirect3D9);
|
||||
break;
|
||||
case GPU_BACKEND_OPENGL:
|
||||
default:
|
||||
nextBackend = GPU_BACKEND_DIRECT3D9;
|
||||
genericError = err->T("GenericOpenGLError", defaultErrorOpenGL);
|
||||
break;
|
||||
}
|
||||
std::string full_error = StringFromFormat("%s\n\n%s", genericError, error_string.c_str());
|
||||
std::wstring title = ConvertUTF8ToWString(err->T("GenericGraphicsError", "Graphics Error"));
|
||||
bool yes = IDYES == MessageBox(0, ConvertUTF8ToWString(full_error).c_str(), title.c_str(), MB_ICONERROR | MB_YESNO);
|
||||
ERROR_LOG(BOOT, full_error.c_str());
|
||||
|
||||
// No safe way out without OpenGL.
|
||||
if (yes) {
|
||||
// Change the config to the alternative and restart.
|
||||
g_Config.iGPUBackend = nextBackend;
|
||||
g_Config.Save();
|
||||
|
||||
W32Util::ExitAndRestart();
|
||||
}
|
||||
|
||||
// No safe way out without graphics.
|
||||
ExitProcess(1);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user