diff --git a/sleepyhead/SleepLib/common.cpp b/sleepyhead/SleepLib/common.cpp index 7f112797..68aaf47e 100644 --- a/sleepyhead/SleepLib/common.cpp +++ b/sleepyhead/SleepLib/common.cpp @@ -9,7 +9,9 @@ #include #include #include +#ifndef BROKEN_OPENGL_BUILD #include +#endif #include #include #include @@ -96,25 +98,30 @@ void setCurrentGFXEngine(GFXEngine e) QString getOpenGLVersionString() { static QString glversion; + if (glversion.isEmpty()) { + +#ifdef BROKEN_OPENGL_BUILD + glversion="LegacyGFX"; + qDebug() << "This LegacyGFX build has been created without the need for OpenGL"; +#else - if (glversion.isEmpty()) { QGLWidget w; w.makeCurrent(); -#if QT_VERSION < QT_VERSION_CHECK(5,4,0) - glversion = QString(QLatin1String(reinterpret_cast(glGetString(GL_VERSION)))); -#else QOpenGLFunctions f; f.initializeOpenGLFunctions(); glversion = QString(QLatin1String(reinterpret_cast(f.glGetString(GL_VERSION)))); -#endif qDebug() << "OpenGL Version:" << glversion; - } - return glversion; +#endif + } + return glversion; } float getOpenGLVersion() { +#ifdef BROKEN_OPENGL_BUILD + return 0; +#else QString glversion = getOpenGLVersionString(); glversion = glversion.section(" ",0,0); bool ok; @@ -130,6 +137,7 @@ float getOpenGLVersion() } } return v; +#endif } QString getGraphicsEngine() diff --git a/sleepyhead/main.cpp b/sleepyhead/main.cpp index 405c8c36..d21431df 100644 --- a/sleepyhead/main.cpp +++ b/sleepyhead/main.cpp @@ -133,10 +133,6 @@ int main(int argc, char *argv[]) mainwin = new MainWindow; -#ifdef BROKEN_OPENGL_BUILD - qDebug() << "This build has been created especially for computers with older graphics hardware.\n"; -#endif - //////////////////////////////////////////////////////////////////////////////////////////// // OpenGL Detection //////////////////////////////////////////////////////////////////////////////////////////// diff --git a/sleepyhead/mainwindow.h b/sleepyhead/mainwindow.h index 8797de92..559f4e87 100644 --- a/sleepyhead/mainwindow.h +++ b/sleepyhead/mainwindow.h @@ -10,7 +10,9 @@ #define MAINWINDOW_H #include +#ifndef BROKEN_OPENGL_BUILD #include +#endif #include #include diff --git a/sleepyhead/overview.h b/sleepyhead/overview.h index 21a5a3a4..125cb5c7 100644 --- a/sleepyhead/overview.h +++ b/sleepyhead/overview.h @@ -10,7 +10,9 @@ #define OVERVIEW_H #include +#ifndef BROKEN_OPENGL_BUILD #include +#endif #include #include #include "SleepLib/profiles.h"