Commit 49193aaf authored by Christopher Tenter's avatar Christopher Tenter

replace qt opengl checks with ACG refs #2529

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@21133 383ad7c9-94d9-4d36-a494-682f7c89f535
parent b0d19e3c
......@@ -57,14 +57,6 @@
#if QT_VERSION >= 0x050000
#include <QOpenGLContext>
#include <QSurfaceFormat>
#else
#undef QT_NO_OPENGL
#include <QGLFormat>
#endif
#include <QMenu>
// =================================================
......@@ -81,7 +73,6 @@ Renderer::~Renderer()
void Renderer::initializePlugin()
{
ACG::ShaderProgGenerator::setShaderDir(OpenFlipper::Options::shaderDirStr());
}
......@@ -105,54 +96,19 @@ void Renderer::render(ACG::GLState* _glState, Viewer::ViewerProperties& _propert
QString Renderer::checkOpenGL()
{
#if QT_VERSION < 0x050000
// Get version and check
QGLFormat::OpenGLVersionFlags flags = QGLFormat::openGLVersionFlags();
if ( !flags.testFlag(QGLFormat::OpenGL_Version_3_2) )
return QString("Insufficient OpenGL Version! OpenGL 3.2 or higher required");
// Check extensions
QString glExtensions = QString((const char*)glGetString(GL_EXTENSIONS));
QString missing("");
if ( !glExtensions.contains("GL_ARB_vertex_buffer_object") )
missing += "GL_ARB_vertex_buffer_object extension missing\n";
#ifndef __APPLE__
if ( !glExtensions.contains("GL_ARB_vertex_program") )
missing += "GL_ARB_vertex_program extension missing\n";
#endif
return missing;
#else
QOpenGLContext* context = QOpenGLContext::currentContext();
if ( context ) {
if (!ACG::openGLVersion(3, 2))
return QString("Insufficient OpenGL Version! OpenGL 3.2 or higher required");
// Get version and check
QSurfaceFormat format = context->format();
QString missing("");
if ( !ACG::checkExtensionSupported("GL_ARB_vertex_buffer_object") )
missing += "GL_ARB_vertex_buffer_object extension missing\n";
if ( (format.majorVersion() < 4) && (format.minorVersion() < 2) ) {
return QString("Insufficient OpenGL Version! OpenGL 3.2 or higher required");
}
// Check extensions
QString missing("");
if ( !context->hasExtension("GL_ARB_vertex_buffer_object") )
missing += "GL_ARB_vertex_buffer_object extension missing\n";
#ifndef __APPLE__
if ( !context->hasExtension("GL_ARB_vertex_program") )
missing += "GL_ARB_vertex_program extension missing\n";
#endif
return missing;
} else {
return name() + QString(": No context available");
}
#endif
#ifndef __APPLE__
if ( !ACG::checkExtensionSupported("GL_ARB_vertex_program") )
missing += "GL_ARB_vertex_program extension missing\n";
#endif
return missing;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment