C/C++ Draw graphics on display without Xorg

Thank you Aragats!
Is /usr/include/sys/fbio.h in FreeBSD the unique possibility? (like does the layer vgl or without vgl,
directly using signal, consio, ioctl, fbio.
If the goal is education and maths, I suggest the following. Start by getting a good computer graphics textbook; the kind of thing that undergraduate CS majors would read. I don't own one (not a UI person), but a friend used to have a good one in the 1980s.

Then find some programming system that allows you to directly draw points, lines, rectangles, and circles. My first approach would actually be to either do this in postscript (which also teaches a highly useful programming language and programming style, namely postscript and stack-based programming), or in HTML5 with Javascript. In HTML5, just create a canvas and a graphics context, and then use functions such as context.putImageData to put graphics elements into the canvas. That will be much easier to start with, and will teach you how to get graphics built.

If you really insist on using the hardware frame buffer, then the techniques that aragats suggested sound reasonable. Another approach I would suggest: Find some framework (like Kivy or Qt5) which is capable of using the frame buffer under FreeBSD, and read the source code so as to see how they do it. That will give you a starting point for the techniques experienced programmers use; then combine it with reading documentation for the API they use, and combining it with a good textbook.
wolfram mathematica is widely used today.

Framebuffer is still available.

An user interface can be of course programmed in Java, Qt, GTK,..., to be used with a mouse / pointer.
A graphical user interface and the computer mouse have become most often used with a personal computer.
It is however important to keep things like it should, not to use QT for framebuffer, if it is not necessary.

There is a quote attributed to Einstein that may have arisen as a paraphrase of the above quote, commonly given as “Everything should be made as simple as possible, but no simpler,” "Everything should be made as simple as possible, but not simpler", or “Make things as simple as possible, but not simpler.”

fb looks stable. It looks sufficiently available for next coming years.
It runs without need of Xorg installation or additional graphical env, like coming wayland (or other).
Framebuffer does not need numerous layers of layers of libraries.
It does not depends on drivers for GL.
It does not require or need regular code updates/maintainance.
It has a clean usage of the memory and resource, and it allows to protect our environment.
It allows to do not use Wayland, SDL, QT, GTK,...

For some specific areas of applications, a low specs-computer like a PI for educative purpose can display highly complex 2D plots/outputs of simulations. For simple graphical applications and specific requirements, it can be a convenient, versatile option, due to previously mentioned advantages.
Furthermore, it is cheap, compilable, and widely available.

But, in term of longevity, much better is Microsoft MSDOS or FreeDOS. But it needs the environment to run it. MSDOS would be more reliable, because it runs on any kind of platforms and it will be stable over years.

Last but not least, low-power consumption devices and Energy Efficient Computing are important for education, for students, ... academic. The earlier getting used to it, the better. It protects our planet.
this was easier.

  • with sysutils/jfbterm you can get not limited to 256 chars unicode support
  • www/w3m allows you to browse www sites with images on jfbterm
  • using libSDL + libvgl you can play some videos or graphical games

today it is possible still to use the fbio.h by passing information using framebuffer.

In the past, there was vgl, but it used <sys/io.h> which is no longer there.
hence vgl is outdated. https://github.com/openglredbook/examples/blob/master/include/vgl.h

In the past, w3m could use /dev/fb0
ls -ltra /dev/fb0
crw------- 1 root wheel 0x2f Apr 14 17:00 /dev/fb0

The position of 0x3c4 was being used.

it was actually possible to write on framebuffer of BSD.

It might be however still possible.

Ideally would be to watch a movie using framebuffer and mplayer -vo fbdev ...
chmod 777 /dev/fb0 is your unsecured friend.

Today this code can be adapted to run on > 11.x
but it needs libkvm from freebsd master.
OP, what is the application? Is this charting for HFT for example?
Why did you choose FreeBSD? for it's network superiority?

I am curious as I am looking to draw HFT charts to kernel framebuffer and need the lowest layer access for simple X/Y charts.

Thank you kindly.
With clean install (kernel.txz and base.txz) without installation of Xorg, which opportunities might be being given to draw graphics [...] on the display?
if you use the newcons ("vt") you don't need any extra software to draw graphics.
Just paint on the screen using the mouse:

Explanation from a 2016 PR (see there if you want more details)
If one plays with all three mouse buttons, it is quite easy to use vt as a painting program.
Sorry if that answer is not what you expected ;)
That time you could write directly pixel by pixel to the video memory starting at 0xA000 (-;
Heh indeed. Just imagine someone had (reverse?) mmap'ed it there before hand ;)

That said, much of my DOS experience was spent with Watcom's Graphics library which was actually less fun and over engineered for what it needed to be ;)

https://chetaero.files.wordpress.com/2016/11/f77graph.pdf (Couldn't find the C API version but quite similar)
Now you have me wondering what the original 3DStudio 2/3/4 used for graphics. Pre-Windows 3D DOS work.
Probably just good old linear algebra.

There were some popular "off the shelf" 3D rasterizers back then if I recall. The only two I remember are:
  • SciTech Display Doctor (I think it had an OpenGL-like API)
  • BRender
They were always so much faster than what I could write haha. Luckily these days I can just chuck more threads at my inefficient code.

That time I used mostly Turbo Pascal, even to write a printer driver (for the first HP's ThinkJet printer).
Thats pretty cool. I guess since things was all raw memory back then, you didn't specifically need C to access the operating system's C API to do system-level tasks?
I was worried I wandered too far from original topic and deleted. Sorry.

Someone was mentioning mold the other day and it got me remembering about one of the Doom/Duke(?) special effects. Glowing mold on the walls and ceiling in one particular scenario. Thinking back it was cheezy effect but there was limited graphics capability then. Imagination still played a critical part in video games..
Open Sourced under MIT 4 days ago! May 4th 2022.
That is super cool! It's on Github here:

We're wandering off-topic here, but I recently had this book recommended to me:

The author's web site is worth a look too:

He's given me a new reading list:

I realized I've never read K&R. Picked up a copy someone was throwing away at work and started.