Important: Please read the Qt Code of Conduct -

QOpenGLWidget and specific functions version ?

  • Hey

    I'm trying to set up my openGL to use specific version & get functions from it... So

    //// Set format in constructor
        QSurfaceFormat format;
        format.setMajorVersion(4); //whatever version
        format.setMinorVersion(5); //
        makeCurrent(); /// Just to be sure...
        mFunctions = new QOpenGLFunctions_4_5_Core(); //// specify functions version ?
        mFunctions->initializeOpenGLFunctions(); /// crash ?
    FATAL: ASSERT: "QOpenGLFunctions::isInitialized(d_ptr)" in file c:\users\qt\work\qt\qtbase\include\qtgui\../../src/gui/opengl/qopenglfunctions.h, line 887
    (c:\users\qt\work\qt\qtbase\include\qtgui\../../src/gui/opengl/qopenglfunctions.h:887, (null))

    I wish to have the specific functions as member in order to pass it to my scene manager to get called from rather than inheriting QOpenGLFunctions_xx a number of times in different nodes...

    Initially I tried this but this seems to not be compatible(?)

        mFunctions = context()->functions();
        mFunctions = static_cast<QOpenGLFunctions_4_5_Core*>(context()->functions());

    What am I doing wrong here?

    I noticed that QOpenGLFunctions seems to not have some openGL calls, so I pass the specific version to all my nodes that needs access to it... unless ?

    I followed this topic but seem to not work?

Log in to reply