Skip to content

pixels + egui drawing area #275

Answered by parasyte
vilhub asked this question in Q&A
May 28, 2022 · 3 comments · 9 replies
Discussion options

You must be logged in to vote

Hey! I have been wanting to update the egui example to address this. Right now I'm blocked waiting on egui-wgpu not supporting wgpu textures in 0.18. (It's available in the main branch, but currently unreleased.) You can still use the older egui_wgpu_backend like the example, though.

You can create an egui image with egui_texture_from_wgpu_texture(), and the wgpu texture can be retrieved with Pixels::texture(). You'll have to create a texture view for it. Once you have the egui TextureId, just call ui.image() and it will draw just like any egui widget.

You don't need to call ScalingRenderer::render if you are doing this. And because the scaling renderer is not used, you won't get any of t…

Replies: 3 comments 9 replies

Comment options

You must be logged in to vote
4 replies
@vilhub
Comment options

@parasyte
Comment options

@vilhub
Comment options

@parasyte
Comment options

Answer selected by vilhub
Comment options

You must be logged in to vote
3 replies
@parasyte
Comment options

@ParthPant
Comment options

@parasyte
Comment options

Comment options

You must be logged in to vote
2 replies
@dbalsom
Comment options

@anacrolix
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants