[fpc-devel] sdlgraph, pre-alpha
lolkaantimat at gmail.com
Wed Aug 22 18:24:29 CEST 2007
2007/8/22, Jonas Maebe <jonas.maebe at elis.ugent.be>:
> 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).
Hm... I really forgot to hook Line (but wrote the routine). But HLine and
VLine are hooked and the speed problem is in the Bar function, it has such
for y:=y1 to y2 do
HLine is hooked and works quickly. But it locks the screen every time it is
executed (but calls DirectPutPixel without locking (that's why it is fast):
procedure sdlgraph_HLine(x,x2,y: smallint);
DirectPutPixel:=@nonBuf_DirectPutPixel; // It doesn't lock the screen as
sdlgraph_DirectPutPixel. It's quick.
If to do the same (using nonBuf_HLine) with Bar3D it would be very fast.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-devel