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. QOpenGLWidget and specific functions version ?
QtWS25 Last Chance

QOpenGLWidget and specific functions version ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
qopenglqopenglfunction
1 Posts 1 Posters 425 Views
  • 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.
  • D Offline
    D Offline
    Dariusz
    wrote on 1 Jun 2019, 07:33 last edited by Dariusz 6 Jan 2019, 07:36
    #1

    Hey

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

    //// Set format in constructor
    myGl::myGl(){
        QSurfaceFormat format;
        format.setMajorVersion(4); //whatever version
        format.setMinorVersion(5); //
        format.setProfile(QSurfaceFormat::CoreProfile);
        QSurfaceFormat::setDefaultFormat(format);
    }
    myGl::initializeGL(){
        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();
    or
        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? https://stackoverflow.com/questions/28235640/using-latest-opengl-functions-across-classes-in-qt-5-4

    1 Reply Last reply
    0

    1/1

    1 Jun 2019, 07:33

    • Login

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