Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2015-02-25 15:51:53 +0300
committerAntony Riakiotakis <kalast@gmail.com>2015-02-25 15:51:53 +0300
commitb5b359b48f7f35a79b3eec8534f363952485212d (patch)
tree6acd6668d5941ca64b912b76f6614dff685cb7dd /intern
parent1da5e8df6f101021a89f119614f0160b874a8932 (diff)
Warning messagebox for windows when an unsupported implementation of
OpenGL is detected: Hoping to decrease the frequency of by far one of the most frequent bug reports by windows users. There is some reorganization of the GHOST API to allow easy addition of further OpenGL options in the future. The change is not propagated too deep to keep the size of the patch managable. We might reorganize things here later. For OpenGL we do two checks here: One is a combination of GDI generic renderer or vendor microsoft corporation and OpenGL version 1.1. This means the system does not use GPU acceleration at all. We warn user to install a graphics driver and of cases where this might happen (remote connection, using blender through virtual machine) The other one just checks if OpenGL version is less than 1.4 (we can easily change that in the future of course) and warns that it is deprecated. Both cases will still let blender startup correctly but users should now have a clear idea of the system being unsupported. A user preference flag is provided to turn the warning off. Now stop posting those bug reports without installing a driver first - please?
Diffstat (limited to 'intern')
-rw-r--r--intern/ghost/GHOST_C-api.h3
-rw-r--r--intern/ghost/GHOST_ISystem.h3
-rw-r--r--intern/ghost/GHOST_Types.h11
-rw-r--r--intern/ghost/intern/GHOST_C-api.cpp6
-rw-r--r--intern/ghost/intern/GHOST_ContextWGL.cpp34
-rw-r--r--intern/ghost/intern/GHOST_ContextWGL.h3
-rw-r--r--intern/ghost/intern/GHOST_System.cpp11
-rw-r--r--intern/ghost/intern/GHOST_SystemCocoa.h5
-rw-r--r--intern/ghost/intern/GHOST_SystemCocoa.mm5
-rw-r--r--intern/ghost/intern/GHOST_SystemNULL.h6
-rw-r--r--intern/ghost/intern/GHOST_SystemSDL.cpp9
-rw-r--r--intern/ghost/intern/GHOST_SystemSDL.h3
-rw-r--r--intern/ghost/intern/GHOST_SystemWin32.cpp8
-rw-r--r--intern/ghost/intern/GHOST_SystemWin32.h5
-rw-r--r--intern/ghost/intern/GHOST_SystemX11.cpp13
-rw-r--r--intern/ghost/intern/GHOST_SystemX11.h3
-rw-r--r--intern/ghost/intern/GHOST_WindowWin32.cpp12
-rw-r--r--intern/ghost/intern/GHOST_WindowWin32.h1
18 files changed, 91 insertions, 50 deletions
diff --git a/intern/ghost/GHOST_C-api.h b/intern/ghost/GHOST_C-api.h
index c0f2651dd8b..5f01a13b64e 100644
--- a/intern/ghost/GHOST_C-api.h
+++ b/intern/ghost/GHOST_C-api.h
@@ -186,8 +186,7 @@ extern GHOST_WindowHandle GHOST_CreateWindow(GHOST_SystemHandle systemhandle,
GHOST_TUns32 height,
GHOST_TWindowState state,
GHOST_TDrawingContextType type,
- const int stereoVisual,
- const GHOST_TUns16 numOfAASamples);
+ GHOST_GLSettings glSettings);
/**
* Returns the window user data.
diff --git a/intern/ghost/GHOST_ISystem.h b/intern/ghost/GHOST_ISystem.h
index 19f36319949..93ccc0fc947 100644
--- a/intern/ghost/GHOST_ISystem.h
+++ b/intern/ghost/GHOST_ISystem.h
@@ -250,9 +250,8 @@ public:
const STR_String& title,
GHOST_TInt32 left, GHOST_TInt32 top, GHOST_TUns32 width, GHOST_TUns32 height,
GHOST_TWindowState state, GHOST_TDrawingContextType type,
- const bool stereoVisual = false,
+ GHOST_GLSettings glSettings,
const bool exclusive = false,
- const GHOST_TUns16 numOfAASamples = 0,
const GHOST_TEmbedderWindowID parentWindow = 0) = 0;
/**
diff --git a/intern/ghost/GHOST_Types.h b/intern/ghost/GHOST_Types.h
index c4a7490c71c..6dd92e5c2f9 100644
--- a/intern/ghost/GHOST_Types.h
+++ b/intern/ghost/GHOST_Types.h
@@ -50,6 +50,17 @@ typedef unsigned short GHOST_TUns16;
typedef int GHOST_TInt32;
typedef unsigned int GHOST_TUns32;
+typedef struct {
+ GHOST_TUns16 numOfAASamples;
+ int flags;
+} GHOST_GLSettings;
+
+typedef enum {
+ GHOST_glStereoVisual = 0,
+ GHOST_glWarnSupport
+} GHOST_GLFlags;
+
+
#ifdef _MSC_VER
typedef __int64 GHOST_TInt64;
typedef unsigned __int64 GHOST_TUns64;
diff --git a/intern/ghost/intern/GHOST_C-api.cpp b/intern/ghost/intern/GHOST_C-api.cpp
index 0da77ac5e20..8d01e8ac3a6 100644
--- a/intern/ghost/intern/GHOST_C-api.cpp
+++ b/intern/ghost/intern/GHOST_C-api.cpp
@@ -140,14 +140,12 @@ GHOST_WindowHandle GHOST_CreateWindow(GHOST_SystemHandle systemhandle,
GHOST_TUns32 height,
GHOST_TWindowState state,
GHOST_TDrawingContextType type,
- const int stereoVisual,
- const GHOST_TUns16 numOfAASamples)
+ GHOST_GLSettings glSettings)
{
GHOST_ISystem *system = (GHOST_ISystem *) systemhandle;
return (GHOST_WindowHandle) system->createWindow(title, left, top, width, height,
- state, type, stereoVisual != 0, false,
- numOfAASamples);
+ state, type, glSettings, false);
}
GHOST_TUserDataPtr GHOST_GetWindowUserData(GHOST_WindowHandle windowhandle)
diff --git a/intern/ghost/intern/GHOST_ContextWGL.cpp b/intern/ghost/intern/GHOST_ContextWGL.cpp
index 312600c01d4..31b5863f5a1 100644
--- a/intern/ghost/intern/GHOST_ContextWGL.cpp
+++ b/intern/ghost/intern/GHOST_ContextWGL.cpp
@@ -48,6 +48,7 @@ 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
@@ -863,12 +864,39 @@ GHOST_TSuccess GHOST_ContextWGL::initializeDrawingContext()
initClearGL();
::SwapBuffers(m_hDC);
+ const char *vendor = reinterpret_cast<const char*>(glGetString(GL_VENDOR));
+ const char *renderer = reinterpret_cast<const char*>(glGetString(GL_RENDERER));
+ const char *version = reinterpret_cast<const char*>(glGetString(GL_VERSION));
+
#ifndef NDEBUG
- reportContextString("Vendor", m_dummyVendor, reinterpret_cast<const char*>(glGetString(GL_VENDOR)));
- reportContextString("Renderer", m_dummyRenderer, reinterpret_cast<const char*>(glGetString(GL_RENDERER)));
- reportContextString("Version", m_dummyVersion, reinterpret_cast<const char*>(glGetString(GL_VERSION)));
+ reportContextString("Vendor", m_dummyVendor, vendor);
+ reportContextString("Renderer", m_dummyRenderer, renderer);
+ 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[0] == '1')
+ {
+ MessageBox(m_hWnd, "Your system does not use GPU acceleration.\n"
+ "Such systems can cause stability problems in blender and they are unsupported.\n\n"
+ "This may is 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 GPU 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;
+ }
+
return GHOST_kSuccess;
error:
diff --git a/intern/ghost/intern/GHOST_ContextWGL.h b/intern/ghost/intern/GHOST_ContextWGL.h
index 98a8059b242..63496d2a2b2 100644
--- a/intern/ghost/intern/GHOST_ContextWGL.h
+++ b/intern/ghost/intern/GHOST_ContextWGL.h
@@ -118,6 +118,8 @@ public:
*/
GHOST_TSuccess getSwapInterval(int &intervalOut);
+ static void unSetWarningOld(){s_warn_old = true;}
+
protected:
inline void activateWGLEW() const {
#ifdef WITH_GLEW_MX
@@ -183,6 +185,7 @@ private:
static int s_sharedCount;
static bool s_singleContextMode;
+ static bool s_warn_old;
};
#endif // __GHOST_CONTEXTWGL_H__
diff --git a/intern/ghost/intern/GHOST_System.cpp b/intern/ghost/intern/GHOST_System.cpp
index d1f2d5d87c8..fef8fda7da3 100644
--- a/intern/ghost/intern/GHOST_System.cpp
+++ b/intern/ghost/intern/GHOST_System.cpp
@@ -350,6 +350,12 @@ GHOST_TSuccess GHOST_System::exit()
GHOST_TSuccess GHOST_System::createFullScreenWindow(GHOST_Window **window, const GHOST_DisplaySetting &settings,
const bool stereoVisual, const GHOST_TUns16 numOfAASamples)
{
+ GHOST_GLSettings glSettings = {0};
+
+ if (stereoVisual)
+ glSettings.flags |= GHOST_glStereoVisual;
+ glSettings.numOfAASamples = numOfAASamples;
+
/* note: don't use getCurrentDisplaySetting() because on X11 we may
* be zoomed in and the desktop may be bigger then the viewport. */
GHOST_ASSERT(m_displayManager, "GHOST_System::createFullScreenWindow(): invalid display manager");
@@ -359,9 +365,8 @@ GHOST_TSuccess GHOST_System::createFullScreenWindow(GHOST_Window **window, const
0, 0, settings.xPixels, settings.yPixels,
GHOST_kWindowStateNormal,
GHOST_kDrawingContextTypeOpenGL,
- stereoVisual,
- true, /* exclusive */
- numOfAASamples);
+ glSettings,
+ true /* exclusive */);
return (*window == NULL) ? GHOST_kFailure : GHOST_kSuccess;
}
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.h b/intern/ghost/intern/GHOST_SystemCocoa.h
index 72a4d7dd87b..a86575abade 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.h
+++ b/intern/ghost/intern/GHOST_SystemCocoa.h
@@ -118,9 +118,8 @@ public:
GHOST_TUns32 height,
GHOST_TWindowState state,
GHOST_TDrawingContextType type,
- const bool stereoVisual = false,
- const bool exclusive = false,
- const GHOST_TUns16 numOfAASamples = 0,
+ GHOST_GLSettings glSettings,
+ const bool exclusive = false,
const GHOST_TEmbedderWindowID parentWindow = 0
);
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm
index 3ce9a4b9576..095c738e1e0 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.mm
+++ b/intern/ghost/intern/GHOST_SystemCocoa.mm
@@ -530,9 +530,8 @@ GHOST_IWindow* GHOST_SystemCocoa::createWindow(
GHOST_TUns32 height,
GHOST_TWindowState state,
GHOST_TDrawingContextType type,
- bool stereoVisual,
+ GHOST_GLSettings glSettings,
const bool exclusive,
- const GHOST_TUns16 numOfAASamples,
const GHOST_TEmbedderWindowID parentWindow
)
{
@@ -551,7 +550,7 @@ GHOST_IWindow* GHOST_SystemCocoa::createWindow(
// Add contentRect.origin.y to respect docksize
bottom = bottom > contentRect.origin.y ? bottom + contentRect.origin.y : contentRect.origin.y;
- window = new GHOST_WindowCocoa (this, title, left, bottom, width, height, state, type, stereoVisual, numOfAASamples);
+ window = new GHOST_WindowCocoa (this, title, left, bottom, width, height, state, type, ((glSettings.flags & GHOST_glStereoVisual) != 0), glSettings.numOfAASamples);
if (window->getValid()) {
// Store the pointer to the window
diff --git a/intern/ghost/intern/GHOST_SystemNULL.h b/intern/ghost/intern/GHOST_SystemNULL.h
index 77a741c2efb..868416cd227 100644
--- a/intern/ghost/intern/GHOST_SystemNULL.h
+++ b/intern/ghost/intern/GHOST_SystemNULL.h
@@ -75,12 +75,12 @@ public:
GHOST_TUns32 height,
GHOST_TWindowState state,
GHOST_TDrawingContextType type,
- bool stereoVisual,
+ GHOST_GLSettings glSettings,
bool exclusive,
- const GHOST_TUns16 numOfAASamples,
const GHOST_TEmbedderWindowID parentWindow)
{
- return new GHOST_WindowNULL(this, title, left, top, width, height, state, parentWindow, type, stereoVisual, 1);
+ return new GHOST_WindowNULL(this, title, left, top, width, height, state, parentWindow, type,
+ ((glSettings.flags & GHOST_glStereoVisual) != 0), 1);
}
};
diff --git a/intern/ghost/intern/GHOST_SystemSDL.cpp b/intern/ghost/intern/GHOST_SystemSDL.cpp
index 1d2401e6f71..90da81a38f9 100644
--- a/intern/ghost/intern/GHOST_SystemSDL.cpp
+++ b/intern/ghost/intern/GHOST_SystemSDL.cpp
@@ -67,19 +67,20 @@ GHOST_SystemSDL::createWindow(const STR_String& title,
GHOST_TUns32 height,
GHOST_TWindowState state,
GHOST_TDrawingContextType type,
- const bool stereoVisual,
+ GHOST_GLSettings glSettings,
const bool exclusive,
- const GHOST_TUns16 numOfAASamples,
const GHOST_TEmbedderWindowID parentWindow
)
{
GHOST_WindowSDL *window = NULL;
+
+ (void) warnOld;
window = new GHOST_WindowSDL(this, title,
left, top, width, height,
state, parentWindow, type,
- stereoVisual, exclusive,
- numOfAASamples);
+ ((glSettings.flags & GHOST_glStereoVisual) != 0), exclusive,
+ glSettings.numOfAASamples);
if (window) {
if (GHOST_kWindowStateFullScreen == state) {
diff --git a/intern/ghost/intern/GHOST_SystemSDL.h b/intern/ghost/intern/GHOST_SystemSDL.h
index 5ad4fe09833..6f4ecec586b 100644
--- a/intern/ghost/intern/GHOST_SystemSDL.h
+++ b/intern/ghost/intern/GHOST_SystemSDL.h
@@ -108,9 +108,8 @@ private:
GHOST_TUns32 height,
GHOST_TWindowState state,
GHOST_TDrawingContextType type,
- const bool stereoVisual,
+ GHOST_GLSettings glSettings,
const bool exclusive = false,
- const GHOST_TUns16 numOfAASamples = 0,
const GHOST_TEmbedderWindowID parentWindow = 0
);
diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp
index 4247c4f31ce..f711bc0271e 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.cpp
+++ b/intern/ghost/intern/GHOST_SystemWin32.cpp
@@ -231,9 +231,8 @@ GHOST_IWindow *GHOST_SystemWin32::createWindow(
GHOST_TInt32 left, GHOST_TInt32 top,
GHOST_TUns32 width, GHOST_TUns32 height,
GHOST_TWindowState state, GHOST_TDrawingContextType type,
- bool wantStereoVisual,
+ GHOST_GLSettings glSettings,
const bool exclusive,
- const GHOST_TUns16 wantNumOfAASamples,
const GHOST_TEmbedderWindowID parentWindow)
{
GHOST_Window *window =
@@ -246,8 +245,9 @@ GHOST_IWindow *GHOST_SystemWin32::createWindow(
height,
state,
type,
- wantStereoVisual,
- wantNumOfAASamples,
+ ((glSettings.flags & GHOST_glStereoVisual) != 0),
+ ((glSettings.flags & GHOST_glWarnSupport) != 0),
+ glSettings.numOfAASamples,
parentWindow);
if (window->getValid()) {
diff --git a/intern/ghost/intern/GHOST_SystemWin32.h b/intern/ghost/intern/GHOST_SystemWin32.h
index 744f3a6a603..2bb631103c7 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.h
+++ b/intern/ghost/intern/GHOST_SystemWin32.h
@@ -125,9 +125,8 @@ public:
const STR_String& title,
GHOST_TInt32 left, GHOST_TInt32 top, GHOST_TUns32 width, GHOST_TUns32 height,
GHOST_TWindowState state, GHOST_TDrawingContextType type,
- const bool stereoVisual = false,
- const bool exclusive = false,
- const GHOST_TUns16 numOfAASamples = 0,
+ GHOST_GLSettings glSettings,
+ const bool exclusive = false,
const GHOST_TEmbedderWindowID parentWindow = 0);
/***************************************************************************************
diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp
index e8199288fb2..241ce9728cc 100644
--- a/intern/ghost/intern/GHOST_SystemX11.cpp
+++ b/intern/ghost/intern/GHOST_SystemX11.cpp
@@ -289,31 +289,26 @@ getAllDisplayDimensions(
*/
GHOST_IWindow *
GHOST_SystemX11::
-createWindow(
- const STR_String& title,
+createWindow(const STR_String& title,
GHOST_TInt32 left,
GHOST_TInt32 top,
GHOST_TUns32 width,
GHOST_TUns32 height,
GHOST_TWindowState state,
GHOST_TDrawingContextType type,
- const bool stereoVisual,
+ GHOST_GLSettings glSettings,
const bool exclusive,
- const GHOST_TUns16 numOfAASamples,
const GHOST_TEmbedderWindowID parentWindow)
{
GHOST_WindowX11 *window = 0;
if (!m_display) return 0;
-
-
-
window = new GHOST_WindowX11(this, m_display, title,
left, top, width, height,
state, parentWindow, type,
- stereoVisual, exclusive,
- numOfAASamples);
+ ((glSettings.flags & GHOST_glStereoVisual) != 0), exclusive,
+ glSettings.numOfAASamples);
if (window) {
/* Both are now handle in GHOST_WindowX11.cpp
diff --git a/intern/ghost/intern/GHOST_SystemX11.h b/intern/ghost/intern/GHOST_SystemX11.h
index 378f07dd0bd..4004bda11cb 100644
--- a/intern/ghost/intern/GHOST_SystemX11.h
+++ b/intern/ghost/intern/GHOST_SystemX11.h
@@ -151,9 +151,8 @@ public:
GHOST_TUns32 height,
GHOST_TWindowState state,
GHOST_TDrawingContextType type,
- const bool stereoVisual,
+ GHOST_GLSettings glSettings,
const bool exclusive = false,
- const GHOST_TUns16 numOfAASamples = 0,
const GHOST_TEmbedderWindowID parentWindow = 0
);
diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp
index 4e384881f2c..e033daeb221 100644
--- a/intern/ghost/intern/GHOST_WindowWin32.cpp
+++ b/intern/ghost/intern/GHOST_WindowWin32.cpp
@@ -62,8 +62,7 @@ extern "C" {
__declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
}
-GHOST_WindowWin32::GHOST_WindowWin32(
- GHOST_SystemWin32 *system,
+GHOST_WindowWin32::GHOST_WindowWin32(GHOST_SystemWin32 *system,
const STR_String &title,
GHOST_TInt32 left,
GHOST_TInt32 top,
@@ -71,7 +70,7 @@ GHOST_WindowWin32::GHOST_WindowWin32(
GHOST_TUns32 height,
GHOST_TWindowState state,
GHOST_TDrawingContextType type,
- bool wantStereoVisual,
+ bool wantStereoVisual, bool warnOld,
GHOST_TUns16 wantNumOfAASamples,
GHOST_TEmbedderWindowID parentwindowhwnd)
: GHOST_Window(width, height, state,
@@ -97,6 +96,13 @@ GHOST_WindowWin32::GHOST_WindowWin32(
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)) {
diff --git a/intern/ghost/intern/GHOST_WindowWin32.h b/intern/ghost/intern/GHOST_WindowWin32.h
index fd8c0c2e9ac..1eaef243df9 100644
--- a/intern/ghost/intern/GHOST_WindowWin32.h
+++ b/intern/ghost/intern/GHOST_WindowWin32.h
@@ -90,6 +90,7 @@ public:
GHOST_TWindowState state,
GHOST_TDrawingContextType type = GHOST_kDrawingContextTypeNone,
bool wantStereoVisual = false,
+ bool warnOld = false,
GHOST_TUns16 wantNumOfAASamples = 0,
GHOST_TEmbedderWindowID parentWindowHwnd = 0
);