BillyDM / egui-baseview

A baseview backend for the egui Rust GUI library
MIT License
22 stars 17 forks source link

[WIP] Update the dependencies to target the latest baseview and egui versions #4

Closed robbert-vdh closed 2 years ago

robbert-vdh commented 2 years ago

I've also fixed the remaining clippy lints in the process. Creating uninitialized values with a Vec<u8> + set_len() would technically be fine even if clippy doesn't like it, so let me know if you prefer the old would-be-UB-if-it-weren't-u8s version this slice cast.

robbert-vdh commented 2 years ago

Somehow the 'convert to draft' button is missing here, but I'm currently rewriting this to target a new version of baseview that includes the OpenGL context management. Otherwise it's impossible for baseview to know how the window should be created, since it needs to use a visual that corresponds to the framebuffer config that will be used to create the OpenGL context.

BillyDM commented 2 years ago

So has the fix to baseview been finalized yet? I've been waiting for that to finalize before I update my repos.

robbert-vdh commented 2 years ago

It is! This is the PR: https://github.com/RustAudio/baseview/pull/115. That's of course not been merged yet, so this PR currently targets my fork. Could you give this a quick cargo run --example simple_demo if you have the time? It should work perfectly fine with Mesa (I tested with llvmpipe), but more testing is always better. :smile:

BillyDM commented 2 years ago

Oh, by "finalized" I meant when it is merged into the main repo.

Also, I ran your fork and it works just fine.

robbert-vdh commented 2 years ago

Awesome! No, it has not been merged yet. I submitted the PR like half an hour ago, and it probably also needs to be tested on Windows and macOS first.

robbert-vdh commented 2 years ago

So, uh, this now targets yet another updated branch of baseview. Now keyboard modifiers while dragging widgets always work as expected in egui-baseview. Otherwise the modifier may be ignored when first clicking on the window, and the modifier state would get messed up when you drag outside of the window and then release the modifier.

BillyDM commented 2 years ago

Awesome! Let me know when these changes get finalized in the official baseview repo and I'll merge them.

robbert-vdh commented 2 years ago

Egui 0.17 was released, so I've updated this PR to match the new version. They completely changed how textures work (see their changelog). I've made the required changes in the painter, but I haven't tested it much further than just running the examples so I might have missed something.

BillyDM commented 2 years ago

Closed because of https://github.com/BillyDM/egui-baseview/commit/9abe392d4c65446eb1c36be6d427ae977eddb072

robbert-vdh commented 2 years ago

9abe392d4c65446eb1c36be6d427ae977eddb072 still uses raw-gl-context and may thus crash on Linux since the window is not created correctly. Whether or not it crashes as is depends on the settings and drivers used. It crashes with NVIDIA's drivers at the default settings, and if you change the OpenGL settings a bit then it also crashes with Mesa (it just happens to work with the default settings).