3 ms·
You can already directly draw using framebuffers etc. However, you will likely end up re-implementing widgets in any case, if your app gets more sophisticated.
by pkphilip 6y ago
You can already directly draw using framebuffers etc. However, you will likely end up re-implementing widgets in any case, if your app gets more sophisticated.
About UI, it is not necessary that it should be heavy and bloated. Lazarus IDE, for instance, produces very small binaries even for fairly sophisticated UIs and it is quite fast.
- enriquto 6y ago> You can already directly draw using framebuffers etc. Can I, really? How does one framebuffer in a couple of lines of C? Show me a simple program that draws a black 800x600 window. > you will likely end up re-implementing widgets in any case, if your app gets more sophisticated. Don't worry about that. My "app" won't get more sophisticated. I will never ever need any widgets nor drawing directives. Just give me a framebuffer and key/pointer events.
- 10000truths 6y agoIf you really want to go barebones, just mmap /dev/fb0 and do a memset 0 on the region of screen that you want black. Key/pointer events are a matter of reading files from /dev/input.
- DonHopkins 6y agoYeahhhh!!! That's what FORTH is for! https://donhopkins.com/home/archive/forth/cg/cg.f https://donhopkins.com/home/archive/forth/cg/cg.f
- enriquto 6y agoHa! But I want to open a window, if possible portably between linux and windows (just like glut was). It seems to me that we are adding a lot of complexity and going backwards feature-wise.
- sitic 6y agoGLUT (in the form of freeglut [1]) still exists (last commit is from February) and works on all major (desktop) operating systems. GLFW [2] is however much more wildly used these days and pretty much the spiritual successor of GLUT. ImGUI can run on top off all of them and doesn't provide the features (window/context creation, event handling) they do. [1] http://freeglut.sourceforge.net/ http://freeglut.sourceforge.net/ [2] https://www.glfw.org/ https://www.glfw.org/
- enriquto 6y agoI still use freeglut and am mostly happy with it. Yet, I'm often mocked by my colleagues for that reason. I tried GLFW but I don't see the point of this library whose main raison d'être seems to be "not be freeglut" while having nearly identical features. Besides, the fact that it works with keycodes and not with letters is a bit annoying. The X server sends the key symbols but GLFW choses to ignore them, forcing the user to find them according to the current, difficult to find, keyboard configuration.
- IdiocyInAction 6y agoSDL may not be a couple of lines, but I'm fairly certain you could throw together a header to give a framebuffer to draw in 3-10 lines.