Changeset View
Changeset View
Standalone View
Standalone View
krita/main.cc
Context not available. | |||||
180 | openGLDebugSynchronous = true; | 180 | openGLDebugSynchronous = true; | ||
---|---|---|---|---|---|
181 | } | 181 | } | ||
182 | 182 | | |||
183 | KisOpenGL::setDefaultFormat(enableOpenGLDebug, openGLDebugSynchronous); | 183 | KisConfig::RootSurfaceFormat rootSurfaceFormat = KisConfig::rootSurfaceFormat(&kritarc); | ||
184 | KisOpenGL::OpenGLRenderer preferredRenderer = KisOpenGL::RendererAuto; | ||||
184 | 185 | | |||
185 | logUsage = kritarc.value("LogUsage", true).toBool(); | 186 | logUsage = kritarc.value("LogUsage", true).toBool(); | ||
186 | 187 | | |||
187 | #ifdef Q_OS_WIN | 188 | const QString preferredRendererString = kritarc.value("OpenGLRenderer", "auto").toString(); | ||
188 | QString preferredOpenGLRenderer = kritarc.value("OpenGLRenderer", "auto").toString(); | 189 | preferredRenderer = KisOpenGL::convertConfigToOpenGLRenderer(preferredRendererString); | ||
189 | 190 | | |||
191 | #ifdef Q_OS_WIN | ||||
190 | // Force ANGLE to use Direct3D11. D3D9 doesn't support OpenGL ES 3 and WARP | 192 | // Force ANGLE to use Direct3D11. D3D9 doesn't support OpenGL ES 3 and WARP | ||
191 | // might get weird crashes atm. | 193 | // might get weird crashes atm. | ||
192 | qputenv("QT_ANGLE_PLATFORM", "d3d11"); | 194 | qputenv("QT_ANGLE_PLATFORM", "d3d11"); | ||
195 | #endif | ||||
193 | 196 | | |||
194 | // Probe QPA auto OpenGL detection | 197 | const QSurfaceFormat format = | ||
195 | char *fakeArgv[2] = { argv[0], nullptr }; // Prevents QCoreApplication from modifying the real argc/argv | 198 | KisOpenGL::selectSurfaceFormat(preferredRenderer, rootSurfaceFormat, enableOpenGLDebug); | ||
196 | KisOpenGL::probeWindowsQpaOpenGL(1, fakeArgv, preferredOpenGLRenderer); | | |||
197 | 199 | | |||
200 | if (format.renderableType() == QSurfaceFormat::OpenGLES) { | ||||
201 | QCoreApplication::setAttribute(Qt::AA_UseOpenGLES, true); | ||||
202 | } else { | ||||
203 | QCoreApplication::setAttribute(Qt::AA_UseDesktopOpenGL, true); | ||||
204 | } | ||||
205 | KisOpenGL::setDefaultSurfaceFormat(format); | ||||
206 | KisOpenGL::setDebugSynchronous(openGLDebugSynchronous); | ||||
207 | | ||||
208 | #ifdef Q_OS_WIN | ||||
198 | // HACK: https://bugs.kde.org/show_bug.cgi?id=390651 | 209 | // HACK: https://bugs.kde.org/show_bug.cgi?id=390651 | ||
199 | resetRotation(); | 210 | resetRotation(); | ||
200 | #endif | 211 | #endif | ||
Context not available. |