[fpc-pascal] OT: fpc SDL HowTo (Was: Maybe a new fpc book :)

Marco Ciampa ciampix at libero.it
Tue Jan 8 13:30:06 CET 2008


On Tue, Jan 08, 2008 at 08:54:58AM +0100, Tiziano De Togni wrote:
> Marco Ciampa ha scritto:
>> On Sat, Jan 05, 2008 at 11:11:02AM +0100, Florian Klaempfl wrote:
>>> Marco Ciampa schrieb:
>>>> I work in a high school in Italy.
>>>> ....
>>>> console & graph unit (BGI drivers under windows and Linux (X _not_ 
>>>> VGAlib) )
>>> If one writes a book, _please_ use SDL for graphics and skip the legacy
>>> graph unit :)
>> Can someone please point me a simple BGI to SDL howto or some very simple
>> Fpc SDL tutorials? 
>>
> Hi, Marco,
>
> I think that there is not (yet) a good answer to your question.
[...] :-(
> I am actually working on another perspective.
> SDL doesn't have functions to draw pixels, lines, rectangles, arcs,
> ovals and text on the screen, and the FPC graph sources are the better
> documentation I found about (there is also SGE, a nice SDL Graphics
> Extension library in C but there are not headers translated for
> pascal).
>
> So I made first a little project including the basic Jedi-sdl units
> (sdl.pas and sdl.inc) in order to work with the Lazarus IDE, then I made
> a unit with equivalent graph procedures to draw on a SDL surface
> (SDL_GetPixel, SDL_DirectputPixel, SDL_Line, SDL_Rectangle,
> SDL_DrawPoly, SDL_FillPoly, SDL_Ellipse, SDL_OutTextXY, etc.).
>
> This demo/test application (some sort of the classic bgidemo app)
> compiles and works on Windows and Linux (Ubuntu), if you are interested
> about this work I'll soon make it available on my home page. Keep in
> mind that it's still work in progress...
>
> It's not (yet) a tutorial, but, as Florian suggested, a practical
> example about using SDL for graphics with Free Pascal.
>
First of all, as usual, thanks Tiziano.

These news are very sad. Why? Because we in Italy (but I think, in other 
countries too) have plenty of math and phisics high school books (and 
some written very well indeed) that reports Turbo Pascal/BGI examples thanks
to the easy way this lib permits to create simple graphs and/or drawings on the
screen. The fact that the sdl library is not included by default in the
standard fpc package make things worse since students are not skilled enough
to compile and/or install packages by themself. If you have to instruct
students to install fpc+sdl+other libs perhaps with some manual environment 
adjustment...just isn't pratically feasible.

So one giant step to improve things could be to create a _easy_ installable
win/linux/mac package to enable elementary graph drawing in fpc. The BGI
compatibility could be a real plus but I understand could have drawbacks
too. Then a tutorial and a BGI to (new graph library name here) howto guide
should close the gap.

Theese are the thoughts (perhaps OT sorry but I hope you appreciate the
feedback) of a high school technician.

bye

-- 

Marco Ciampa

+--------------------+
| Linux User  #78271 |
| FSFE fellow   #364 |
+--------------------+



More information about the fpc-pascal mailing list