What does HackerNews think of imgui?

Dear ImGui: Bloat-free Graphical User interface for C++ with minimal dependencies

Language: C++

The STB headers are mostly built like that: https://github.com/nothings/stb

Dear ImGui is a C++ example: https://github.com/ocornut/imgui

You could also add an optional 'convenience layer' over the lower-level flexible-but-inconvenient core library, as long as the core library can be built and used without the convenience layer.

In essence it's just a way to decouple the actually important library functionality from runtime environment details which might be better implemented outside the C and C++ stdlibs anyway.

It's already as simple as the stdlib IO functions not being asynchrononous while many operating systems provide more modern and performant asynchronous IO APIs. For a specific type of library (such as an image decoder) it's often better to delegate such details to the library user instead of either using the stdlib or having the library talk directly to OS APIs.

PS: this type of library design is actually also quite common in game development, because such libraries must be embeddable in game engine code bases which usually implement their own IO-, threading- and memory-management systems.

> Take ImGui (https://github.com/ocornut/imgui, an immediate mode GUI library) for example - the examples are much closer to TUI interfaces than a Swift UI app - the only difference between that an a terminal UI would be that the lines are thinner and that text has non-uniform spacing.

What I see there is a spatial interface with complex layout, z-axis and graphical elements. A bit hard to replicate on a normal terminal.

> Does that make ImGui a TUI?

TUI and GUI are not defined by the actual complexity of a real application, but the environment which gives them theoretical abilities. With a GUI, you can have pixel-perfect control over every element. With a TUI, you are normally limited to character-level of control. Of course can you also use pixels without a desktop, but you would still leave the terminal-environment and enter the framebuffer for this or something similar. Though, to be fair, at this point it indeed can become a bit fuzzy.

I don’t know if that comment was mainly regarding web-based game UI libraries, but it seems on many other platforms there are many stateless immediate mode UI libraries available. Many based on (or inspired by) Dear ImGui [0].

By the way, I tried to use an immediate mode game UI in the past (Lua-based, SUIT), but somehow I feel more comfortable working with object-based UIs. Perhaps years of object-oriented programming has damaged my brain a bit :)

I think in the past the object-oriented was seen as a big improvement regarding GUI dev, but I guess with regards to game dev, it can be problematic wrt performance.

———

[0]: https://github.com/ocornut/imgui

> I’ll probably migrate to using ImGui

> Immediate Mode GUI... cross platform, very flexible and fast

Link to ImGui: https://github.com/ocornut/imgui

True, some modules are under the GPL only. Here[0] is a very nice website showing an overview.

As for alternatives there really is not much to choose from. For small projects which are not reliant on the performance/native designs of Qt, Dear ImGui looks nice[1]. But it is very much tailored for a different Use Case.

Edit: I said that [0] is a nice website. But you only get a complete view of the situation if you cycle through all of the open source licenses. Too bad there is no "Open Source" option. Would hurt their sales I guess...

[0] https://www.qt.io/product/features

[1] https://github.com/ocornut/imgui

2nded.

Is there a macOs equivalent of the Windows Internals [0] books?

I recently came across ImGui [1] which uses C++. I assume that cross platform software from Adobe, Microsoft, etc have C++ at their core and would love to find more in the way of resources for C++ on mac. Anyone?

[0] https://www.amazon.com/Windows-Internals-Part-architecture-m...

[1] https://github.com/ocornut/imgui

https://github.com/ocornut/imgui

> Just copy paste the source code in your source tree

