Rant about drawing a circle.

First ai hallucinates. Many languages , gui toolkits exists.
With commoder 64 , go graphical mode . y-axis * howmuch + xaxis -> poke color.
Now you are into oblivion.
I found a way , dlang+gtk but no obvious.
[ I need a label ,input box & a circle, when you click , return event , ....]
 
SDL could do it If the surface is the entire program window. Xorg copy/paste in that like gtk windows is probably a challenge...
You can also make a mono bitmap circle in anything with arrays. Set a quarter of the circle bits according to cosine and rotate/copy that to 3 other parts of the circle. The program still needs a pixel draw function.
 
So i want to boot my computer , afterwards on place (50,50) I want a blue dot. Not easy :)
Is relative 640x480 good enough? Boot to X.org, autostart with command: dosbox -fullscreen -c mount c basic_dir -c "c:\qbasic /run c:\prog.bas"
Program:
Code:
screen 12
window (0,0)-(640,480)
pset(320,240),1
circle(320,240),100,1
while INKEY$=""
wend

But there should be a native X.org equivalent for this. How did that old xeyes program work?
 
Good algorithm, but which API ? , fltk , gtk , qt6 ,other ?
Yes, that's a bit more difficult. If you're writing purely for X11, then xcb in the first instance, or Xt/xlib, and maybe using Xaw. There's a graphics programming tutorial for xcb here https://www.x.org/releases/X11R7.7/doc/libxcb/tutorial/index.html . Using xcb is considered a more modern approach compared to xlib nowadays. On wayland... I don't know what they use, but it probably comes down to gtk or qt. If you're actually writing a gtk or qt program, which is perhaps the majority of gui's on unix nowadays, then use the relevent one of those. I wouldn't use fltk unless I was modifying an existing program written using it. Yes there are other options, perhaps the most notable being Tk which has bindings for a number of different languages, but I couldn't find a Zig binding for Tk, at least, not from a quick online search. Tk is likely what you would use if your program was going to be written in Tcl, Python or Perl, for example. Remember that gtk started out as the 'gimp toolkit' - the people who wrote the early versions of gimp wrote their own widget set; since that time it has become adopted as a standard by itself. Similarly qt started out as the toolkit used to write the early versions of kde, I have a feeling qt might have been originally written for smartphones, but don't quote me on that.

This gui API fragmentation thing has always been a big problem on unix, and is a large part of the reason why it has never developed into a true competitor for mac or windows on the desktop. The "standard" gui platform for unix was supposed to be motif and CDE, but that was abandoned decades ago, and the PITA motif/Xt/xlib API stack was too complex to be readily usable, which is why gtk and qt were developed as replacements. This is why we have the two main competing desktops today - gnome and kde. It also happens to be divided by programming language - C for gtk and C++ for qt.

Or... you could always go "full bloat" and write it for electron... 😁
 
The base system provides libvgl for drawing graphics directly in a virtual console, but it only works with syscons, not with vt. Someone mentioned somewhere (in one of the conference call recordings on YouTube, I think?) that they were considering updating it to work with vt, which would be cool.
 
If you wanted to do something a bit more adventurous... there's a nice set of OpenGL tutorials here: https://github.com/VictorGordan/opengl-tutorials

They might not work directly on freebsd as-is, you would probably have to port them over to freebsd's implementation of ogl, presumably mesa, so I expect "some assembly required". I haven't played with ogl myself on freebsd. But that would be an interesting little project.

The mesa libs are definitely available https://www.freshports.org/graphics/mesa-libs/
I found a tutorial here, although it's based on qt, and it's a bit old (2013) https://ftp.nl.freebsd.org/languages/qt/learning/developerguides/qtopengltutorial/OpenGLTutorial.pdf
Interesting... there is also this framework that looks useful: https://www.freebsdsoftware.org/graphics/glfw2.html
 
"Lost in Translation" belongs to a select group of great movies I don't think I'll ever watch, because I just don't feel like it. The three Godfathers are in that list as well, and so is Titanic. I'm sure I'm leaving out some others.
 
The base system provides libvgl for drawing graphics directly in a virtual console, but it only works with syscons, not with vt. Someone mentioned somewhere (in one of the conference call recordings on YouTube, I think?) that they were considering updating it to work with vt, which would be cool.
Interesting... that's the kind of thing that would be needed to get my favourite web browser www/links to work in graphics mode in the freebsd VC. Sadly I still only appear to get 'links -g' to work in the linux VC at the present time.
 
We the Borg from Microsoft, we now alot about Python... Please assimilate our contract & our terms.
Your standards will be assimilated into our new Microsoft Standard.
Stop openldap, use Active Directory.
 
Back
Top