[fpc-pascal] Turbo Pascal 3 graphics
bernd.oppolzer at t-online.de
Thu May 9 01:06:11 CEST 2019
This may be off-topic, but anyway:
I did some graphics programming in the 1990s (for customers of mine),
but with not so much interest on display terminals, but instead on large
plotters (DIN A0 format, for example).
I used a library called GKS at that time (graphics kernel system), which
device independent and supported several "drivers" for different
graphics display stations. But it was only "passive" graphic, used to
the output which was plotted later. GKS had a Fortran interface, but I
a Pascal interface. This was on the IBM mainframe.
Later (and on other platforms) I had no GKS, but I liked the idea, so I
a library of my own, inspired by GKS. The GKS calls produce a GKS metafile;
this is a readable text file which contains all the graphic elements.
metafile is then translated to HPGL (HP graphics language); this is the
supported "driver" at the moment. For HPGL files, there are very good
domain viewers (for example HPGLVIEW from Cern). You can print or plot the
HPGL files or convert them to PDFs.
So, using this GKS library and the GKS metafile format (and its
translation to HPGL),
it is still possible to do sort of professional graphics programming using
much the same functions and features that I used in the 1990s. The language
doesn't really matter; it can be C or Pascal.
Example output file: http://bernd-oppolzer.de/fdynsb.pdf
If you want to know more about GKS or the GKS-to-HPGL-translator,
please feel free to contact me offline.
Am 07.05.2019 um 22:52 schrieb Kevin Lyda:
> Amazingly I still have a number of my high school computer science
> projects which were written in Turbo Pascal 3. And a few are almost
> not horribly embarrassing.
> I'd like to port them to fpc and write up the experience but I know
> what the huge issue is: it uses the graphics.bin library which was
> brought in with graph.p - a snippet of which is at the bottom of this
> It did something like turtle graphics and worked on CGA type systems
> which were comically limited. Still, it would be neat to see it run
> outside of DOSBox.
> So I'm wondering what my options are with FPC graphics. Looking
> through the code I used Draw, GotoXY, Palette, Circle and Fillshape -
> as well as IO functions like write, read and keypressed.
> Any suggestions appreciated, thanks,
> North = 0;
> East = 90;
> South = 180;
> West = 270;
> procedure Graphics; external 'c:\GRAPH.BIN';
> procedure GraphMode; external Graphics;
> procedure GraphColorMode; external Graphics;
> procedure HiRes; external Graphics;
> procedure HiResColor(Color: Integer); external Graphics;
> procedure Palette(N: Integer); external Graphics;
> procedure GraphBackground(Color: Integer); external Graphics;
> procedure GraphWindow(X1,Y1,X2,Y2: Integer); external Graphics;
> procedure Plot(X,Y,Color: Integer); external Graphics;
> procedure Draw(X1,Y1,X2,Y2,Color: Integer); external Graphics;
> Kevin Lyda
> Galway, Ireland
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
More information about the fpc-pascal