And/Or make a simple CMakeLists.txt like this:

  cmake_minimum_required(VERSION 3.22.0)
  project(mylib C)

  file(GLOB_RECURSE MYLIB_SOURCES
    ${PROJECT_SOURCE_DIR}/src/*.c
  )

  file(GLOB_RECURSE MYLIB_HEADERS
    ${PROJECT_SOURCE_DIR}/include/*.h
  )

  add_library(${PROJECT_NAME} STATIC ${MYLIB_HEADERS} ${MYLIB_SOURCES})

  target_include_directories(${PROJECT_NAME}
    PRIVATE "${PROJECT_SOURCE_DIR}/include"
  )
Arena allocators only work when everything has the same lifetime.

There are game-like UI libraries (https://github.com/ocornut/imgui) but to use them you have to write your program like you're a gamedev and Conway's Law usually fights that.

They are using imgui. It would be hard to find a game studio that doesn't.

https://github.com/ocornut/imgui

Looks like they are using IMGUI as dev tool: https://github.com/ocornut/imgui
It looks like imgui, a declarative UI library optimized to be rendered by the GPU : https://github.com/ocornut/imgui
I've been using a similar stack (C++ and WASM) to build some simple applications and I enjoy it very much. For the UI components, text rendering and layout I use Dear ImGui [0] as I am very familiar with it and it allows me to implement GUIs very fast. The biggest convenience is that you can run the same code both as a native application and as a web app. The biggest drawback is you usually get 100% CPU usage when there is an active animation in the WebGL canvas because you need to redraw everything (similar to the OP's example).

If you are interested, checkout my Github template repo [1] - it contains a few examples:

[0] https://github.com/ocornut/imgui

[1] https://github.com/ggerganov/ggweb

I have done lots of UI interfaces in different platforms. I have used Motif and X Windows, Win32, MFC, Gtk, Qt, Cocoa, simple Web interfaces, DirectX, OpenGL, Metal.

I love Dear Imgui: https://github.com/ocornut/imgui

It is the simplest thing in the world. If you are starting and are going to do 3D graphics anyway you don't need state(you just redraw the screen 60 times per second).

Anything else is extremely sophisticated. I also loved Qt, but the policies got a little cumbersome, and went native.

The big problem is that with state there is a lot of complexity involved that is dependent on a platform, and once you pick one it is hard to change.

The big advantage of 3d graphics and dear imgui or any other open source software is that it works anywhere and you are not as dependent on a single company.

Off topic -> but on topic of the original post. Do you know if https://github.com/ocornut/imgui is available for embedded? It might be too much for the very low end but it for a reasonably capable system it's better than web or some high powered UI like Qt.
> I loved the fact Qt had it's own standard library, I know some c++ purists won't like that and the qmake , but we need to understand how many platforms Qt targeted and that the col new C++ features were not there on all this platforms when Qt4 was created

Indeed so! Qt is living today with the fact that it was built and designed long before C++11 was really a thing (where C++11 is the baseline of modern C++ and I would argue that even C++17 should be considered the baseline). The design decisions of Qt are directly against modern C++ design. I think that's ultimately the core of the problem: that modern Qt is orthogonal, not complementary, to modern C++.

Range-for loop? Oops, accidentally detached and deep-copied into a temporary.

Move objects? Just, no.

unique_ptr? Nah, QScopedPointer. Also still not moveable. make_unique? Nah, reset(new...) and ignore the modern advice that you shouldn't use `new`

Qt still takes naked pointers and decides willy-nilly whether to take ownership. It still has examples everywhere for using naked new without even mentioning the context of a smart pointer. It has the concept of "you used new, but the parent actually owns it, unless the parent is null" which is just a time bomb for anyone new to the framework let alone the language.

No, there's no way I would recommend Qt to someone who isn't experienced. Since I wouldn't recommend it then it's no wonder to me why Qt isn't used so much. It has little to do with C++ and a lot more to do with the design decisions of Qt itself.

> IMO the reason Qt is not used as much is because it uses C++

Arguably. Also arguably is because Qt brings along a lot of unnecessary baggage. You mentioned using Qt requires using qmake (which definitely counts as arcane, if not archaic); cmake does a pretty good job of wrapping qmake but doesn't eliminate it. And all of that is because of Qt's non-standard magical signals & slots system which is really just a more error-prone semi-async system when compared to any other eventing system.

Using Qt efficiently strongly needs Qt Creator which isn't nearly as good as Visual Studio or VS Code and not as feature-rich as CLion or other intellij-based IDEs I've used -- but at least it performans way better than CLion or intellij trash.

Qt's license changing in 5.15 has also become a significant penalty to non-commercial use. This fact alone means there's no way I'd use Qt in a new project, even a commercial one.

Modern Qt developers also have to become javascript developers since Qt's UI is heavily driving towards QML. That's an unfortunate direction and also inhibits adoption of Qt IMO. Why write an application in C++ if you need to learn javascript anyway? There are better feature-rich javascript frameworks with better community adoption and better price points.

> what would you use today if you need to make an application for someone, something simple like some buttons, menus and it does a bit of work maybe with some files or the internet), the goal is to be fast and have very few bugs that you will have to support by fixing them

For GUI, Dear Imgui [0].

For network, Asio [1].

For files, plain standard streams. They're not fast but if your files are your bottleneck then I'd consider memory-mapped files.

[0]: https://github.com/ocornut/imgui

[1]: https://www.boost.org/doc/libs/1_77_0/doc/html/boost_asio/re...

> does that actually work in a proper terminal?

Yes - all of the examples in the linked repo run in the terminal and are also ported to the Web using Emscripten.

> Or is it only when you have a framebuffer available?

ImTui creates a framebuffer and renders the scene using ASCII characters into the framebuffer. To create the scene, you can use the entire API of Dear ImGui [0] - it has various options for creating windows, buttons, sliders, tables, checkboxes, colors, etc.

You now need to display this framebuffer somehow and also provide input from the keyboard and the mouse. ImTui provides an ncurses interface for this. It uses the ncurses API to render the characters in the terminal and also to grab input from the keyboard and the mouse.

Technically, ncurses is an overkill for this application, since ImTui only uses only a very small subset of the ncurses functions. But this was the easiest way to make it work.

ImTui can be extended with more interfaces. For example, I made a second one which I call "Emscripten" interface. It's purpose is to provide an API to easily export the framebuffer to the JS layer and to easily grab input back from the JS layer. This way, I can have a single application code that builds and runs both in the terminal and on the web.

[0] https://github.com/ocornut/imgui

I haven't looked at the usage pattern/implementation but the visuals are much nicer to the eyes than ImGui[1].

1: https://github.com/ocornut/imgui

> I think what it disregards is the amount of effort that it takes to get to a situation where you have an interactive real-time IDE for the purposes of drawing a tree.

I agree with your view, but one of the reasons for this is that there is still a lot to ask from the GUI frameworks in most languages (especially languages like C++ and Rust). However, I still believe that this can change.

Raph Levien is driving some pretty targeted work on pushing the state of GUI frameworks for Rust [0].

In C++ Dear ImGui is heavily used by the game development community [1]. My experience is that it is really fast to get a visualization for most projects going in very little time using this framework. See the gallery threads [2] for examples. This project also gets better every month.

[0]: https://raphlinus.github.io/rust/druid/2020/09/28/rust-2021....

[1]: https://github.com/ocornut/imgui

[2]: https://github.com/ocornut/imgui/issues/3793

As soon as I saw the screenshot, I instantly knew it was using Dear Imgui library [1] under the hood because of the familiar Imgui design cues. Dear Imgui is originally meant to be used in combination with game & graphics engines which support hardware acceleration. Thus, you get high framerates.

[1]: https://github.com/ocornut/imgui

Immediate mode GUIs seem to be some "fresh wind" to desktop GUI toolkits. Apparently they are heavily motivated by gaming and 3D focussed applications. I wonder whether they are also play a role in traditional desktops. The Gio kitchen sink example counts hundred lines of code (https://git.sr.ht/~eliasnaur/gio-example/tree/main/kitchen/k...), but for instance Dear ImGui examples (https://github.com/ocornut/imgui) are suprisingly short and require no headache with layouting containers. I could imagine that coding GUIs from the scratch is "fun again" with such a toolkit.

Has anybody carried out a larger traditional (i.e. non 3D focussed) application with an immediate mode GUI toolkit?

In my opinion, Orthodox C++ is the best and sanest C++ style nowadays, and it is not too difficult to learn.

https://gist.github.com/bkaradzic/2e39896bc7d8c34e042b

I would advise to read the code and tinker with Dear Imgui.

https://github.com/ocornut/imgui

Omar Cornut, who's a full time developer of dear imgui (https://github.com/ocornut/imgui), an immediate-mode UI library primarily used to create content-creation and debug/visualization tools.

He was using Patreon until the end of 2019, but has actually removed it since he already got so much corporate sponsors over the years (His platinum sponsors right now are Blizzard, Google, Nvidia, and Ubisoft... enough said.) And he wholeheartedly deserves all the money, since his UI library is just so monumentally important for anyone doing 3D graphics or gamedev.

I want to use Dear ImGui [1] in a C++ project. Sure I can copy the relevant files into my repo by hand, but my instinct says that is not the way. Git submodule seems like the right tool, but there's plenty of comments here advising not to use it. So if not git-submodule, then what is the procedure?

I just want to have the external repo as a subfolder in my own repo, updating that subfolder as updates become available.

[1] https://github.com/ocornut/imgui

Funny you mention this. I used to think the same way, and would constantly trip up managing state, until a co-worker who had worked in video games for two decades introduced me to the concept of the Immediate Mode GUI (IMGUI).

Casey Muratori first spoke about IMGUI back in 2005, but didn't actually implement it practically: https://www.youtube.com/watch?v=Z1qyvQsjK5Y

In around 2013, Omar Cornut wrote an incredibly high quality practical implementation of Muratori's concept called _Dear ImGui_: https://github.com/ocornut/imgui Using both Cornut's library and Muratori's mindset is incredibly powerful and liberating. Things that would require days of work and multiple files in Qt or Cocoa can be finished in four hours and a couple of hundred lines of IMGUI code. It also uses an order of magnitude less CPU/memory resources (which was an issue for us as we were rendering and displaying RAW video footage in real-time).

I find it amazing that this way of thinking hasn't completely dominated frontend programming by now. There is literally no downside to using the IMGUI concept - entire classes of bugs disappear, and your code is simultaneously smaller, easier to maintain and more logical in flow. It's also a shitload more fun to write (something I think that SWE culture overlooks too much) - you spend the majority of your time writing code that directly renders graphics to the screen, rather than fixing obscure bugs and dealing with the specifics of subclassing syntax.

ImGui [0]

Immediate-mode UIs are by far the easiest for quick and dirty work. Near trivial to get stuff up on screen you can interact with.

[0] https://github.com/ocornut/imgui

Would love to see immediate mode GUI toolkits like Dear ImGUI [1] in the implementations section.

[1] https://github.com/ocornut/imgui

One of the C++ project that have influence my programming the most recently, which is to move to a style that is something between C and C++, is Dear ImGUI: https://github.com/ocornut/imgui
There's a bit more subtlety than that. If I press down on a button, then move my mouse off of it, it will be deselected. This is normal and not too hard to implement your model. But, if I keep my mouse button held down, and drag back on, it will become re-highlighted, and it will go through. Note that only the button I originally clicked on will have this behavior. I just tested this right now in the ImGUI demo, so clearly per-widget state is tracked (or at least which "widget" is the one that has the mouse's active state): https://github.com/ocornut/imgui/#demo

If you think this is obscure, try implementing a slider widget any other way. You need a way to keep track of which slider you were dragging, even when the mouse cursor leaves to another.

The underlying "imgui" https://github.com/ocornut/imgui project:

From the github page - EDIT: Read the bindings / frameworks page too, https://github.com/ocornut/imgui/wiki/Bindings It's still c++ like.

"""

Officially maintained bindings (in repository):

Renderers: DirectX9, DirectX10, DirectX11, DirectX12, OpenGL (legacy), OpenGL3/ES/ES2 (modern), Vulkan, Metal.

Platforms: GLFW, SDL2, Win32, Glut, OSX.

Frameworks: Emscripten, Allegro5, Marmalade.

Third-party bindings (see Bindings page):

Languages: C, C# and: Beef, ChaiScript, D, Go, Haskell, Haxe/hxcpp, Java, JavaScript, Julia, Kotlin, Lua, Odin, Pascal, PureBasic, Python, Ruby, Rust, Swift...

Frameworks: AGS/Adventure Game Studio, Amethyst, bsf, Cinder, Cocos2d-x, Diligent Engine, Flexium, GML/Game Maker Studio2, Godot, GTK3+OpenGL3, Irrlicht Engine, LÖVE+LUA, Magnum, NanoRT, Nim Game Lib, Ogre, openFrameworks, OSG/OpenSceneGraph, Orx, Photoshop, px_render, Qt/QtDirect3D, SFML, Sokol, Unity, Unreal Engine 4, vtk, Win32 GDI, WxWidgets.

Note that C bindings (cimgui) are auto-generated, you can use its json/lua output to generate bindings for other languages.

"""

https://github.com/ocornut/imgui

""" Ongoing Dear ImGui development is financially supported by users and private sponsors, recently:

Platinum-chocolate sponsors

Blizzard, Google, Nvidia, Ubisoft """

Joke aside, google did a lot of good for imgui's development. I guess they all love side projects.

You can probably do the same things with both, but Flutter is more geared toward applications, where Dear ImGui is more about putting GUIs in places where the GUI is secondary, such as games, creative tools and other graphic-heavy apps.

Here's what Dear ImGui's readme [1] says:

> Dear ImGui is designed to enable fast iterations and to empower programmers to create content creation tools and visualization / debug tools (as opposed to UI for the average end-user). It favors simplicity and productivity toward this goal, and lacks certain features normally found in more high-level libraries.

> Dear ImGui is particularly suited to integration in games engine (for tooling), real-time 3D applications, fullscreen applications, embedded applications, or any applications on consoles platforms where operating system features are non-standard.

Basically: I wouldn't put Flutter inside a graphics heavy video game. I also wouldn't use ImGui for a social mobile app, or something like a business app that requires accessibility.

[1] https://github.com/ocornut/imgui

If you need a lightweight solution, Dear ImGui is a tiny cross platform GUI library: https://github.com/ocornut/imgui
Indeed, however I think we might replace Go with any programming language and your comment will still make sense. Currently, web-browsers are the best have-it-all platforms, and outside web-technologies there isn't many good alternatives. We landed in 2020 and we don't have any complete, native-like, cross-platform GUI toolkit (if we skip Qt and GTK).

In last years a lot projects have appeared, which were trying to compete in GUI toolkit market share. All of them had its scope limited, however they brought quite fresh look on declarative programming interface [0][1], superb 2D rendering pipeline [2][3], ease of embedding [4] and adaption to low-power devices [5] but none of them is "complete".

Personally, I am amazed of the implementation of rxi/lite [6], which is just an app (C with Lua) based on SDL2 library. It uses 2x less RAM than sublime on 1GB file, has lower latency, covers clipboard, keyboard, mouse, drag and drop, some context menus but does it feel native? No. Among many issues, it is easy to report an error with screen-reading software but it is quite common problem in all aforementioned.

Perhaps in future, something like LSP specification will see a daylight, which in outcome will helps us to provide universal, modular, limited to certain scope libraries that can be easily plugged in case of need. Maybe then we will came closer to "native" GUIs. In my experience, there are numerous developers who were trying hard to deliver "complete" GUI toolkit but have failed.

[0]: https://github.com/cycfi/elements

[1]: https://flutter.dev/

[2]: https://github.com/linebender/druid

[3]: https://github.com/servo/pathfinder

[4]: https://github.com/ocornut/imgui

[5]: https://github.com/Immediate-Mode-UI/Nuklear

[6]: https://github.com/rxi/lite

"all it takes to draw a widget on the screen" is not enough to create "an actual desktop toolkit".

If you need to draw a widget on the screen, there's Dear ImGui [1] that you can use from Go [2]

If you're looking for a desktop toolkit, there's a reason why things like Qt are multidecade endeavours.

[1] https://github.com/ocornut/imgui

[2] https://github.com/inkyblackness/imgui-go

I'm fine with that rn cuz the use case is a personal API for me making game tooling UI on a side project, still kind of experimental.

It's basically what the JS that gets generated from React JSX is like, and also like immediate mode UI APIs that get used for game tooling a lot: https://github.com/ocornut/imgui

What about these two? [1] https://github.com/ketoo/NoahGameFrame [2] https://github.com/ocornut/imgui , https://github.com/ocornut/imgui/issues/3075

Why almost all links are about years ago? Are not there any new technologies/methodologies for MMOGs that support 90fps, or even more? Something hybrid which supports both server and client sides? And mostly has developed for Unreal Engine or other well-known game engines?

I don't know if it meets all your criteria, but you might look at imgui, specifically cimgui which is just the autogenerated c-api wrapper for imgui.

https://github.com/ocornut/imgui https://github.com/cimgui/cimgui

Thanks! FYI, underneath ImTui, it's 99% the Dear ImGui library [0] - ImTui is basically just a textual output wrapper.

[0] https://github.com/ocornut/imgui

This is fun experiment I decided to try out - a simple C++ tool for creating immediate-mode textual user interfaces. It is basically an ncurses wrapper around Dear ImGui [0]. I thought it was interesting to share + probably with a bit of polishing it might even become useful :)

[0] https://github.com/ocornut/imgui

I like the ELM model for UI. The stateless/functional view approach is very similar to IMGUI [^1]. It makes things much less error prone with much less state management / hierarchy management to do than the React model.

[^1]: https://github.com/ocornut/imgui

Do I spy Dear Imgui used for one of the colormap control panels? Love using this for whipping together quick interfaces.

https://github.com/ocornut/imgui

As mentioned in comments elsewhere in the thread, there are several newer projects that are trying to fill that need for performant, cross-platform desktop app development.

* Revery (language: Reason) - https://www.outrunlabs.com/revery/

* WebView (language: C/C++/Golang) - https://github.com/zserge/webview

* Dear ImGui (bindings exist for many languages!) - https://github.com/ocornut/imgui

* Flutter (language: Dart) - https://flutter.dev/

None have really stood out yet to replace Electron, but the future seems bright.

An immediate mode GUI doesn't have to use immediate mode rendering. For example, the Dear ImGui library "outputs optimized vertex buffers that you can render anytime in your 3D-pipeline enabled application." [0]

[0] https://github.com/ocornut/imgui

I'd argue an ImGUI does't mix anything. It's just a library. If you want MVC it's up to you to implement your MVC and use your ImGUI as a library. Retained mode GUIs don't magically make your code MVC and ImGUIs don't magically make your code not MVC. That's entirely up to you.

Also ImGUIs are not multiple pass. That's in implementation detail. Unity's ImGUI is multi-pass. One of the most popular ImGUIs (Dear ImGUI) is single pass

https://github.com/ocornut/imgui

Here's an browser demo for dear imgui (https://github.com/ocornut/imgui) library:

https://pbrfrat.com/post/imgui_in_browser.html

For modal demo check "Popups & modal windows" -> "Modals" example.

This is how it looks in C++ code: https://github.com/ocornut/imgui/blob/master/imgui_demo.cpp#...

Try an immediate mode GUI. e.g. Dear Imgui[0].

[0] https://github.com/ocornut/imgui

Here's the code to draw a slider whose value is stored in a float:

    float f = 0.5f;  
    ImGui::SliderFloat("my float", &f, 0.0f, 1.0f);
edit: A lot of the problem with GUIs taking so much code is that they duplicate the application's state, requiring a large amount of effort to keep that state synced with their internal state. By instead binding directly against the user's state you can avoid much of the overhead.
I'm not a huge fan of these stateful GUI libraries. I've really been enjoying Dear Imgui as an alternative: https://github.com/ocornut/imgui There are Python bindings too: https://github.com/swistakm/pyimgui
Immediate Mode UIs, at least for "code driven UIs" (as opposed to artist-driven UIs):

https://caseymuratori.com/blog_0001

https://github.com/ocornut/imgui

Author here. The most recent change is that I started adding debugging UIs to the emulators, using the excellent Dear ImGui (https://github.com/ocornut/imgui).

The UI is in a separate version of the emulator, launched with the little "UI" button in the top right corner of the image panels (e.g. https://floooh.github.io/tiny8bit/kc85-ui.html?type=kc85_4).

The UI is updated once per 60Hz frame, so you only see a per-frame snapshot of the microchip pins which on its own isn't that useful yet except for a nice blinkenlight effect, but it will make a lot more sense once a step-debugging window is added. This will let you inspect the pins after each CPU instruction (still not as accurate as the emulation, which is running with machine-cycle granularity on Z80, and clock-cycle granularity on 6502 machines.

The emulators are written in C(99), with some platform-specific bits written in Objective-C and Javascript, and in C++ for the UI parts (since Dear ImGui is implemented in C++). Apart from the WebAssembly version, Win32, Linux, OSX and iOS is also supported, but you need to compile those yourself :)

It’s a library for making windows, buttons, etc (called widgets), for windows Linux and macOS.

If you’d like to make graphical applications though, I recommend immediate mode frameworks

https://youtu.be/Z1qyvQsjK5Y

https://github.com/ocornut/imgui

https://github.com/vurtun/nuklear

You should escalate in difficulty levels. GPU Programming is infinite and will always take more of your time than you plan. With escalation you could get positive feedback fast. 2D image filtering is extremely complex for a beginner.

Start drawing a graph of thousands of numbers with the CPU. Easy enough, but harder than it looks.

Accelerate the graph with the GPU so it has smooth animation, moving, zooming... Easy enough but way harder that it looks.

Take a sound sample, uncompress it and visualize in your graph system. Easy?

Take the sample and filter it with CUDA. Way easier filtering a 1D sample than 2D samples.

Play the filtered sound to "feel it".

Then you can filter 2D images if you want.

I recommend the graphic interface Dear Imgui: https://github.com/ocornut/imgui https://github.com/ocornut/imgui/issues/1902

Way faster development time than any other (states)interface with the disadvantage that it continuously draws in the screen consuming energy. Well worth it for rapid prototyping.

React isn't really anything like 90s UI libraries. It is, however, very much like the fairly recent native immediate-mode GUIs that have come out (https://github.com/ocornut/imgui, https://github.com/PistonDevelopers/conrod, etc).

The core feature of React is that your UI is a pure function of your application state. In (e.g.) the Win32 UI, you would receive events, and then need to manually transition your current UI state to the new UI state (hide this button, disable this input, etc).

For imgui (https://github.com/ocornut/imgui/) and uklear (https://github.com/vurtun/nuklear), docs are basically unnecessary. You just have to look at the examples/demos and copy pasta. Immediate mode GUIs are great.
I am surprised that ocornut/imgui [1] is not mentioned anywhere here. I used it for an admin interface in a past project. The author makes it a point to do work on the library based on donations (such as from Patreon, or PayPal). I suppose that's the main reason the project is alive and kicking today. OpenSource projects that are somehow financed - are in a much better situation than projects done on a spare time budget.

---

[1] https://github.com/ocornut/imgui

Everyone complaining about the state of UI development should give Dear Imgui (and similar immediate mode UIs) a whirl. It may not yet be the right solution for all types of UIs, but it makes creating UIs fun again and the productivity is astonishing.

https://github.com/ocornut/imgui

Checkout the screenshot threads https://github.com/ocornut/imgui/issues/1607

Especially desktop apps like this look interesting: https://github.com/ocornut/imgui/issues/1607#issuecomment-37...

And it's small enough to work well with WebAssembly: https://floooh.github.io/sokol-html5/wasm/imgui-emsc.html

Firstly, I am worried that OpenGL development seems to be stalled and it looks like its going into maintenance mode, where Vulkan is where all action happens. It is increasingly pushed as a replacement to OpenGL, implicitly or explicitly, and if it will be the only mainstream alternative, I am somewhat worried.

Secondly, I am worried that there are no mid-level 3D graphic toolkits. We have low-level (very very low-level) like Vulkan, or high-level stuff like Three.js and game engines (which are not what I need, as I write realtime scientific visualization code). What I want is something like imgui (https://github.com/ocornut/imgui), but for 3D. Simple, powerful, and bloat-free. However, I can't find anything like this.

Hopefully you'll make your gui mini-framework opensource.

Though I would think it would be similar to something like https://github.com/ocornut/imgui

One problem, you cant optimize at all with electron, you are stuck with shoving a complete web browser solution into your program to make a GUI.

You are stuck with a massive amount of dependencies (html/css parser, javascript VM...) to various massive projects for what, easy cross platform support? Sure cross platform GUI's have been a problem, but any developer can agree that dependency to this level within professional code is a great way to cause a massive amount of headache from required library changes, bugs and memory leaks that you have NO control over due to it not being your code, required security updates that require code refactoring for no fault of your own, etc.

People keep bringing this up because it is a bad solution to a large problem. Maybe the reason its being rehashed so much is because there is truth to what is being said.

I would try finding a graphics library such as opengl, and build a UI in the spirit of something like:

https://github.com/ocornut/imgui https://github.com/vurtun/nuklear

This argument looks like you and pcwalton are arguing about different definitions of "immediate mode API". I think both of you agree with each other on object-level propositions.

pcwalton seems to be presuming that part of the contract of an "immediate mode API" is like old-school ones it actually immediately draws to the frame buffer by the end of the call.

Whereas you are talking about modern "immediate mode API"s where the calls just add things to an internal data structure that is all drawn at once, avoiding unnecessary shader switches etc. IIRC this is how Conrod (Rust's imgui library) and https://github.com/ocornut/imgui work, although with varying levels of caching.

One point to make about retained mode GUIs is I remember reading an argument that immediate mode is great for visually simple UIs, such as those in video games, but isn't as good for larger scale graphical applications and custom widgets. For example when rendering a large text box, list or table you don't want to have to recalculate the layout every frame so you need some data structure that sticks around between frames specific to the widget type, so that's what retained mode APIs like Qt do for their widgets.

Sure you can do the calculations yourself for exactly which rows of a table are currently in view and render those and the scrollbar with an immediate mode API, but the promise of toolkits like Qt is that you don't have to write calculations and data structures for every table.

Dear Imgui: https://github.com/ocornut/imgui

Best thing since sliced bread if I may say so :)

"Dear ImGui" (https://github.com/ocornut/imgui) is an absolute delight to use. Can't recommend it highly enough. It's not suitable for every project, but when it does fit then I can't think of anything else I'd rather use.
IMHO it depends, C/C++ work very nicely with immediate mode UI frameworks, for example nuklear [1], imgui [2]. Though retained mode C/C++ UI frameworks are also quite popular, for example Qt, wxWidgets, GTK.

- [1] https://github.com/vurtun/nuklear

- [2] https://github.com/ocornut/imgui

An alternative (in C++, but with C API maintained):

https://github.com/ocornut/imgui

The author of Nuklear mentions it in the readme, but in case people don't spot it, there's another cool project in this family, imgui: https://github.com/ocornut/imgui