From 52db9569b3c7445124cfb119c861a2a9baf4a67d Mon Sep 17 00:00:00 2001 From: kusano Date: Fri, 25 Mar 2016 02:37:28 +0900 Subject: [PATCH] Force Qt to use desktop OpenGL since currently OpenToonz does not work with OpenGL of software or angle. --- toonz/sources/toonz/main.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/toonz/sources/toonz/main.cpp b/toonz/sources/toonz/main.cpp index 14ae56e9..e34742b7 100644 --- a/toonz/sources/toonz/main.cpp +++ b/toonz/sources/toonz/main.cpp @@ -339,7 +339,7 @@ void initToonzEnv() int main(int argc, char *argv[]) { -#ifdef WIN32 +#ifdef Q_OS_WIN // Enable standard input/output on Windows Platform for debug BOOL consoleAttached = ::AttachConsole(ATTACH_PARENT_PROCESS); if (consoleAttached) { @@ -364,6 +364,12 @@ int main(int argc, char *argv[]) QApplication a(argc, argv); +#ifdef Q_OS_WIN + // Since currently OpenToonz does not work with OpenGL of software or angle, + // force Qt to use desktop OpenGL + a.setAttribute(Qt::AA_UseDesktopOpenGL, true); +#endif + // Some Qt objects are destroyed badly withouth a living qApp. So, we must enforce a way to either // postpone the application destruction until the very end, OR ensure that sensible objects are // destroyed before.