Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. OpenGL 4.4 Context

OpenGL 4.4 Context

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 1 Posters 1.3k 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.
  • JanWJ Offline
    JanWJ Offline
    JanW
    wrote on last edited by
    #1

    Hi,

    I'm trying to integrate my opengl renderer with a qml (windows desktop) application.
    My current setup is VS 2013 (with qt plugin) and Qt 5.6. Qt was installed using the maintenance tool. Before there was an option to choose between qt_opengl and qt_angle, for 5.6 i don't see that option anymore (maybe important info, i don't know). I have a AMD firepro M4100 FireGL which supports OpenGL up to 4.4 (according to OpenGL extension viewer)
    As a guide to integrate my renderer, i used the Squircle example. Everything works ok (The area i want in my qml app uses the renderer to render it's content), i only fail to get the correct context (version) for my renderer. The renderer expects OpenGL 4.x, but i only seem to be able to get an OpenGL ES (3.0) context.
    The things I tried (but failed):

    1. At the start of my app, i did:
    QSurfaceFormat format;
    format.setVersion(4, 4);
    format.setProfile(QSurfaceFormat::CoreProfile);
    format.setRenderableType(QSurfaceFormat::OpenGL);
    ...
    QSurfaceFormat::setDefaultFormat(format);
    
    1. My "MainWindow" is a QML Window element and I use a QQmlApplicationEngine to load the main file. After _engine->load(...) i did:
    QQuickWindow* w = (QQuickWindow*)_engine->rootObjects().first();
    	if(w)
    	{
    		format.setVersion(4, 4);
                    format.setProfile(QSurfaceFormat::CoreProfile);
                    format.setRenderableType(QSurfaceFormat::OpenGL);
                    ...
    		w->setFormat(format);
    
    		w->showMaximized();
    	}
    

    I get in debug an error that this version of the openglcontext cannot be created and i should install drivers which can create it, or put some dlls (d3dcompiler, libglesv and libegl) next to my application ((this last one doesn't make a difference).

    I also tried to get the OpenGL ES 3.3 context (by changing the numbers in the above function) Then when i use the window() method from the qquickitem that i positioned in my app, to get the opengl context, and when i ask in my renderer

    int minor = m_window->openglContext()->format().minorVersion();
    int major = m_window->openglContext()->format().majorVersion();
    bool es = m_window->openglContext()->isOpenGLES();
    

    i get OpenGLES 3.0. I'm clueless on how to tell the qml app to use OpenGL 4.4. Anybody has an idea?
    Regards,

    Jan

    1 Reply Last reply
    0
    • JanWJ Offline
      JanWJ Offline
      JanW
      wrote on last edited by
      #2

      When I downgrade to Qt 5.5, it works like expected (5.6 and 5.7 don't). Probably something to do with the default installation of Qt (using angle)?

      Jan

      1 Reply Last reply
      0
      • JanWJ Offline
        JanWJ Offline
        JanW
        wrote on last edited by
        #3

        As found here: http://doc.qt.io/qt-5/windows-requirements.html, if i set QT_OPENGL env, variable to desktop, it works!

        Jan

        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