News for hackers. Stuff that matters.
Re:Egui – An immediate mode GUI written in Rust by eminence32 on Wednesday December 25, 2024 @10:37PM (#42512961)
Demo pages like this are fun, and technically impressive when compiled to a browser environment. But I suffer from a lack of imagination so these widget demos don't really help me envision what an egui-powered app can do or might look like.

Does anyone have any examples of fun things that use egui?

Re:Egui – An immediate mode GUI written in Rust by kelvinjps10 on Thursday December 26, 2024 @12:14AM (#42513280)
https://rerun.io the one that sponsors them and the author's app is one example
Re:Egui – An immediate mode GUI written in Rust by Animats on Wednesday December 25, 2024 @11:04PM (#42513029)
I use it in Sharpview. It's really for GUI programs, not web pages. It redraws everything on every frame, so it's most useful for 2D overlays on 3D game-type programs. For that, it's pretty good.

It's one pass. As a result, layouts which are ordered left to right and top to bottom work well, but ones which displace or resize items above or to the left don't work well. Egui tries to fix things up on the next frame, thereby getting the effect of a multipass layout system, but sometimes that results in mis-positioning and jitter on alternate frames. As long as you respect that limitation, good results can be obtained.

It needs some kind of dialog builder tool so that you don't have to write code for each dialog box. Someone was working on that about two years ago. Should find that project again. Meanwhile, lots of repetitive code to write.

Note that winit, wgpu, egui, and their friends all have to advance in version lockstep. All those projects routinely make breaking API changes, and when this happens, it takes a month or two before all the others catch up. Again, as long as you know this, it's not too bad. It would be nice to see some of those packages reach version 1.0.

Re:Egui – An immediate mode GUI written in Rust by nottorp on Thursday December 26, 2024 @06:20AM (#42514559)
> It redraws everything on every frame, so it's most useful for 2D overlays on 3D game-type programs.

So it's not a GUI. In my book a GUI only redraws when something changes, to save the user's power.

Re:Egui – An immediate mode GUI written in Rust by unclad5968 on Thursday December 26, 2024 @07:19AM (#42514772)
Well I guess your book needs a new edition. The type of gui you're referencing is typically referred to as a retained mode gui.
Re:Egui – An immediate mode GUI written in Rust by nottorp on Thursday December 26, 2024 @07:45AM (#42514865)
The point is, I don't want people to see "GUI library" and think it's okay to use this for your random phase-of-the moon application that has no good reason to redraw at 2400 fps or whatever the enthusiasts want these days.
Re:Egui – An immediate mode GUI written in Rust by do_not_redeem on Thursday December 26, 2024 @08:48AM (#42515127)
Just click on the link and you can easily see it only redraws when something on the screen changes. It's amazing how quickly people will dismiss something these days based on their own made up reasons.
Re:Egui – An immediate mode GUI written in Rust by nottorp on Thursday December 26, 2024 @08:56AM (#42515162)
The poster above me explained to me that it's not like that?
Re:Egui – An immediate mode GUI written in Rust by do_not_redeem on Thursday December 26, 2024 @09:11AM (#42515243)
Click the link, open the backend tab, and look where it says "Only running UI code when there are animations or input."

Then you won't have to waste cycles deciding which random internet comment from a stranger to believe

Re:Egui – An immediate mode GUI written in Rust by Animats on Thursday December 26, 2024 @04:18PM (#42517899)
If you set up "winit" so it only redraws on events, then you don't trigger an EGUI redraw very often. But if updates that affect the EGUI items are coming in from another source, like the network, you have to explicitly trigger a winit redraw cycle.

Don't know about web. Seems overkill if all you have are GUI widgets. Egui is most useful on top of something more graphical.

Scrolling text is a problem. EGUI isn't good at big text boxes with much offscreen text. That can be worked around.

Re:Egui – An immediate mode GUI written in Rust by fsloth on Thursday December 26, 2024 @06:43AM (#42514661)
If it’s used as a game ui, games typically render everything at 60fps - so the energy cost from ui layer would be neglible.

Afaik nobody is forcing to rerender the ui layer if nothing changes, though. Just render it to a texture and compose … no need to put everything to the same render target?

Re:Egui – An immediate mode GUI written in Rust by fulafel on Friday December 27, 2024 @01:24AM (#42520313)
It has this claim:

"egui is not a framework. egui is a library you call into, not an environment you program for."

So I suspect it gives you control on when to redraw and you might eg call it only when user input happens in your app or there's a some other state change that changes what is shown.

Re:Egui – An immediate mode GUI written in Rust by forrestthewoods on Wednesday December 25, 2024 @10:43PM (#42512973)
Re:Egui – An immediate mode GUI written in Rust by whytevuhuni on Thursday December 26, 2024 @01:54AM (#42513566)
It's really good for scrappy prototypes, e.g. here's a water simulation demo I was using to learn Rust [1]. See the "view" menu for more windows.

The code for that is all contained in a single file [2], and IMO it's pretty small for what it does. It was really easy to add/change things while developing, a new button is just a single new line.

[1] https://andreivasiliu.github.io/cybersub/

[2] https://github.com/andreivasiliu/cybersub/blob/master/src/ui...

Re:Egui – An immediate mode GUI written in Rust by konart on Thursday December 26, 2024 @02:06AM (#42513599)
Photo editors, CADs etc.

I mean... pretty much anything you have on desktop but in your browser.

Re:Egui – An immediate mode GUI written in Rust by adastra22 on Thursday December 26, 2024 @04:43AM (#42514173)
Or just in your desktop app. You don’t have to run in a browser.
Re:Egui – An immediate mode GUI written in Rust by konart on Thursday December 26, 2024 @05:11AM (#42514268)
I don't but I can. Which a very nice thing to have if you don't want to use Windows VM for a CAD, for example.
Re:Egui – An immediate mode GUI written in Rust by AgentK20 on Thursday December 26, 2024 @02:56AM (#42513760)
The Bevy Engine in Rust has an integration (https://docs.rs/bevy_egui/latest/bevy_egui/) that supports egui, for use in making UIs in games written against the Bevy Engine. Here's a webapp example of a 2d drawing showcase that uses egui as a UI provider: https://vladbat00.github.io/bevy_egui_web_showcase/index.htm...
Re:Egui – An immediate mode GUI written in Rust by liambigelow on Thursday December 26, 2024 @06:10AM (#42514518)
[https://truncate.town/](https://truncate.town/) is all egui (after the main menu)
Re:Egui – An immediate mode GUI written in Rust by mdaniel on Thursday December 26, 2024 @04:29PM (#42517964)
Words fail me how much I love that game

Words similarly fail me how much I loathe and detest its GUI (at least on mobile browsers, where I often play the game). As an example, one has to actually _close_ the dictionary popup if you fat finger a letter because the fucking backspace doesn't work, or rather seems to require an incomprehensible number of presses to start deleting letters

Re:Egui – An immediate mode GUI written in Rust by Broussebar on Thursday December 26, 2024 @06:43AM (#42514658)
I find it really practical to create a quick ui. For example i used to do glitch art with a friend that didn’t know how to use a cli, so i created a gui for him to use [0]. Egui is perfect for this use case, you create quickly lightweights softwares, than can be compiled to many different OS.

[0] https://glitchedfactory.com

Re:Egui – An immediate mode GUI written in Rust by j-krieger on Thursday December 26, 2024 @06:56AM (#42514703)
I use egui to draw the overlay UI for game hacks I write. It's easy to use.
Re:Egui – An immediate mode GUI written in Rust by the__alchemist on Thursday December 26, 2024 @07:42AM (#42514849)
Here's my plasmid editor, using EGUI: https://github.com/David-OConnor/plascad

I also use it for the GUI for 3D rendering computational chemistry and gravity sims.

I also use it for configuring embedded devices on PC, and/or viewing their telemetry. (e.g. for drones, drone parts etc)

Re:Egui – An immediate mode GUI written in Rust by Tycho87 on Thursday December 26, 2024 @05:08PM (#42518242)