-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace Glium #93
Comments
It has good cross-platform support (notably including mobile and web). Perhaps if its web backend is sufficient, From an |
I haven't looked at Sadly it doesn't seem to have a sRGBA/gamma aware texture format: https://docs.rs/miniquad/0.2.55/miniquad/graphics/enum.TextureFormat.html. This would mean colors will always be a bit off (like they are in |
Based on the reading I've done, I think gfx-hal or wgpu would give you the best portability/performance in the long run. No idea when it comes to compile times. It would be awesome if there was a really fast (but maybe unsafe) backend that could be used for prototyping an app, then you can switch to a slower backend for production builds. I would guess a minimal OpenGL binding library would be the fastest you can compile in Rust. |
Oops, accidentally closed |
One disadvantage of miniquad: It does not yet support IME, which is very unfriendly to non-English users. Winit+gfx-hal/wgpu-rs may be the best solution at this stage. |
I did my own backend with gl_rs (tho it uses some abstraction I have over opengl, so unsafes are a bit more limited). One cool crate I recently found out about is https://github.com/grovesNL/glow so maybe this is also an option if you're looking to keep it available on as many platforms as possible. |
Can you elaborate if this means your planning on removing support for glium all together? I'm currently writing a project using glium and imgui-rs, and was hoping to switch to egui at some point, but reading this thread has me confused about whether or not that will be possible. To be clear, I'm just hoping for clarification here. Thanks! |
I think |
I can vouch for |
If you switch glium to wgpu backend will need support initialize by vulkan like way |
I also think that |
An alternative to glow and glium that I recently tried out that is very nice is |
Luminance is very nice, but currently it supports OpenGL >3. |
Good point. Then we could port the Luminance GL backend to use Glow. 😏 |
Because I wanted to support Safari on iOS for my game, I ended up making a It also targets both web and desktop without requring separate backends, so instead of having to have separate GL and WebGL backends of egui we could just have one: https://github.com/katharostech/luminance-glow Might be a reasonable direction, for |
@n2 This is misleading. The winit + gfx-hal/wgpu-rs stack does not support IME either. In fact, close to none of the Rust ecosystem supports IME, because the issue is upstream in |
@lunabunn Yes, you are right. Winit dos not support all IME functions, but what I mean is that by using winit, even if there is no Composition event, one can at least use IME to input non-English characters (such as Chinese characters in my case) . For miniquad, there is no way to do this. |
I'm in the process of making a fork that replaces
Other than that, it seems to work fine: I plan to fix all remaining problems in the coming days, just putting it out there that I'm working on it, and I can polish it up if there is an interest in merging it once all the ugly bits have been ironed out. It's at AlexApps99/egui, feel free to give feedback but keep in mind it's still rough around the edges. Edit: It's worth noting the new code is not very well organized yet, I plan to reorganize it soon and I expect that there should be an increase in performance due to less state changes. |
Oh, very interesting @AlexApps99 ! First piece of feedback is that we likely want it as a separate crate
|
I'll be sure to do that, but since Git doesn't make very good diffs when files are moved, I will temporarily overwrite |
For the texture leaks: would it be better if:
Also, do you think it would be worth storing the old OpenGL state and restoring it once painting is complete? It would probably make it take a bit longer to draw but would lead to less bugs when users integrate egui into their code. No idea if other IMGUIs do this, like Dear Imgui |
I think the first options sounds good, as For saving state: I'd vote no (at least initially), but document what state is lost. |
coming from #735 , about using wgpu as the official backend, I just wanted to mention that wgpu transparency support is not yet done. gfx-rs/wgpu#687 . :( |
That's a shame, but it doesn't sound like a deal-breaker, when web doesn't support it, and most integrations will not need it. |
I agree about transparency not being a big problem. The current glium window transparency is not great either (at least on my mac) due to egui using a different blendmode (premul alpha). I believe most important things when picking a native rendering for
(Am I missing something?) |
Glium is a convenient choice, but is a rather big dependency which compiles slowly, and uses
build.rs
. It is also no longer actively maintained.The ideal choice for compiling Egui natively would be something simple that compiles quickly. I'm not sure there is such an alternative though.
One alternative worth investigating is pure glutin (which Glium depend on). It is a bit lower level compared to Glium, and requires use of
unsafe
, but it looks easy enough to use: https://gist.github.com/matthewjberger/9da00592b472b50ec1e6b3238719264bThe text was updated successfully, but these errors were encountered: