Closed dezbracaty closed 1 month ago
Hi @dezbracaty , In general, yes, that's pretty much what CXX-Qt is meant for. You just add that crate as a dependency to your Cargo.toml and start creating QObjects with CXX-Qt that allow access to the functionality you want.
As bevy is pretty huge, has loads of functionality and acts more as a framework than a normal library it can be tricky to wrap in particular. What functionality exactly would you want to wrap from bevy? If you want to show the output of a bevy game in a Qt app, you may want to take a look at how we created a mini-browser for servo here: https://github.com/KDABLabs/cxx-qt-servo-webview There we embed the OpenGL context from servo into a QML application. Something similar may be possible with bevy.
Hi @dezbracaty , In general, yes, that's pretty much what CXX-Qt is meant for. You just add that crate as a dependency to your Cargo.toml and start creating QObjects with CXX-Qt that allow access to the functionality you want.
As bevy is pretty huge, has loads of functionality and acts more as a framework than a normal library it can be tricky to wrap in particular. What functionality exactly would you want to wrap from bevy? If you want to show the output of a bevy game in a Qt app, you may want to take a look at how we created a mini-browser for servo here: https://github.com/KDABLabs/cxx-qt-servo-webview There we embed the OpenGL context from servo into a QML application. Something similar may be possible with bevy.
Wow, thanks for you replying ~! It's very useful. I will learn it . Thank you again!
As title says, If I have a rust crate bevy, and I want to wrap this crate ,and then use it in Qt , can I use cxx-qt to archive it ? If anyone can give me any idea or any example or tutorial thanks a lot ~!