Hi Jesper On Wednesday 10 November 2004 03:28 pm, blynel@xxxxxxxxxx wrote: > I have been looking a bit into why gfx-sdl compared to gfx-x11 ran so > slow on my system (AMD Athlon 750 mhz,GeForce2 GTS, mdk 10.1). In the > file src/gfx-sdl/sdlgfx.c the function 'flush_block' seems to be called > way too often from drawing.c whereas 'flush_screen' for some reason is > deactivated. > > I changed to 'flush_block' into a noop and reactivated 'flush_screen' by > doing these changes > > [SNIP] > > Basically just flushing the whole screen each frame instead of doing a > bunch of small flushes. Now gfx-sdl runs as smooth as gfx-x11 (only tested > running Kick Off 2 though). That's interesting. Quite why the X11 driver should appear "smoother", I don't know. It works the same way as the SDL driver currently does (at least in non-DGA mode). That is, it updates with flush_block() and updates 100-line blocks at a time. (Although, as an aside, I don't know why maxblocklines has been set to 100. It seems arbitrary to me. Increasing that number to the height of the screen should have the same effect as your patch). Perhaps the X server buffers the updates with the X driver. I'll have to have a look at the X implementation of SDL_UpdateRect() and find out what's going on behind the scenes with the SDL version. Anyway. Thanks for the patch. I'll give it a whirl here. BTW, I was planning on doing it like this eventually, anyway. I'm re-writing the X11 and SDL gfx drivers for the post-0.8.27 versions - to support gfx filters, OpenGL, etc. > I think this could explain the sloppy speed you get on MacOS X as well, > so I encourage people to test it. Well. The sloppy speed on OS X was also due to the fact that GCC builds position-independent binaries (and hence flabby code) by default on OS X. Which reminds me, I don't think I checked that patch into CVS yet... Cheers, Rich