site  contact  subhomenews

GUI creation for the Linux framebuffer

August 17, 2018 — BarryK

For a long time I have wanted some means of creating very small GUI apps that are statically compiled and work directly with the Linux framebuffer. The use would be for a GUI app in the initramfs.

I recently discovered LittlevGL, and then decided to ask for the opinion of two guys who are real experts in this field, 'technosaurus' and 'goingnuts' (their Puppy Forum names).

Firstly, here is a post about LittlevGL:

https://littlevgl.com/blog/23/embedded-gui-using-linux-frame-buffer-device-with-littlevgl

I sent a pm on the Puppy Forum to technosaurus, and he responded:


littlevgl has been on my radar for a while now - I do like it, but its no gtkdialog replacement; you can see more of my projects of interest at https://github.com/technosaurus?tab=stars I am in the process of moving from near Houston, Texas to near Kansas City, Missouri (U.S.) We have moved 3 times in 3 years so I have not been coding for some time - just reading/analyzing code for future use (thus all the starred projects, but few commits)

Besides littlevgl, the ones I know of that will work for the framebuffer (and X) are:
https://github.com/vurtun/nuklear forum thread here
https://github.com/memononen/nanovg + oui/blendish
https://github.com/ImpulseAdventure/GUIslice (uses SDL)
https://github.com/grz0zrg/fbg (lacks widgets)

more gtkdialog-like:
http://lcui.org/ some largish dependencies (libpng,libjpeg,
libxml2,freetype,fontconfig)
http://tekui.neoscientists.org/ possibly unmaintained and needs freetype and lua - uses any raw framebuffer (or X11 depending on configuration)

Some notes.

For the ones that use opengl (or GLES) a specially built Mesa is needed and some framebuffer drivers are not supported because they lack support for kernel mode setting (unfortunately no one has ported Fabrice Bellard's tinygl as a fallback)

littlevgl seems to be a retained mode GUI like gtk and kde (but seems to be simplified so that you need ~1/3 less code than gtk and without the huge overhead of c++ and qt) There is a template here and it seems to be targeted to Linux with growing driver support
nuklear and nanovg are immediate mode GUIs which cater toward game development and tend to use more CPU, though nuklear appears to have addressed this since I last tested it. However, since they are single header files, anything unused will get compiled out so they make small binaries.
https://bitbucket.org/duangle/oui-blendish/src

GUIslice could be a good compromise since it uses SDL (1.2 or 2.x) which will handle the framebuffer (or X) for you. It isn't as pretty though - basically an improvement on curses.


I was aware of Nuklear, and did look at it briefly a year or so ago.

Here is another one, uGFX:

https://ugfx.io/

This is a commercial product, free for "home, hobby and educational" use. It is an open source project, and will work with sdl or directly with the framebuffer. Git project site:

https://git.ugfx.io/uGFX/uGFX 

Tags: linux