[fpc-pascal] FPC Graphics options?

Nikolay Nikolov nickysn at gmail.com
Fri May 12 18:48:58 CEST 2017



On 05/11/2017 10:25 PM, Sven Barth via fpc-pascal wrote:
> On 11.05.2017 20:43, James Richters wrote:
>> I have a few console graphics applications that I originally wrote in
>> Turbo Pascal that I have been able to convert over to Free Pascal and
>> now have windows versions of these programs.  I notice that unless I run
>> my program on a 3.5GHz machine or faster, the graphics are fairly
>> slow.    By slow, I mean noticeably slower than they were on a Pentium
>> 233 DOS machine with Turbo Pascal.  The intended computers for these
>> programs are simple inexpensive PCs with motherboard video, no dedicated
>> video cards, I think it should be possible for any modern computer to
>> severely out perform a Pentium 233 with a VGA card in it, so I’m not
>> sure what the issue is.   I am just using the graph unit for windows,
>> and I wonder if there is a more efficient method of creating a full
>> screen graphics only application than to use the graph unit?    I am
>> only looking for it to work under windows and the main issue I would
>> like to solve is the speed of drawing things on the screen like lines
>> and arcs.  It would be nice if I am also able to get away from BGI fonts
>> and use True Type fonts instead.  I don’t need 3D rendering or anything
>> so complicated, just to draw lines and arcs and maybe ellipses as well
>> as various text, and flood fill closed shapes with some solid color.
>>
>>   
>>
>> Any Suggestions?
> You could try the units ptcgraph or sdlgraph as alternatives (both are
> part of FPC). Other than that you could try to investigate why the
> graphic unit is so slow on Windows...
If you want to keep your old code, try ptcgraph! If you want to use the 
"legacy" graph unit api, ptcgraph is pretty much as fast as you can go 
:) It should be faster than the regular graph unit under windows. If 
it's still not fast enough for you, you should switch to a more modern 
api, but this requires rewriting your code. And afaik, sdlgraph is 
broken and has never worked, so don't waste time with it.

Disclaimer: I'm the author of ptcgraph, so I'm obviously biased, but 
that also means I've done a lot of work on porting the "legacy" graph 
unit api to modern platforms. Ultimately, it's up to you to decide what 
to use, but since you already have code, that uses the graph unit, 
trying ptcgraph should be the cheapest option, requiring almost no 
changes to the code.

Best regards,
Nikolay



More information about the fpc-pascal mailing list