How to render a Dioxus UI in a texture? #4362
-
I'm currently exploring ways to integrate Bevy with Dioxus. I’ve implemented an example that renders a Bevy scene to a texture, then displays that texture within a Dioxus UI using the native backend. You can see the implementation here: #4359. Now, I’m looking to do the reverse: render a Dioxus UI into a texture that can be displayed in a Bevy app. What would be the best approach to achieve this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
@jerome-caucat I've put up a draft pull request (#4365) that sketches out how to do this. It doesn't attempt actual Bevy integration. Some notes:
Dioxus Native isn't really set up for this yet (just hasn't been something we've really worked on). So there's definitely room for improvement. |
Beta Was this translation helpful? Give feedback.
-
I implemented rendering web pages using blitz into a Bevy texture here https://github.com/rectalogic/bevy_blitz |
Beta Was this translation helpful? Give feedback.
@jerome-caucat I've put up a draft pull request (#4365) that sketches out how to do this. It doesn't attempt actual Bevy integration. Some notes:
Device
andQueue
from Bevy in this scenario (so you wouldn't need theWGPUContext
). I am also assuming that you would do texture management.DioxusDocument
andVelloRenderer
in the ECS somewhere.