Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. QOpenGLContext fail to run versionFunctions<QOpenGLFunctions_3_3_Core>()
Forum Updated to NodeBB v4.3 + New Features

QOpenGLContext fail to run versionFunctions<QOpenGLFunctions_3_3_Core>()

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
7 Posts 2 Posters 1.0k Views 2 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.
  • H Offline
    H Offline
    Happy Bo
    wrote on last edited by Happy Bo
    #1

    I'm trying to port my code from windows to MacOS. After a few corrections , the code did compile. But what puzzles me now is that, when I run:
    QOpenGLContext::currentContext()->versionFunctions<QOpenGLFunctions_3_3_Core>()->glCreateShader...
    it crashes because QOpenGLContext::currentContext()->versionFunctions<QOpenGLFunctions_3_3_Core>() is nullptr,
    which isn't any like description in Qt-official cite https://doc.qt.io/qt-5/qopenglcontext.html#versionFunctions-1 at all. It tells me it should work.
    Here is my environment :
    MacOS big sur public beta 6
    Qt 5.15.1 through homebrew
    Macbook pro 13 retina 2018 with touchbar.
    The problem frustrates me. Is it because of macOS big sur. Can anyone get non-null pointer from macOS Catalina?
    Appreciate your help!

    1 Reply Last reply
    0
    • H Offline
      H Offline
      Happy Bo
      wrote on last edited by Happy Bo
      #2

      It's not my code problem, I've tested another worked example code using versionFunctions<QOpenGLFunctions_3_3_Core>(), it also crashes as EXC_BAD_ACCESS (SIGSEGV).
      So I suppose it's big sur's problem, can anyone test this function using the same code in Catalina and big sur?
      By the way, big sur always crashes on some specific applications. If versionFunctions fails on big sur and success in Catalina. We may feedback Apple this OpenGL issue

      BTW,
      QSurfaceFormat format;
      format.setVersion(3,3);
      format.setProfile(QSurfaceFormat::CoreProfile);
      QOpenGLContext::currentContext()->setFormat(format);
      will fail.
      QOpenGLContext::currentContext()->format().version is 2 1 which is astonishing

      1 Reply Last reply
      0
      • H Offline
        H Offline
        Happy Bo
        wrote on last edited by Happy Bo
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • H Offline
          H Offline
          Happy Bo
          wrote on last edited by
          #4
          This post is deleted!
          1 Reply Last reply
          0
          • H Offline
            H Offline
            Happy Bo
            wrote on last edited by
            #5

            I still couldn't get the rignt answer. Does qopngl has some certain issue with Big Sur. Even if I new an QOpenGLFunctions_3_3_Core, when it uses glcreateshader, the program still crashes with EXC_BAD_ACCESS

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Hi and welcome to devnet,

              macOS has a long reputation of being behind in terms of implementing the OpenGL standards.

              Big Sure being still unreleased, you may have unexpected issues. You might want to try the new Qt RHI.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              H 1 Reply Last reply
              0
              • SGaistS SGaist

                Hi and welcome to devnet,

                macOS has a long reputation of being behind in terms of implementing the OpenGL standards.

                Big Sure being still unreleased, you may have unexpected issues. You might want to try the new Qt RHI.

                H Offline
                H Offline
                Happy Bo
                wrote on last edited by Happy Bo
                #7

                @SGaist I think so. BTW, so many programs crash in big sur. Big sur sounds like bug sur.
                And One of Qt cmake component will fail on big sur. Because the directories '/System/Library/Frameworks/OpenGL.framework/Header' '/System/Library/Frameworks/AGL.framework/Header'both disappear in big sur, meaning that
                Qt cmake component couldn't find gl.h in both non-existed directories. I manually change it to '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Headers/'
                '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/AGL.framework/Headers/', now at least it appears to work, of course /Library/Developer/CommandLineTools is my xcode-select path.

                1 Reply Last reply
                0

                • Login

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