Live data from Hacker News

Raygui – A simple and easy-to-use immediate-mode GUI library

github.com

41–50 of 117 posts

Re: Raygui – A simple and easy-to-use immediate-mode GUI library

#41

There has been a recent explosion of immediate-mode GUIs recently, but I'm skeptical that an immediate-mode solution can cover our GUI needs now and into the future. High refresh rate screens are a reality so you only have 3-6ms to render each frame, as well as high resolution screens at 4k-8k. That's a lot of pixels to push with a CPU on every frame. As another comment points out we also need accessibility. I would…

All these pixels have to be pushed every frame even with classic GUI. The only difference is that it is usually done by the operating system.

Re: Raygui – A simple and easy-to-use immediate-mode GUI library

#42

Before you start picking up a library like this, keep in mind that no immediate-mode GUI library I'm aware of (including this one from what I can see in the source code) has support for assistive technologies such as screen readers. To them the whole UI is one big black box, so your program is completely useless to anyone with a wide range of disabilities.

The immediate mode Gio (gioui.org) toolkit has support for accessibility (on Android for now), IME and, recently, RTL text layout.

Disclaimer: I'm the author.

Re: Raygui – A simple and easy-to-use immediate-mode GUI library

#43

Would it be possible to define the GUI with XML, Unity just added this officially and it makes life much better. Then you do something like rootGUI.Query("elementID").RegisterCallback( e => otherFunc(e));

This is almost by definition incompatible with the immediate mode paradigm and UXML is for UI Toolkit, which is retained-mode.

Re: Raygui – A simple and easy-to-use immediate-mode GUI library

#44

Before you start picking up a library like this, keep in mind that no immediate-mode GUI library I'm aware of (including this one from what I can see in the source code) has support for assistive technologies such as screen readers. To them the whole UI is one big black box, so your program is completely useless to anyone with a wide range of disabilities.

The immediate mode Gio (gioui.org) toolkit has support for accessibility (on Android for now), IME and, recently, RTL text layout. Disclaimer: I'm the author.

That’s great, thanks for the letting me know!

Re: Raygui – A simple and easy-to-use immediate-mode GUI library

#45

There has been a recent explosion of immediate-mode GUIs recently, but I'm skeptical that an immediate-mode solution can cover our GUI needs now and into the future. High refresh rate screens are a reality so you only have 3-6ms to render each frame, as well as high resolution screens at 4k-8k. That's a lot of pixels to push with a CPU on every frame. As another comment points out we also need accessibility. I would…

With intelligent frame pacing you can sacrifice, say, a frame of input latency to sustain high frame rates. See https://raphlinus.github.io/ui/graphics/gpu/2021/10/22/swapc....

> Are immediate-mode GUIs up to the task? What is driving their authors to pursue this design? Why aren't they choosing a declarative design

Immediate mode UIs make managing state much easier, and avoids callbacks for event processing. That alone is worth it in my opinion.

Re: Raygui – A simple and easy-to-use immediate-mode GUI library

#46

I have seen quite often 'immediate mode gui' on HN and elsewhere these days,I rarely do GUI myself, where are these im-gui's use cases? gaming only? or some embedded boards with limited resources can benefit to draw some pixels on a small LCD for a simple GUI(even that people are more likely use some light-weight x11 like libraries instead of im-gui library)? Other than game-development why is im-gui better than thos…

Immediate mode guis let you structure your code differently than traditional libraries. (gtk, etc.)

It’s can be such a fast and light way to work. Get this thing done. And move on to the next thing.

To me it’s just a valuable addition to our toolbox and our quest to use the right tool for the right job.

Re: Raygui – A simple and easy-to-use immediate-mode GUI library

#47

Does it support RTL languages? My main problem with DearImgui is lack of RTL language support. I think one of the biggest factors which deter people from using immediate mode GUI is lack of support for many languages.

FWIW, Gio (gioui.org) recently added support for RTL languages and complex scripts. So there's no fundamental reason immediate mode UIs can't have the nice features you're used to from retained mode UIs.

Re: Raygui – A simple and easy-to-use immediate-mode GUI library

#48

There has been a recent explosion of immediate-mode GUIs recently, but I'm skeptical that an immediate-mode solution can cover our GUI needs now and into the future. High refresh rate screens are a reality so you only have 3-6ms to render each frame, as well as high resolution screens at 4k-8k. That's a lot of pixels to push with a CPU on every frame. As another comment points out we also need accessibility. I would…

All these pixels have to be pushed every frame even with classic GUI. The only difference is that it is usually done by the operating system.

The advantage of a declarative design is that it can be accelerated by the GPU which has a much better scaling computational architecture to serve this need.

Re: Raygui – A simple and easy-to-use immediate-mode GUI library

#49

There has been a recent explosion of immediate-mode GUIs recently, but I'm skeptical that an immediate-mode solution can cover our GUI needs now and into the future. High refresh rate screens are a reality so you only have 3-6ms to render each frame, as well as high resolution screens at 4k-8k. That's a lot of pixels to push with a CPU on every frame. As another comment points out we also need accessibility. I would…

I don't get your point here. What's the problem with high refresh rates? Games deal with it no problem, and they do way more complicated stuff than a UI with a bunch of buttons and text.

> Are immediate-mode GUIs up to the task?

Yes, there's no reason why imgui's can't do any of that.

> What is driving their authors to pursue this design?

To name a few: Ridiculous bloat and complicated development with things like Qt. No real GUI framework provided by Microsoft apart of their 4-5 half-abandoned offerings.

Also imgui is way simpler to wrap your head around. It's just straight up function calls with no complicated abstractions.

> Why aren't they choosing a declarative design?

Why should it be declarative though? imgui code looks fairly declarative when you read it and it's easy to understand what UI events cause changes

Re: Raygui – A simple and easy-to-use immediate-mode GUI library

#50

Earlier quoted context omitted.

All these pixels have to be pushed every frame even with classic GUI. The only difference is that it is usually done by the operating system.

The advantage of a declarative design is that it can be accelerated by the GPU which has a much better scaling computational architecture to serve this need.

Can you give more details on how this GPU acceleration works?
Post reply on HN