-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
qnanopainter demos crash using Qt5.12's WebGL backend. #38
Comments
As corollary, the same crash could occur in hellowidget example but it would happen because widgets are not supported, and not because of the issue with initializing nanovg.
From the link at beginning of this page:
To clarify, the 'hellowidget' example is not part of this bug. All the other examples are. |
Hi Niels, So it is no wonder that nanvg init returns a nullptr. The docs says: Note: This function requires that the QGuiApplication instance is already created. Regards, |
To Build with Qt5.15 and wasm, one needs to explicitly force
Or you get error using the default build (which doesn't detect WASM -- the .pro and .pri files need the above change to make this work automatically.)
Note that wasm requires GLES, per https://wiki.qt.io/Qt_for_WebAssembly#General_Notes
|
WebAssembly uses OpenGL ES, so detect it in build config. Fixes issue #38.
Thanks! I pushed patch above according to your help which should fix this. |
Qt5.12LTS has the ability to run apps on the browser: https://blog.qt.io/blog/2018/11/23/qt-quick-webgl-release-512/
Unfortunately, QNanoPainter-based apps crash under the new WebGL backend.
In order to debug qnanopainter examples under Qtcreator 4.8.0, with the new webgl backend:
(0) Load qnanopainter.pro in qtcreator
(1) Click "Projects" mode -> "Build & Run" -> "Your Desktop platform" -> Run
a) Under "run configuration" select "gallery" then click Add->"Clone Selected"
b) Name the cloned run configuration, for example, "gallery-webgl"
c) Under "Command line arguments" for run configuration "gallery-webgl" enter
-platform webgl:port=8998
(2) Select run configuration "gallery-webgl" and click the "Start Debugging" button.
a) application will launch and wait for browser.
(3) in browser visit " http://localhost:8998 "
(4) The QtQuick component menus of app "gallery" will now be visible in the browser.
(5) Clicking any of the menus in the browser will crash the app once QNanoPainter is invoked. The other examples will crash immediately on startup (in the same code) as they init QNanoPainter right away.
The crash occurs at https://github.com/QUItCoding/qnanopainter/blob/master/libqnanopainter/qnanopainter.cpp#L157
Q_ASSERT_X(m_nvgContext, "QNanoPainter::QNanoPainter", "Could not init nanovg!");
Prior to the crash the following output is provided on stdout/stderr (note environment "QSG_RENDER_LOOP=threaded" and "QSG_INFO=1", running on Kubuntu 18.04LTS)
The text was updated successfully, but these errors were encountered: