[fpc-devel] sdlgraph, pre-alpha

Jonas Maebe jonas.maebe at elis.ugent.be
Wed Aug 22 14:40:51 CEST 2007


On 22 Aug 2007, at 12:26, Evgeniy Ivanov wrote:

>> Bar3D is indeed one of the few routines which cannot be hooked
>> currently. As long as you hook the line drawing it should be plenty
>> fast though.
>
> No, I tryed. It is in the test.pas. It works very very slow.

It is because you do not redirect the line drawing directly to SDL,  
but instead use the default line drawing routines. Those are indeed  
very slow, because they call a procedural variable (directputpixel)  
for each pixel which has to be drawn). And directputpixel then calls  
through to SDL, which every time must recalculate the pixel position  
on the screen (instead of just adding 1 to the horizontal or vertical  
coordinate in case of horizontal/vertical line drawing).

> I may patch graph.inc, graphh.inc and modes.inc to add ability to  
> hook such
> routines (Shapes/Lines) like Bar3D. It will not take any effect on  
> currently
> written modules (Current Bad3d may be Bar3Ddefault and to  be added  
> to Bar3D
> proc if it's not assigned).  Of course if you will approve it (I  
> don't see
> any reason to make it just for my needs).

I really don't think it will be needed.

>> This will indeed be difficult. It's probably best to create a generic
>> "wincrt"-like unit (sdlcrt?) which can be used together with the sdl
>> graph unit. Full input/output support can also be added to it over
>> time, similarly to how the regular crt unit also takes over all  
>> input/
>> output.
>
> Nice idea. I may do it. I think that the best way for this is to use
> SDL-terminal (I have never used it, but it must be pretty nice).
> But it isn't in JEDI-SDL (so, it must be wrapped to .pp).
> But I prefer to use readln to give user a chance to see the screen  
> created
> by graph (and close after any key was pressed). There are many old
> programmes with it. The "+" of SDLgraph is that it may be used with  
> old code
> and you may add any JEDI-SDL routine (timer or SDL_mixer and so on)  
> using
> global screen variable. Sorry for my poor English, but I think you  
> will get
> the idea.

Yes, sounds good.


Jonas



More information about the fpc-devel mailing list