I've seen your question here, but for some reasons I can't log in (I've turned JS on). Anyway, here's my answer:
You have to open the framebuffer device /dev/fb* and using mmap you can map it into your application's address space. I wouldn't recommend this though, because not all drivers provide the same device interface unfortunately, and it can also conflict with X and Wayland drivers.PeterX {l Wrote}:I have narrowed down my options to (a) framebuffer device, (b) SDL1.2 and (c) SDL2.
(a) I can't find thorough information on how to use the FB. Do I need to read the linux kernel sources for this?
http://linux-fbdev.sourceforge.net/
https://tldp.org/HOWTO/Framebuffer-HOWTO/
Yes, absolutely. SDL is designed in a way to hide the lower layer from your app, it could use Wayland too for example without your app knowing (or caring about). Furthermore SDL is cross-platform, meaning it also works with Win GDI or Mac Cocoa for example, your source will be the same, no modifications needed. It is also possible to use SDL in a way that you open a full screen window which will return an SDL surface directly mapped to the hardware's framebuffer.PeterX {l Wrote}:(b) and (c) Is SDL without X possible?
SDL1.2 isn't maintained really any more (the library is, but you'll have trouble with some distro's packages). I'd recommend SDL2. You can use an SDL1.2 like surface with SDL2, but it can also provide you a hardware accelerated renderer (which is a 2D renderer by default, but SDL also supports 3D rendering if you want).PeterX {l Wrote}:What are the differences between 1.2 and 2?
I don't think so. There are very good tutorials on the net, and the SDL documentation is pretty good.PeterX {l Wrote}:Do I need to buy a book to learn coding for SDL?
https://wiki.libsdl.org/Tutorials
https://wiki.libsdl.org/CategoryAPI
On a function reference example, take a look at SDL_CreateWindowAndRenderer. Explains all the arguments, and there's example code on how to use it. SDL is one of the best documented libraries I've encountered.
Cheers,
bzt