Earlier / Later / Permanent Link
Enne Walker, 15.05.2008, 05:19
If I had to guess about what could be causing this, it would be that your calls to SDL are not being hardware accelerated on Linux but are in Windows.
Rastilin, 15.05.2008, 11:29
Yeah, it's very strange that something would be working faster in Windows that Linux. Well Ubuntu 7.04 still had a few bugs, so you might want to check out that you're not leaking memory or the Beagle service didn't go into a loop.
Mario Donick, 15.05.2008, 16:48
Enne, you seem to be right. A hint what might be the reason given here points to the same direction: On Windows, SDL uses DirectDraw which is accelerated. On Linux it doesn't, of course.
It seems that I have to use an OpenGL surface instead a normal SDL surface if I want the same speed on Linux. This is decribed rather well in this article.
However, the game is not unplayable on Linux, and my computer is not very fast at all, so the problem might be not so big. So switching to OpenGL rendering is rather low priority for now.
Enne Walker, 16.05.2008, 01:36
Is your X configured to use DRI? I don't know if that will coerce SDL into giving you hardware surfaces, but it's the only option I know of that might give you better performance without forcing you to rewrite your drawing routines.
Mario Donick, 16.05.2008, 07:47
Yes, I think so. But SDL supports three types of surfaces, software, hardware and OpenGL. According to this article, hardware surfaces can be rather problematic:
Using hardware surfaces doesn't tell you much about how they will perform on any given system. In fact, they may perform poorly on a system with a high end graphics accelerator while performing remarkably well on a system with a weak graphics system.
And:
Because of differences in their design, Windows allows normal programs to get hardware surfaces while on Linux and other Unix-like operating systems, a program must have root privileges to access the hardware.
Interestingly, the game seems to run faster when I start it as root. But this may be just a false impression I get from my expectations. Have not measured it really.
powered by d.elog blogging software v0.6 / 17.04.2009
© Mario Donick 2005–2009.
d.elog contains Xinha, a free WYSIWYG textarea editor.