Earlier quoted context omitted.
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.
MicroUI – A tiny, portable, immediate-mode UI library written in ANSI C
71–80 of 91 posts
Re: MicroUI – A tiny, portable, immediate-mode UI library written in ANSI C
#72For 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
Re: MicroUI – A tiny, portable, immediate-mode UI library written in ANSI C
#73This 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…
> it's kinda abandonware at this point That's sad. I'm a fan of rxi's work, including this one.
Re: MicroUI – A tiny, portable, immediate-mode UI library written in ANSI C
#74I 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…
Re: MicroUI – A tiny, portable, immediate-mode UI library written in ANSI C
#75Earlier quoted context omitted.
Your demo seems to constantly consume 100% CPU at all times.
Ooh interesting. What is your machine and browser? On chrome with my m1 macbook it takes less than 1ms to compute and render each frame, but I am noticing some things I can optimize from the performance flame graph! I will say, I find chrome to be way more efficient for ctx2d things than firefox or safari.
Re: MicroUI – A tiny, portable, immediate-mode UI library written in ANSI C
#76I 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…
Why is the WASM demo so fuzzy? I am on Windows/Firefox. https://imgur.com/uy78t52
Re: MicroUI – A tiny, portable, immediate-mode UI library written in ANSI C
#77Nice, except the hard part seems to be missing: interfacing with an actual window system (X11, TUI, WIN32, whatever ...)
Re: MicroUI – A tiny, portable, immediate-mode UI library written in ANSI C
#78I 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…
It first said "that's a ton of work" to which I said, "Really? A basic IMGUI needs a texture with glyphs. The abiltiy to draw textured rectangles with vertex colors. Scissor support for clipping. Some hit testing." and it was like, "yea, you're right", and a few mins later it wrote what I needed.
I'm not saying you shouldn't use this library.
Re: MicroUI – A tiny, portable, immediate-mode UI library written in ANSI C
#79Earlier quoted context omitted.
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.) Imme…
You made up a guy and pretended I was yelling at them.
Re: MicroUI – A tiny, portable, immediate-mode UI library written in ANSI C
#80I 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…
Why is the WASM demo so fuzzy? I am on Windows/Firefox. https://imgur.com/uy78t52
More details:
The demo is using half-resolution on high-dpi displays (currently that's sokol-app's default setting, but not sure if that still makes sense in this day and age tbh), this half resolution amplifies all sorts of text rendering issues, and it gets especially bad when there's a fractional system-dpi-scale like 125% or 150%.
PS: another problem (maybe the main problem, even if everything else is correct) is that the demo's pre-baked font atlas texture isn't all that great since it has 'anti-aliasing' baked into the glyph pixels, and the font atlas texture has a very low resolution (glyph height is 10 pixels, which would be ok for a 'crisp' hand-drawn bitmap font, but not when the font atlas has been created from a regular TTF font, which this one seems to be).
Does this Dear ImGui demo look better on your setup? This is using the native display DPI and uses a TTF font instead of a bitmap font:
https://floooh.github.io/sokol-html5/imgui-highdpi-sapp.html