added OpenGLChecker

This commit is contained in:
Luis Ángel San Martín
2015-05-06 23:35:40 +02:00
parent e57846e518
commit eac2899afb
4 changed files with 27 additions and 10 deletions

View File

@ -115,7 +115,8 @@ HEADERS += ../common/comic.h \
yacreader_local_client.h \
../common/http_worker.h \
../common/exit_check.h \
../common/scroll_management.h
../common/scroll_management.h \
../common/opengl_checker.h
!CONFIG(no_opengl) {
CONFIG(legacy_gl_widget) {
@ -158,7 +159,8 @@ SOURCES += ../common/comic.cpp \
../common/http_worker.cpp \
../common/yacreader_global.cpp \
../common/exit_check.cpp \
../common/scroll_management.cpp
../common/scroll_management.cpp \
../common/opengl_checker.cpp
!CONFIG(no_opengl) {
CONFIG(legacy_gl_widget) {

View File

@ -18,6 +18,8 @@
#include "comic_db.h"
#include "shortcuts_manager.h"
#include "opengl_checker.h"
#include <QFile>
@ -72,10 +74,15 @@ shouldOpenPrevious(false)
//CONFIG GOTO_FLOW--------------------------------------------------------
#ifndef NO_OPENGL
if(!settings->contains(USE_OPEN_GL))
{
OpenGLChecker openGLChecker;
bool openGLAvailable = openGLChecker.hasCompatibleOpenGLVersion();
if(openGLAvailable && !settings->contains(USE_OPEN_GL))
settings->setValue(USE_OPEN_GL,2);
}
else
if(!openGLAvailable)
settings->setValue(USE_OPEN_GL,0);
if((settings->value(USE_OPEN_GL).toBool() == true))
goToFlow = new GoToFlowGL(this,Configuration::getConfiguration().getFlowType());