I'm currently trying to use Opencascade within a Qt Application with QML in WebAssembly, and i was wondering if it was possible to achieve this.
since i can't use the OpenGl_GraphicDriver->Init() method, giving me this error in the console output of Chrome :
exception thrown: TypeError: Cannot read property 'getContext' of undefined,TypeError: Cannot read property 'getContext' of undefined
Qt initialize the OpenGL Context, then i try with an QQuickItem, to integrate Opencascade on the beforeSynchronizing
The solution should reside in the SetWindow() of V3d_View and specifying the EGLContext as Aspect_RenderingContext, i saw a cast in the OCCT sources of Aspect_RenderingContext into EGLContext.
m_view->SetWindow (aWindow,(Aspect_RenderingContext) theEGLContext);
However i'm having trouble getting the EGLContext from the QtApplication. I've tried to get it in several ways, including this one :
EGLContext ctx = eglGetCurrentContext(); // == EGL_NO_CONTEXT
or trying to recover it using the QEGLNativeContext.
Is there a way i didn't think of, for using Qt with Opencascade or did someone already tried something similar ?
Thanks for your help,