Error out on Windows if driver does not support OpenGL 2.1 with an error
messagebox.
This commit is contained in:
@@ -57,8 +57,7 @@ typedef struct {
|
||||
|
||||
typedef enum {
|
||||
GHOST_glStereoVisual = (1 << 0),
|
||||
GHOST_glWarnSupport = (1 << 1),
|
||||
GHOST_glDebugContext = (1 << 2),
|
||||
GHOST_glDebugContext = (1 << 1)
|
||||
} GHOST_GLFlags;
|
||||
|
||||
|
||||
|
||||
@@ -48,7 +48,6 @@ HGLRC GHOST_ContextWGL::s_sharedHGLRC = NULL;
|
||||
int GHOST_ContextWGL::s_sharedCount = 0;
|
||||
|
||||
bool GHOST_ContextWGL::s_singleContextMode = false;
|
||||
bool GHOST_ContextWGL::s_warn_old = false;
|
||||
|
||||
|
||||
/* Intel video-cards don't work fine with multiple contexts and
|
||||
@@ -918,27 +917,25 @@ GHOST_TSuccess GHOST_ContextWGL::initializeDrawingContext()
|
||||
reportContextString("Version", m_dummyVersion, version);
|
||||
#endif
|
||||
|
||||
if (!s_warn_old) {
|
||||
if ((strcmp(vendor, "Microsoft Corporation") == 0 ||
|
||||
strcmp(renderer, "GDI Generic") == 0) && version[0] == '1' && version[2] == '1')
|
||||
{
|
||||
MessageBox(m_hWnd, "Your system does not use 3D hardware acceleration.\n"
|
||||
"Such systems can cause stability problems in Blender and they are unsupported.\n\n"
|
||||
"This may be caused by:\n"
|
||||
"* A missing or faulty graphics driver installation.\n"
|
||||
" Blender needs a graphics card driver to work correctly.\n"
|
||||
"* Accessing Blender through a remote connection.\n"
|
||||
"* Using Blender through a virtual machine.\n\n"
|
||||
"Disable this message in <User Preferences - Interface - Warn On Deprecated OpenGL>",
|
||||
"Blender - Can't detect 3D hardware accelerated Driver!", MB_OK | MB_ICONWARNING);
|
||||
}
|
||||
else if (version[0] == '1' && version[2] < '4') {
|
||||
MessageBox(m_hWnd, "The OpenGL version provided by your graphics driver version is too low\n"
|
||||
"Blender requires version 1.4 and may not work correctly\n\n"
|
||||
"Disable this message in <User Preferences - Interface - Warn On Deprecated OpenGL>",
|
||||
"Blender - Unsupported Graphics Driver!", MB_OK | MB_ICONWARNING);
|
||||
}
|
||||
s_warn_old = true;
|
||||
if ((strcmp(vendor, "Microsoft Corporation") == 0 ||
|
||||
strcmp(renderer, "GDI Generic") == 0) && version[0] == '1' && version[2] == '1')
|
||||
{
|
||||
MessageBox(m_hWnd, "Your system does not use 3D hardware acceleration.\n"
|
||||
"Blender requires a graphics driver with OpenGL 2.1 support.\n\n"
|
||||
"This may be caused by:\n"
|
||||
"* A missing or faulty graphics driver installation.\n"
|
||||
" Blender needs a graphics card driver to work correctly.\n"
|
||||
"* Accessing Blender through a remote connection.\n"
|
||||
"* Using Blender through a virtual machine.\n\n",
|
||||
"The program will now close\n"
|
||||
"Blender - Can't detect 3D hardware accelerated Driver!", MB_OK | MB_ICONERROR);
|
||||
exit(0);
|
||||
}
|
||||
else if (version[0] < '2' || (version[0] == '2' && version[2] < '1')) {
|
||||
MessageBox(m_hWnd, "Blender requires a graphics driver with OpenGL 2.1 support\n"
|
||||
"The program will now close\n",
|
||||
"Blender - Unsupported Graphics Driver!", MB_OK | MB_ICONERROR);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
return GHOST_kSuccess;
|
||||
|
||||
@@ -118,8 +118,6 @@ public:
|
||||
*/
|
||||
GHOST_TSuccess getSwapInterval(int &intervalOut);
|
||||
|
||||
static void unSetWarningOld(){s_warn_old = true;}
|
||||
|
||||
protected:
|
||||
inline void activateWGLEW() const {
|
||||
#ifdef WITH_GLEW_MX
|
||||
@@ -184,7 +182,6 @@ private:
|
||||
static int s_sharedCount;
|
||||
|
||||
static bool s_singleContextMode;
|
||||
static bool s_warn_old;
|
||||
};
|
||||
|
||||
#endif // __GHOST_CONTEXTWGL_H__
|
||||
|
||||
@@ -241,7 +241,6 @@ GHOST_IWindow *GHOST_SystemWin32::createWindow(
|
||||
state,
|
||||
type,
|
||||
((glSettings.flags & GHOST_glStereoVisual) != 0),
|
||||
((glSettings.flags & GHOST_glWarnSupport) != 0),
|
||||
glSettings.numOfAASamples,
|
||||
parentWindow,
|
||||
((glSettings.flags & GHOST_glDebugContext) != 0));
|
||||
|
||||
@@ -70,7 +70,7 @@ GHOST_WindowWin32::GHOST_WindowWin32(GHOST_SystemWin32 *system,
|
||||
GHOST_TUns32 height,
|
||||
GHOST_TWindowState state,
|
||||
GHOST_TDrawingContextType type,
|
||||
bool wantStereoVisual, bool warnOld,
|
||||
bool wantStereoVisual,
|
||||
GHOST_TUns16 wantNumOfAASamples,
|
||||
GHOST_TEmbedderWindowID parentwindowhwnd,
|
||||
bool is_debug)
|
||||
@@ -98,13 +98,6 @@ GHOST_WindowWin32::GHOST_WindowWin32(GHOST_SystemWin32 *system,
|
||||
|
||||
versionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
|
||||
|
||||
#if !defined(WITH_GL_EGL)
|
||||
if (!warnOld)
|
||||
GHOST_ContextWGL::unSetWarningOld();
|
||||
#else
|
||||
(void)(warnOld);
|
||||
#endif
|
||||
|
||||
if (!GetVersionEx((OSVERSIONINFO *)&versionInfo)) {
|
||||
versionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
||||
if (GetVersionEx((OSVERSIONINFO *)&versionInfo)) {
|
||||
|
||||
@@ -89,7 +89,6 @@ public:
|
||||
GHOST_TWindowState state,
|
||||
GHOST_TDrawingContextType type = GHOST_kDrawingContextTypeNone,
|
||||
bool wantStereoVisual = false,
|
||||
bool warnOld = false,
|
||||
GHOST_TUns16 wantNumOfAASamples = 0,
|
||||
GHOST_TEmbedderWindowID parentWindowHwnd = 0,
|
||||
bool is_debug = false);
|
||||
|
||||
@@ -174,7 +174,6 @@ class USERPREF_PT_interface(Panel):
|
||||
if sys.platform[:3] == "win":
|
||||
col.label("Warnings")
|
||||
col.prop(view, "use_quit_dialog")
|
||||
col.prop(view, "use_gl_warn_support")
|
||||
|
||||
row.separator()
|
||||
row.separator()
|
||||
|
||||
@@ -683,7 +683,6 @@ typedef enum eUserpref_UI_Flag2 {
|
||||
USER_KEEP_SESSION = (1 << 0),
|
||||
USER_REGION_OVERLAP = (1 << 1),
|
||||
USER_TRACKPAD_NATURAL = (1 << 2),
|
||||
USER_OPENGL_NO_WARN_SUPPORT = (1 << 3)
|
||||
} eUserpref_UI_Flag2;
|
||||
|
||||
/* Auto-Keying mode */
|
||||
|
||||
@@ -3445,11 +3445,6 @@ static void rna_def_userdef_view(BlenderRNA *brna)
|
||||
RNA_def_property_ui_text(prop, "Prompt Quit",
|
||||
"Ask for confirmation when quitting through the window close button");
|
||||
|
||||
prop = RNA_def_property(srna, "use_gl_warn_support", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag2", USER_OPENGL_NO_WARN_SUPPORT);
|
||||
RNA_def_property_ui_text(prop, "Warn On Deprecated OpenGL",
|
||||
"Pop up a warning when an old OpenGL version is detected");
|
||||
|
||||
/* Toolbox click-hold delay */
|
||||
prop = RNA_def_property(srna, "open_left_mouse_delay", PROP_INT, PROP_NONE);
|
||||
RNA_def_property_int_sdna(prop, NULL, "tb_leftmouse");
|
||||
|
||||
@@ -404,9 +404,6 @@ static void wm_window_ghostwindow_add(wmWindowManager *wm, const char *title, wm
|
||||
glSettings.flags |= GHOST_glDebugContext;
|
||||
}
|
||||
|
||||
if (!(U.uiflag2 & USER_OPENGL_NO_WARN_SUPPORT))
|
||||
glSettings.flags |= GHOST_glWarnSupport;
|
||||
|
||||
wm_get_screensize(&scr_w, &scr_h);
|
||||
posy = (scr_h - win->posy - win->sizey);
|
||||
|
||||
|
||||
@@ -457,7 +457,6 @@ int main(int argc, char** argv)
|
||||
|
||||
initglobals();
|
||||
|
||||
U.gameflags |= USER_DISABLE_VBO;
|
||||
// We load our own G.main, so free the one that initglobals() gives us
|
||||
BKE_main_free(G.main);
|
||||
G.main = NULL;
|
||||
|
||||
Reference in New Issue
Block a user