Live data from Hacker News

MicroUI – A tiny, portable, immediate-mode UI library written in ANSI C

github.com

61–70 of 91 posts

Re: MicroUI – A tiny, portable, immediate-mode UI library written in ANSI C

#61

This has been my goto for personal toy projects for a while now. Trivial to slot in to basically anything that can display text and takes mouse input. I will mention, however, it's kinda abandonware at this point. There is some bug with the draw call iterator which does a misaligned pointer access, which, if your environment is set up to catch that, can get annoying (Zig for example panics on it). There's a github is…

The whole thing's less than 2kLoCs. If it needs ongoing maintenance, something's gone wrong IMO.

I think it's reasonable to just patch it yourself if it doesn't work with your other tools (Zig). Though thank you for sharing the heads up.

Re: MicroUI – A tiny, portable, immediate-mode UI library written in ANSI C

#62
post #5

The first thing I look for in any UI library is accessibility support. Makes it trivial to filter out toy projects.

Windows XP has better accessibility than anything since, by virtue of staying entirely out of the way of accessibility tools. Time to downgrade!

Re: MicroUI – A tiny, portable, immediate-mode UI library written in ANSI C

#64
post #60

Earlier quoted context omitted.

No. As much as I would like it to be the case, that is most certainly a poor criteria to evaluate a UI library. Dear ImGui [0] is without a doubt the most prevalent immediate mode UI library. It does not have native accessibility features, but that hasn't stopped companies such as Intel, Meta, IKEA and Google from shipping products built upon it. It's also used in a ton of games. Calling Dear ImGui a toy project at t…

You've cherry picked a very specific example that is designed to run in 3d engines. For anything rendering at standard OS api level level (the vast majority libs), accessibility is fine as evaluation criteria.

> You've cherry picked a very specific example that is designed to run in 3d engines.

This post is about a minimal immediate mode library made by a game dev, most suitable for debug menus.

It's unreasonable to treat it as a platform for soapboxing about "the vast majority libs" that are unrelated.

Re: MicroUI – A tiny, portable, immediate-mode UI library written in ANSI C

#65

Earlier quoted context omitted.

No. As much as I would like it to be the case, that is most certainly a poor criteria to evaluate a UI library. Dear ImGui [0] is without a doubt the most prevalent immediate mode UI library. It does not have native accessibility features, but that hasn't stopped companies such as Intel, Meta, IKEA and Google from shipping products built upon it. It's also used in a ton of games. Calling Dear ImGui a toy project at t…

OK, if "toy project" isn't the right word, then perhaps, "unethical" or "exclusionary" would be better words to use. I judge software harshly that could be useful to folks with accessibility needs that don't try to address it (within bounds of their resources and capabilities, obviously lots of OSS just doesn't have the ability to deliver an accessible experience for tiny little throwaway apps). I definitely choose t…

> I guess a lot of folks consider games exclusively for folks without those accessibility needs, so maybe that's why something like Dear ImGui can live for years in thousands of projects without anyone complaining about accessibility. But, I wouldn't consider it for anything that isn't specifically about graphics and I don't think anyone else should either. (No one has to listen to me, but I think less of them.)

Immediate mode UIs are mostly for debug menus, not even gameplay/graphics. It doesn't need to be accessible to anyone except for the developer(s) choosing the library and making the game. (If the developer has different needs, obviously they can choose another library, unlike users who must live with the developer's choice.) The fourth sentence in the linked ImGUI repository explains this intention very clearly.

You can spend all this energy imagining malice and thinking less of others, but doing so does not add merit to your critique. Nor does it advance the cause of software accessibility.

Re: MicroUI – A tiny, portable, immediate-mode UI library written in ANSI C

#66
post #5

The first thing I look for in any UI library is accessibility support. Makes it trivial to filter out toy projects.

I agree, and the lack of empathy around this area is sad. If you're developing an app, it is better to fall into the pit of success by using a UI framework that already has accessibility baked in. Any project that uses Dear Imgui for end-user applications has already made a bad design choice. AccessKit ( https://accesskit.dev/ ) seems to be a positive step forward, with some UI frameworks implemented (including immed…

> Any project that uses Dear Imgui for end-user applications has already made a bad design choice.

Note that any project using Dear ImGui will presumably have read the README for it, the second paragraph of which starts:

> 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).

Re: MicroUI – A tiny, portable, immediate-mode UI library written in ANSI C

#67
post #23

Earlier quoted context omitted.

Being accessible to the intended users always matters. If you think it doesn't, that probably means it's currently accessible to those users (or that those who are it is inaccessible to have filtered themselves out, and are no longer users). For example - in your debug UI, colorblind-friendly colors don't matter, until you hire your twelfth member of the team, who struggles to tell red and green apart.

This library's default is greyscale anyway, so it's by default colorblind friendly.

Additionally the developer of this library is active in the indie game scene, so "twelfth member of the team" is hardly a relevant issue.

I find it so unfortunate how many of the criticisms raised here are mooted by simply glancing at the README.

There's an interesting conversation that could be had about the needs and limitations for debug UIs, and how to balance that with minimal code. (E.G. Would feeding this library's text-and-rectangles output into an accessible renderer be enough?) But blanket rejections and reflexive judgement aren't helpful.

Re: MicroUI – A tiny, portable, immediate-mode UI library written in ANSI C

#68

I wrote a little demo to run microui on top of the sokol headers here, it's really interesting in how minimal it is. WASM demo: https://floooh.github.io/sokol-html5/sgl-microui-sapp.html Source code: https://github.com/floooh/sokol-samples/blob/master/sapp/sgl... The renderer backend is just a bunch of C functions you need to provide: https://github.com/floooh/sokol-samples/blob/3f4185a8578cd2b... It's also interesti…

I made my own WASM demo @ https://microui-wasm.vercel.app/ and it's only 14.6 kB compressed!

Will share source code if someone is interested, but key bits:

- had a small JS glue layer using CanvasRenderingContext2D to render

- made a `wasm32-freestanding` build to lower the wasm bundle size, which meant shimming the bits of the libc microui uses

Re: MicroUI – A tiny, portable, immediate-mode UI library written in ANSI C

#69
post #68

I wrote a little demo to run microui on top of the sokol headers here, it's really interesting in how minimal it is. WASM demo: https://floooh.github.io/sokol-html5/sgl-microui-sapp.html Source code: https://github.com/floooh/sokol-samples/blob/master/sapp/sgl... The renderer backend is just a bunch of C functions you need to provide: https://github.com/floooh/sokol-samples/blob/3f4185a8578cd2b... It's also interesti…

I made my own WASM demo @ https://microui-wasm.vercel.app/ and it's only 14.6 kB compressed! Will share source code if someone is interested, but key bits: - had a small JS glue layer using CanvasRenderingContext2D to render - made a `wasm32-freestanding` build to lower the wasm bundle size, which meant shimming the bits of the libc microui uses

Your demo seems to constantly consume 100% CPU at all times.

Re: MicroUI – A tiny, portable, immediate-mode UI library written in ANSI C

#70
post #63

For a slightly larger, cross-platform, retained mode GUI written in C, there's libagar [0]. Different use case than MicroUI, but still a neat project. [0] https://libagar.org/

If that's your project, the Arabic text rendering is broken in this screenshot:

https://libagar.org/screenshots/agar171.png

Post reply on HN