Exemple #1
0
bool checkOpenGL(){

    QGLWidget *glWidget = new QGLWidget;

    QGLContext* glContext = (QGLContext *) glWidget->context();
    GLCHK( glContext->makeCurrent() );

    qDebug() << "Running the " + QString(AWESOME_BUMP_VERSION);
    qDebug() << "Checking OpenGL version...";
    qDebug() << "Widget OpenGL: " << glContext->format().majorVersion() << "." << glContext->format().minorVersion() ;
    qDebug() << "Context valid: " << glContext->isValid() ;
    qDebug() << "OpenGL information: " ;
    qDebug() << "VENDOR: "       << (const char*)glGetString(GL_VENDOR) ;
    qDebug() << "RENDERER: "     << (const char*)glGetString(GL_RENDERER) ;
    qDebug() << "VERSION: "      << (const char*)glGetString(GL_VERSION) ;
    qDebug() << "GLSL VERSION: " << (const char*)glGetString(GL_SHADING_LANGUAGE_VERSION) ;

    float version = glContext->format().majorVersion() + 0.1 * glContext->format().minorVersion();

    delete glWidget;

    qDebug() << "Version:" << version;
    // check openGL version
    if( version < 4.0 )
    {
       qDebug() << "Error: AwesomeBump does not support openGL versions lower than 4.0 :(" ;
       return false;
    }
    return true;

}
Exemple #2
0
bool checkOpenGL(){

    QGLWidget *glWidget = new QGLWidget;

    QGLContext* glContext = (QGLContext *) glWidget->context();
    GLCHK( glContext->makeCurrent() );

    qDebug() << "Running the " + QString(AWESOME_BUMP_VERSION);
    qDebug() << "Checking OpenGL version...";
    qDebug() << "Widget OpenGL:" << QString("%1.%2").arg(glContext->format().majorVersion()).arg(glContext->format().minorVersion());
    qDebug() << "Context valid:" << glContext->isValid() ;
    qDebug() << "OpenGL information:" ;
    qDebug() << "VENDOR:"       << (const char*)glGetString(GL_VENDOR) ;
    qDebug() << "RENDERER:"     << (const char*)glGetString(GL_RENDERER) ;
    qDebug() << "VERSION:"      << (const char*)glGetString(GL_VERSION) ;
    qDebug() << "GLSL VERSION:" << (const char*)glGetString(GL_SHADING_LANGUAGE_VERSION) ;

    float version = glContext->format().majorVersion() + 0.1 * glContext->format().minorVersion();
    Performance3DSettings::openGLVersion = version;
    #ifdef USE_OPENGL_330
        Performance3DSettings::openGLVersion = 3.3;
    #endif

    delete glWidget;

    qDebug() << "Version:" << version;

    #ifdef USE_OPENGL_330
        // check openGL version
        if( version < 3.3 )
        {
           qDebug() << "Error: This version of AwesomeBump does not support openGL versions lower than 3.3 :(" ;
           return false;
        }
    #else
        // check openGL version
        if( version < 4.0 )
        {
           qDebug() << "Error: AwesomeBump does not support openGL versions lower than 4.0 :(" ;
           return false;
        }
    #endif
    return true;

}
Exemple #3
0
bool checkOpenGL(){

    QGLWidget *glWidget = new QGLWidget;

    QGLContext* glContext = (QGLContext *) glWidget->context();
    GLCHK( glContext->makeCurrent() );

    int glMajorVersion, glMinorVersion;

    glMajorVersion = glContext->format().majorVersion();
    glMinorVersion = glContext->format().minorVersion();

    qDebug() << "Running the " + QString(AWESOME_BUMP_VERSION);
    qDebug() << "Checking OpenGL version...";
    qDebug() << "Widget OpenGL:" << QString("%1.%2").arg(glMajorVersion).arg(glMinorVersion);
    qDebug() << "Context valid:" << glContext->isValid() ;
    qDebug() << "OpenGL information:" ;
    qDebug() << "VENDOR:"       << (const char*)glGetString(GL_VENDOR) ;
    qDebug() << "RENDERER:"     << (const char*)glGetString(GL_RENDERER) ;
    qDebug() << "VERSION:"      << (const char*)glGetString(GL_VERSION) ;
    qDebug() << "GLSL VERSION:" << (const char*)glGetString(GL_SHADING_LANGUAGE_VERSION) ;

    Display3DSettings::openGLVersion = GL_MAJOR + (GL_MINOR * 0.1);

    delete glWidget;

    qDebug() << QString("Version: %1.%2").arg(glMajorVersion).arg(glMinorVersion);

    // check openGL version
    if( glMajorVersion < GL_MAJOR || (glMajorVersion == GL_MAJOR && glMinorVersion < GL_MINOR))
    {

        qDebug() << QString("Error: This version of AwesomeBump does not support openGL versions lower than %1.%2 :(").arg(GL_MAJOR).arg(GL_MINOR) ;
           return false;
    }
    return true;

}
bool MozQGLWidgetWrapper::isRGBAContext()
{
    QGLContext* context = const_cast<QGLContext*>(QGLContext::currentContext());
    return context && context->format().alpha();
}