Skip to content

Background loading of changing images #5200

Closed Answered by lucasmerlin
Rusty-Cube asked this question in Q&A
Discussion options

You must be logged in to vote

I'm using wgpu where it's relatively easy to upload images from another thread, so if you don't rely on opengl in some other way you could try switching to wgpu (with eframe it's as simple as turning off default features and turning on the wgpu feature).
You can then use Renderer::register_native_texture to register the texture with egui.
Or you could write a custom texture loader that basically does the same thing (which is what I'm doing).

I plan on open sourcing my texture loader (which is also much more efficient at loading textures in wasm, relying on the browser to decode them) at some point but I haven't gotten to that yet.

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Rusty-Cube
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants