Our great sponsors
A single-header ANSI C immediate mode cross-platform GUI library (by Immediate-Mode-UI)
Embedded graphics library to create beautiful UIs for any MCU, MPU and display type. It's boosted by a professional yet affordable drag and drop UI editor, called SquareLine Studio.
You can check out LVGL: https://github.com/lvgl/lvgl/
It's geared more for embedded, but you can use an sdl back end for desktop (which might kill your light weight requirement depending on your strictness level). I wrote my own tty/framebuffer driver for it and use it directly on the frame buffer (not Linux) but it's pretty nice to work with. But if you need metal/openGL/Vulcan/directX and hardware acceleration, it's probably not what you're after.
Clean code begins in your IDE with SonarLint. Up your coding game and discover issues early. SonarLint is a free plugin that helps you find & fix bugs and security issues from the moment you start writing code. Install from your favorite IDE marketplace today.
A tiny immediate-mode UI library
The price for the 'lightest' UI toolkit probably goes to microui:
Just around 1100 lines of C code.
You need to bring your own renderer, but that's the same for Nuklear or Dear ImGui.
I wrote a WASM wrapper for the microui demo too:
Minimalistic C++/Python GUI library for OpenGL, GLES2/3, Metal, and WebAssembly/WebGL (by mitsuba-renderer)
I've been using nanogui to fit the bill for personal uses.
To be honest though, I'm at the point where I'd really prefer an easy and lightweight library to setup a http and/or websocket server, and just make a ui in the browser. I've got a simple use case -- I'm just making a simple scene editor & debugging ui for a toy ray tracer.
I know there are a ton of different libraries out there for the task, but that just makes it hard to evaluate the quality of any given library. I haven't given any a shot, I've only gone so far as to look at them and ponder what the size of the user base is, and question if the project will go inactive in a couple years. Or if it's going to require me to pull in some other host of dependencies.
Recommendations from HNers welcome!
view changes to model-view-projection matrix caclulations in real time
I used Nuklear for a little demo project I put together to wrap my head around matrix transforms in graphics programming. It's very easy to use and pleasant to work with!
Simple, secure & standards compliant web server for the most demanding of applications
Not exaclty -- it looks like it's pretty overkill for my needs
I'm looking for something more like websocketpp, or even just grpc without a requisite proxy. uWebsockets looks really promising, being header only, but in the fine print requires a runtime library. unfortunately, none of that ecosystem seems to use cmake, making integrating it that much more of a pain.
why use cpp for this, I'm sure some HNer will ask. the ray tracer itself is using cuda, that's why. I've also debated
- running it as a grpc server and having some proxy in a more web-accessible language
- creating python bindings and using python to make a websocket/http server for it
neither of those are out of the question, but they're not my first choices, because I'd like to keep the build & execution simple. introducing dependencies, especially other executables, is in conflict with that.
i don't need anything particularly scalable -- a threaded implementation, or one using select() would be fine, if not preferable.
quickdraw backend for nuklear (https://github.com/Immediate-Mode-UI/Nuklear)
Nuklear is great. I’ve spent countless hours hacking around with it. I’ve also built a customized version for classic Macintosh systems (down to System 2.0 or so) and built some simple Macintosh software for it. I put it on GitHub here: https://github.com/CamHenlin/nuklear-quickdraw
Access the most powerful time series database as a service. Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression.
c-api for imgui (https://github.com/ocornut/imgui) Look at: https://github.com/cimgui for other widgets
DearIMGUI has both an unofficial C wrapper and a new official C binding generator. I have personally used the CIMGUI wrapper with C99 apps using the Direct3D11 backend and it works great. The new API is started by the DearIMGUI creator but is still adding features that are available in CIMGUI.
Unofficial C API - https://github.com/cimgui/cimgui
C header (and language binding metadata) generator for Dear ImGui
Dear IMGUI + Render + Window handling, amalgamation in two files ready to use
Then someone put Sokol and IMGUI together into a single .h + .cpp combo and you get https://github.com/pplux/imgui-app
A simple and easy-to-use library to enjoy videogames programming
I really like this trend. Also see:
* Raylib - A single header file game engine https://www.raylib.com/
Audio playback and capture library written in C, in a single source file.
* Miniaudio - A single header file audio library https://miniaud.io/
Both (actually, not just three systems) cross-platform.
For their design and cross-platform support they make for great bases for Go libraries, unlike most C code out there.
Mini audio library
Yes, I found it by accident, because I dug into a Go code base I don't even use for fun, because I wondered about how they do audio, noticed it wasn't actually cross-platform. So I wondered if it's solved overall and found this, which seems to be the most straight-forward way of supporting pretty much all platforms that Go supports. Not completely sure about Plan 9 though.
I made a shortlist of good libraries for my GUI C project and I want your thoughts and comments.
7 projects | reddit.com/r/C_Programming | 5 Apr 2022
Are there any cross-platform GUI libraries out there?
4 projects | reddit.com/r/C_Programming | 12 Dec 2021
Screen layout designer
1 project | reddit.com/r/arduino | 17 Mar 2023
Pine64 RISC-V Ox64 graphics capabilities
1 project | reddit.com/r/RISCV | 8 Mar 2023
GUI implementation with STM32F411
1 project | reddit.com/r/stm32 | 7 Mar 2023