Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [solved] Select an OpenGL 4 context on Mac OSX Maverick
Forum Updated to NodeBB v4.3 + New Features

[solved] Select an OpenGL 4 context on Mac OSX Maverick

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 2.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Thoenu
    wrote on 22 Jan 2014, 09:31 last edited by
    #1

    Hi all,

    since some weeks I have troubles to select an OpenGL 4 context on Mac OSX 10.9 with QT when porting a cross plattform application. The format is set in the constructor of the main Window as shown in the following source:

    @QGLFormat glFormat;
    glFormat.setProfile( QGLFormat::CoreProfile );
    glFormat.setVersion( 4, 1 );

    QGLFormat::setDefaultFormat(glFormat);
    glWidget = new GLWidget(_pathToEarthFile,glFormat);

    QGLContext* glContext = (QGLContext *) glWidget->context();
    glContext->makeCurrent();
    this->setCentralWidget(glWidget);@

    Later on, I do the version output the following:

    @std::cout << "Widget OpenGl: " << glContext->format().majorVersion() << "." << glContext->format().minorVersion() << std::endl;
    std::cout << "Context valid: " << glContext->isValid() << std::endl;
    std::cout << "Really used OpenGl: " << glContext->format().majorVersion() << "." << glContext->format().minorVersion() << std::endl;
    std::cout << "OpenGl information: " << std::endl;
    std::cout << "VENDOR: " << (const char*)glGetString(GL_VENDOR) << std::endl;
    std::cout << "RENDERDER: " << (const char*)glGetString(GL_RENDERER) << std::endl;
    std::cout << "VERSION: " << (const char*)glGetString(GL_VERSION) << std::endl;
    std::cout << "GLSL VERSION: " << (const char*)glGetString(GL_SHADING_LANGUAGE_VERSION) << std::endl;

    qDebug() << "OpenGLVersionFlags(): " << QGLFormat::OpenGLVersionFlags();

    if((QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_3_2) == 0)
    {
    std::cout << "GL 3.2 Not supported" << std::endl;
    }@

    and I get the following output:

    @Widget OpenGl: 1.0
    Context valid: 1
    Really used OpenGl: 1.0
    OpenGl information:
    VENDOR: ATI Technologies Inc.
    RENDERDER: ATI Radeon HD 5770 OpenGL Engine
    VERSION: 2.1 ATI-1.14.21
    GLSL VERSION: 1.20
    OpenGLVersionFlags(): QFlags()
    GL 3.2 Not supported @

    What I know:

    • My mac and the graphics card support 4.1, because the OpenGL Extension Viewer shows the 4.1. core profile.
    • It does not depend what version I use in glFormat.setVersion, the output is always 1.0 for the qt context.
    • sourcecode compiles with OpenGL 4.1 calls, which means, that the right OpenGL Framework is available while compilation (I included the OpenGL.framework in Xcode 5.01).
    • shaders do not compile with version 410 or something else higher than 120.

    Before christmas I tracked this down to the fact, that there was a wrong header included and that there is a fix in QT 5.2 beta. From then on I used the QT 5.2 build.

    Has anyone experienced the same issues or did anyone got a similar example running without objective-c and without using another windowing system? I also thought, that it must be possible to reset the GL_VERSION in OpenGL anyhow, but this depends on the windowing system, doesn't it?

    Cheers and thanks for the support!

    1 Reply Last reply
    0
    • T Offline
      T Offline
      Thoenu
      wrote on 22 Jan 2014, 15:26 last edited by
      #2

      Hi all,

      this is solved. Did not find the valid QT 5.2. packages in cmake, but it is working now.

      cheers

      1 Reply Last reply
      0

      1/2

      22 Jan 2014, 09:31

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved