-
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
multiple quickwindow scenegraph couldn't render correct #80
Comments
@jcelerier |
@msinamsh I tested this today and was able to reproduce the issue when RHI is not used (so it worked with QNANO_USE_RHI). I think the issue is not about setting the OpenGL for multiple windows, but sharing the same QNanoPainter instance. Added a new QNANO_ENABLE_PAINTER_SHARING define with the new commit e46cfaf . When I disable QNANO_ENABLE_PAINTER_SHARING, QNanoPainter works for me from multiple windows. If someone has more time to debug this, why it happens, propose alternative fix with sharing enabled etc. please do 🙂 |
@QUItCoding oww thanks a lot sir you make my day. |
Disable QNANO_ENABLE_PAINTER_SHARING to not share the same QNanoPainter instance between QNanoQuickItemPainters. This may be required in some use cases if the sharing causes issues. See issue #80.
In Qt, if you want to share OpenQL objects (textures etc) across multiple QOpenGLContexts, then you have to enable the Qt::AA_ShareOpenGLContexts attribute early when your app starts up.
For the QNanoWidget path, because each QNanoWidget gets its own QOpenGLContext instance, but the QNanoPainter is a global singleton, the app must enable this attribute if they use more than one QNanoWidget. I'm not sure about the QNanoQuickItemPainter code paths, but maybe it is affected by the same issue? |
@cinderblocks
@jcelerier
@jarkkokoivikko-code-q
@NielsMayer
i designed an app using scenegraph for rendering some 2d on qtquick and qml. My goal is render some 2d content on main window and another 2d content on a seprate window. I load my app from c++ with this code :
`
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#ifndef QNANO_USE_RHI
QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL);
#endif
#endif
`
and
QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL);
is for set graphics api for using on scene graph and its ok.
like this photo:
Everything goes fine with just one window(main window) but when i open another seprate window to render second content on it using ApplicationWindow from qml texts on the main window get unreadable and content on the second window turn into mono color(just green) and the texts will get completely unreadable as you can see in below image
and i think its because i cant use setgraphicsapi for second window that i opened from qml with ApplicationWindow
.
and maybe its because i should render scenegraph with multithread according to this link:
https://doc.qt.io/qt-6/qtquick-visualcanvas-scenegraph.html#what-if-there-is-no-or-more-than-one-window-visible
but i dont know how can i
The text was updated successfully, but these errors were encountered: