diff --git a/krita/ui/KisView.cpp b/krita/ui/KisView.cpp --- a/krita/ui/KisView.cpp +++ b/krita/ui/KisView.cpp @@ -56,6 +56,8 @@ #include #include #include +#include +#include #include #include @@ -269,23 +271,6 @@ grp.sync(); d->canvas = new KisCanvas2(d->viewConverter, resourceManager, this, document->shapeController()); -/** - * Warn about Intel's broken video drivers - */ -#if defined HAVE_OPENGL && defined Q_OS_WIN - QString renderer((const char*)glGetString(GL_RENDERER)); - if (cfg.useOpenGL() && renderer.startsWith("Intel") && !cfg.readEntry("WarnedAboutIntel", false)) { - QMessageBox::information(0, - i18nc("@title:window", "Krita: Warning"), - i18n("You have an Intel(R) HD Graphics video adapter.\n" - "If you experience problems like a black or blank screen," - "please update your display driver to the latest version.\n\n" - "You can also disable OpenGL rendering in Krita's Settings.\n")); - cfg.writeEntry("WarnedAboutIntel", true); - } - -#endif /* defined HAVE_OPENGL && defined Q_OS_WIN32 */ - grp.writeEntry("CreatingCanvas", false); grp.sync(); diff --git a/krita/ui/opengl/kis_opengl_canvas2.cpp b/krita/ui/opengl/kis_opengl_canvas2.cpp --- a/krita/ui/opengl/kis_opengl_canvas2.cpp +++ b/krita/ui/opengl/kis_opengl_canvas2.cpp @@ -232,10 +232,11 @@ // } // } // } + KisConfig cfg; qDebug() << "OpenGL: Preparing to initialize OpenGL for KisCanvas"; int glVersion = KisOpenGL::initializeContext(context()); - qDebug() << "OpenGL: Context gives version" << glVersion; + qDebug() << "OpenGL: Version found" << glVersion; initializeOpenGLFunctions(); VSyncWorkaround::tryDisableVSync(context()); @@ -246,6 +247,28 @@ Sync::init(); + + + /** + * Warn about Intel's broken video drivers + */ +#if defined HAVE_OPENGL && defined Q_OS_WIN +#ifndef GL_RENDERER +# define GL_RENDERER 0x1F01 +#endif + QString renderer = QString((const char*)glGetString(GL_RENDERER)); + if (cfg.useOpenGL() && renderer.startsWith("Intel") && !cfg.readEntry("WarnedAboutIntel", false)) { + QMessageBox::information(0, + i18nc("@title:window", "Krita: Warning"), + i18n("You have an Intel(R) HD Graphics video adapter.\n" + "If you experience problems like a black or blank screen," + "please update your display driver to the latest version.\n\n" + "You can also disable OpenGL rendering in Krita's Settings.\n")); + cfg.writeEntry("WarnedAboutIntel", true); + } +#endif + + d->canvasInitialized = true; }