[fpc-devel] sdlgraph, pre-alpha

Jonas Maebe jonas.maebe at elis.ugent.be
Wed Aug 22 21:56:47 CEST 2007


On 22 Aug 2007, at 20:59, Evgeniy Ivanov wrote:

> Hm... I've tried  such  thing:
> procedure sdlgraph_HLine(x,x2,y: smallint);
> begin
>  SDL_DrawLine(screen,X,y,x2,y,255);
>  SDL_Flip(screen);
> end;
>
> The same. I will try to find the true way, but I'm not sure that it  
> can be
> without locking overhead. I reimplement Bar3d with adding locking -  
> very
> quick. I think it is the fastest HLine implementation

I guess the problem is that you blit the entire screen after every  
drawing operation. It will be faster when drawing lines at a time,  
but still slow. In theory, the flipping could/should be done from a  
separate thread, which only does the flipping once per vertical  
refresh of the monitor. I don't know whether SDL provides access to  
this information though.

>> Bar3D's speed is fine if you have a fast hline implementation (like
>> for e.g. go32v2 in most modes).
>
>  It's asm, it should be faster than pascal code.

That is not why it is that much faster. That code would be almost  
equally fast if it were written in Pascal. I wrote it in assembler  
because I liked doing that, not because it was needed for speed reasons.


Jonas



More information about the fpc-devel mailing list