Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

Immediate-mode in pure C is a nice constraint. how does it handle text rendering, do you bring your own atlas or is there something built in? Thats usually the part that balloons the dependency footprint.


The demo uses a simple prebuilt fixed-size font atlas texture and renders the entire UI (including character quads) via batched glDrawElements calls (one draw call per clip-rect).

But the way how text rendering is delegated to the user is quite flexible, microui basically calls these three user-provided functions:

    int r_get_text_height(void)
    int r_get_text_width(const char* text, int len);
    void r_draw_text(const char* text, mu_Vec2 pos, mu_Color color);
...how r_draw_text() is implemented is then entirely up to you.


If anyone wants it here is an old fork of mine that uses SDL3 - https://codeberg.org/krapp/microui_sdl3_demo


it does not, it basically delegate that part to lower level library for which you have to write the glue code for, there is an example for SDL.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: