Skip to content
This repository has been archived by the owner on Feb 17, 2021. It is now read-only.

2D game graphics #3

Open
kdar opened this issue Aug 27, 2016 · 4 comments
Open

2D game graphics #3

kdar opened this issue Aug 27, 2016 · 4 comments

Comments

@kdar
Copy link

kdar commented Aug 27, 2016

I'm currently writing a gameboy emulator and I was debating on using Qt. Just in case you can save me time in my research, is it possible for qml-rust to render 2d graphics maybe using qt3d or opengl? I'm currently using glium and not sure if that can easily be tied into qml-rust.
Thank you!

@White-Oak
Copy link
Owner

White-Oak commented Aug 28, 2016

@kdar that's a hard question!
As a short answer: no, currently qml-rust does not provide what you are looking for. In the future -- maybe (maybe in a far future).

What you are looking for is essentialy this: https://blog.qt.io/blog/2015/05/11/integrating-custom-opengl-rendering-with-qt-quick-via-qquickframebufferobject/. In short, OpenGL context is binded to a certain area in the window, and everything is drawn there, while you can still use qml for other parts of the UI (second example in the linked article perfectly illustrates your use-case), However, although QQuickFramebufferObject is a part of QtQuick, it is not provided by these bindings. What we'd need is to have bindings/wrappers over QQuickFramebufferObject, QQuickFramebufferObject::Renderer, QOpenGLFramebufferObjectFormat (that's the tricky part, imo) and nearest classes. And I'm not sure if it's feasible to provide them (probably it would require a lot of work).

cc @filcuc , he is the author of C bindings that are base of these and a better expert on Qt.

@filcuc
Copy link

filcuc commented Aug 28, 2016

@kdar @White-Oak
Honestly the hard part to me is wrapping the QQuickItem. I'm not saying that it's not feasable but it would take some time (given that QQuickFramebufferObject inherits QQuickItem). Given that i would fill a new issue for wrapping QQuickItem after that we can talk about other parts.

@filcuc
Copy link

filcuc commented Aug 28, 2016

i filled this one filcuc/dotherside#44

@kdar
Copy link
Author

kdar commented Aug 28, 2016

Wondering if I could possibly use a qml Canvas, and use signal/slots to draw to it sending over the pixel data. I think I would need qml-rust to support lists for meta types. Not sure what kind of performance I would get from this.

[edit]
Nevermind, I did a test and this is pretty slow.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants