Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for WebAssembly
  4. QT WebAssembly : get EGLContext from QApplication

QT WebAssembly : get EGLContext from QApplication

Scheduled Pinned Locked Moved Unsolved Qt for WebAssembly
1 Posts 1 Posters 459 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.
  • N Offline
    N Offline
    Numagrobidon
    wrote on last edited by Numagrobidon
    #1

    Hi.

    I'm currently developping a WebAssembly application with QML and i want to get the EGLContext from it.
    I've tried several ways to recover it :

    eglGetCurrentContext() 
    //Returns EGL_NO_CONTEXT
    
    QOpenGLContext* openglcontext = QOpenGLContext::currentContext();
    QEGLNativeContext nctx = qvariant_cast<QEGLNativeContext>(openglcontext->nativeHandle());
    EGLContext ctx = nctx.context();
    //Returns ctx == EGL_NO_CONTEXT
    

    I'm using QT 5.15.2 and tried both binaries and sources recompilated. I'm sure EGL and OpenGL ES 2.0 (i need this one) are activated.

    EGLDisplay display = eglGetDisplay (EGL_DEFAULT_DISPLAY);
    eglQueryString((EGLDisplay )display, EGL_VERSION);
    //1.4 Emscripten EGL
    eglQueryString((EGLDisplay )display, EGL_VENDOR);
    //Emscripten
    if(openglcontext->openGLModuleType()== QOpenGLContext::OpenGLModuleType::LibGLES) 
    //true
    

    I use a QQuickItem to be sure the context has been initialized with connect &QQuickWindow::beforeRendering().
    My version of emscripten is 1.39.8 (embedded) and i use Chrome to display the application.

    Thanks for your help,
    best regards

    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