Fix T62651: Win32 Multiple Adapters Warning

Show a more instructive error message for users who have plugged
multiple monitors into multiple display adapters. And do not exit
if unable to open a child window when in this state.

See D13885 for more details

Differential Revision: https://developer.blender.org/D13885

Reviewed by Ray Molenkamp
This commit is contained in:
Harley Acheson 2022-01-28 15:19:05 -08:00
parent 3435c9a2c1
commit fd1078e105
Notes: blender-bot 2023-02-14 10:37:49 +01:00
Referenced by issue #96051, I get an error whenever a pop up window is executed on my secondary monitor (which happens to be my graphics tablet).
Referenced by issue #62651, Dual monitor on separate graphics card driver error
1 changed files with 20 additions and 11 deletions

View File

@ -132,8 +132,24 @@ GHOST_WindowWin32::GHOST_WindowWin32(GHOST_SystemWin32 *system,
m_hDC = ::GetDC(m_hWnd);
if (!setDrawingContextType(type)) {
const char *title = "Blender - Unsupported Graphics Card Configuration";
const char *text =
"A graphics card and driver with support for OpenGL 3.3 or higher is "
"required.\n\nInstalling the latest driver for your graphics card might resolve the "
"issue.";
if (GetSystemMetrics(SM_CMONITORS) > 1) {
text =
"A graphics card and driver with support for OpenGL 3.3 or higher is "
"required.\n\nPlugging all monitors into your primary graphics card might resolve "
"this issue. Installing the latest driver for your graphics card could also help.";
}
MessageBox(m_hWnd, text, title, MB_OK | MB_ICONERROR);
::ReleaseDC(m_hWnd, m_hDC);
::DestroyWindow(m_hWnd);
m_hWnd = NULL;
if (!parentwindow) {
exit(0);
}
return;
}
@ -567,20 +583,13 @@ GHOST_Context *GHOST_WindowWin32::newDrawingContext(GHOST_TDrawingContextType ty
(m_debug_context ? WGL_CONTEXT_DEBUG_BIT_ARB : 0),
GHOST_OPENGL_WGL_RESET_NOTIFICATION_STRATEGY);
if (context->initializeDrawingContext()) {
return context;
}
else {
MessageBox(m_hWnd,
"A graphics card and driver with support for OpenGL 3.3 or higher is required.\n"
"Installing the latest driver for your graphics card may resolve the issue.\n\n"
"The program will now close.",
"Blender - Unsupported Graphics Card or Driver",
MB_OK | MB_ICONERROR);
if (context && !context->initializeDrawingContext()) {
delete context;
exit(0);
context = nullptr;
}
return context;
#elif defined(WITH_GL_PROFILE_COMPAT)
// ask for 2.1 context, driver gives any GL version >= 2.1
// (hopefully the latest compatibility profile)