-
Notifications
You must be signed in to change notification settings - Fork 20
[WIP] Initial update to egui 0.19 based on glium, glow and miniquad implementations #1
Conversation
Quickly looking at the issue on my way home, it seems that the font texture does get uploaded, but is deleted right after the first drawn frame, though DeleteTextures is never called... I'll be taking a more extensive look when I get home |
Some things to note that might be wrong:
|
Did you you find anything? :) |
Sorry for the delay, I've been a bit busy. At this line, you're binding egui textures as opengl textures, which use their own internal ID (starting at zero, so binding the first egui texture as opengl texture effectively unbinds the texture) match mesh.texture_id {
egui::TextureId::Managed(id) | egui::TextureId::User(id) => unsafe {
gl::BindTexture(gl::TEXTURE_2D, id as _)
},
} Mapping the IDs through a hashmap should be enough to resolve the issue. |
That was it! I had already created a hashmap with the correct ids.. Just didn't use it there correctly. Changed that line to: let it = self
.textures
.get(&mesh.texture_id)
.expect("Textures should have been added to hash map by now");
unsafe {
gl::BindTexture(
gl::TEXTURE_2D,
it.texture
.expect("Texture should have a valid OpenGL id now"),
);
} The assumptions in the The colors look off though |
Getting segfaults in some of my more complex UI apps.. Will try to isolate |
Is this ready now? |
I haven't tested very extensibly, but with the new safety checks I haven't gotten a segfault yet in my applications. I feel like the API from the User's point of view could probably be made simpler to use, but that should probably be a separate PR |
Thanks for making this! It seems to work well on my end. |
This is an initial update of egui to latest.
Quite a bit has changed but thanks to https://github.com/not-fl3/egui-miniquad/blob/master/src/painter.rs, https://github.com/emilk/egui/blob/master/crates/egui_glow/src/painter.rs, and https://github.com/emilk/egui/blob/master/crates/egui_glium/src/painter.rs I was able to come quite a bit.
Sadly, the egui texture seems to be black. Input seems to be working and the shadow behind the window display correctly.
Could you perhaps have a look at what could be wrong?