Further, simple features like zooming in run abominably slowly and look bad. Wesnoth runs an unreasonably large amount of memory.
I think this has to change. The reason things are like this is because we use SDL to do all our graphics, and that requires us to calculate all images in software. Further, because we support a wide range of different display settings, it's difficult for us to perform optimizations of image manipulation.
The way forward in my mind is to use the industry standard for real time graphics -- OpenGL. Almost all modern video cards support it. Any platform which one might expect to play any kind of decent game on should support OpenGL.
Now, a few platforms -- particularly older ones -- might not have good enough OpenGL support to play Wesnoth on. But, I don't think there are very many systems like that, and if there are, they probably can't play Wesnoth very well anyhow.
One problem is that on FLOSS platforms (GNU/Linux in particular), there is a lack of availability of Free accelerated drivers. However, I don't think this is a problem we can solve ourselves. If we want to make a modern, good quality game, we need to use the industry standard for graphics, and that is OpenGL.
If we don't use OpenGL, I think we are going to have a hard time adding all the graphical features we want to to Wesnoth. With OpenGL, we can make our current feature set run at a decent speed, and we can add new features (e.g. dynamic scaling and rotation of images, particle systems, lighting effects) that'll make the game look better and better.
Anyhow, the main purpose of this thread is to get feedback on what people think of using OpenGL. Which platforms are there that we'll use from using it? Which platforms are we sure has solid support for it?
I would like to note that I think an obvious response will be that we should support both SDL and OpenGL for rendering graphics. I think this option is an unrealistic fantasy -- the way to optimize SDL and OpenGL are completely different, and having to maintain support for SDL is a nightmare, as well as hindering future developments. (Note that I'm not suggesting getting rid of SDL altogether -- just rendering graphics using OpenGL. Image loading, event handling, input, music, sound, and so forth will still all be done by SDL).
I would also like to note that contrary to the misunderstanding of some people, OpenGL is a general graphics API for doing both 2D and 3D graphics. I am NOT suggesting making Wesnoth 3D. This thread has nothing to do with that. In fact, if you have no idea what OpenGL is, I suggest not posting in this thread.
Finally, this isn't all theoretical; I have a working (with some glitches) version of Wesnoth that uses OpenGL. On my particular system, this exhibits dramatic performance improvement over using SDL. And when I say dramatic, I mean that Wesnoth scrolls around the map at about 30 fps from the trunk, and scrolls around the map at over 100 fps with my version using OpenGL. The zooming feature also actually works at a 'normal' speed instead of being dog-slow.
My version still has some glitches (not all dialogs work properly, and the sidebar in the main game doesn't draw properly), and it'd probably take quite some work to get everything converted over to OpenGL properly. It also likely won't work on all systems (I use OpenGL textures which have dimensions that are not powers-of-2, forbidden by the OpenGL specs, though it happens to work on my system). However, in my mind it shows that OpenGL is viable and worthwhile for Wesnoth.
Thoughts? Comments? Concerns? Do other developers support this as the direction Wesnoth should go in?
David
