Glium vs glow. What is it? what's the difference? Like I'm 5

Hi,
I'm looking into making a gui software in rust. The only frameworks that seam acceptable (that is have the widets i need in terms of graphing, heatmaps, interactivity, etc..) are imgui-rs or egui. however, they both mention the fact that they are back end agnostic and that one can use glow or glium as a renderer. Looking at the examples, i don't really understand the difference. Nor what they are for.

So what are they, what's the difference, why would I choose one over the other.
Could someone explain is fi i were 5?

thanks

Ok so you already know imgui-rs and egui, and what they're for. You also know what when you use them, they "magically" put user interfaces in your browser window.

But what you might not know is how they accomplish that: they use a library called openGL (that is otherwise mostly used in games and CAD programs) to actually draw the user interfaces you specify. This is in contrast to frameworks such as Angular, Vue or React (AVR), which render to HTML rather than drawing to a browser canvas with openGL. The AVR way is more common and is less demanding of hardware (in that it mostly requires CPU performance, and a GPU only good enough to do the 2D drawing) but also limits performance to quite a low upper bound generally (at least relative to what your hardware might be capable of).
OpenGL makes higher performance possible in the browser in the same way it does that in games. The "only" difference there is that games call openGL natively while imgui-rs and egui use openGL in the browser.

The backend-agnostic acknowledgement is mainly a show of flexibility: you can just start using either glow or glium, and if you need something that isn't provided by your current backend, you can just switch.
The need for either of these seems to lie at least in part in openGL driver bugs which can make life miserable for you as a developer, since most often you can't "just fix" a driver bug yourself, either due to lack of knowledge or lack of access to source code.

Also note that glium has been deprecated.

2 Likes

Thanks for the info, now I get it.
I love your last statement. it actually answers a lot.

I'm still not sure which out of imgui-rs or egui to use. The former has more features, the latter looks more polished.

Yet when I see this (image below) I hae no clue which one to choose.
My goal is for a desktop app on windows. I have no need for browser support (wasm). Plus I don't want to write anything other than rust (so tauri, or godot, are out of the question i guess).

I'll continue reading the readmes, though it's hard to decide as I don't know the libraries which have quite the steap learning curve.

One way you could assess which one is more suitable is to look at any examples either project provides.

And in the extension of that, it might be worth the time and effort to write some minimal apps in each despite the learning curve.
What that will give you is a better view of how they compare, and thus which one might be more suitable for your use case. Unfortunately it's not something I can really comment on at this time as I haven't done too much with either.

that was the answer i was afraid of. anyway, I started with egui eframe. what i found quite annoying with these frameworks (not limited to rust, but in python or go as well) is that i get quite involved and far in the project, and once i'm quite into it, i need some feature which is not included and requires more knowledg and time that i have to implement, anyway, here i go.. thanks

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.