I grew up with BASIC and Turbo Pascal. My first programs were very simple graphical games. I still miss the era of BGI and BASIC’s painting comm

Minimal cross-platform graphics

submited by
Style Pass
2023-01-23 17:30:12

I grew up with BASIC and Turbo Pascal. My first programs were very simple graphical games. I still miss the era of BGI and BASIC’s painting commands. Those graphics were neither beautiful nor fast, but they were simple. Simple enough for a kid with only elemental geometry knowledge to build something exciting.

Even today, whenever I want to prototype or visualise something, to experiment with generative art or to write a toy graphical app – I feel nostalgic for the old days.

Sure, there is SDL2 and Qt and JavaScript Canvas and Löve and many others. But how hard could it be to build our own cross-platform graphical library from scratch?

Our goal here is to have a framebuffer for a single window that would run and look the same on Linux, Windows and macOS. Good old C would the language of choice to keep the retro-computing atmosphere of the story.

From my past experience with webview and lorca, Linux is the easiest platform to develop for. Or maybe I’m just biased. Of all the graphical options that Linux provides we’ll choose X11 as the foundation to our window, since it’s the lowest common denominator, so to say.

Leave a Comment