[messages] [Developers] Re: Roadmap for VASSAL 4

uckelman uckelman at nomic.net
Tue May 3 03:12:38 MST 2011

I've converted the Python demo I made a few weeks ago to C++. I'm
posting a link to an archive containing the source code here for anyone
who wants to try it or have a look. The dependencies are only OpenGL,
GLUT, and libjpeg. I haven't had time to do a Windows build yet; I
intend to try that this evening. I'm assuming that anyone on Linux will
be able to compile this with no problems; hopefully this is also the
case on Macs.


The good:

* Fast. The parts which are in software (as opposed to in the graphics
hardware) are much, much faster than in Python. This is unsurprising,
but nice to see. The only siginificant thing which happens in software
in the demos is image loading. The map image I've been using for testing
is 8149x3514. On my laptop, it takes about 5 seconds to load this image
in Python; in C++, libjpeg loads it in under one second.

* Very low RAM usage. Image data takes up close to 100% of the is the
memory the demo uses. (This is similar to VASSAL.) The test map is about
81MB in memory. However, once we've carved it into texture tiles and
handed those off to OpenGL, we can free all the memory we allocated to
store image data---OpenGL stores textures in video RAM. The demo was
using about 7MB RAM for me after image loading was finished; the max was
around 150MB (for a few seconds) during tile carving.

* Little code. The C++ demo is about 1200 lines, which is approximately
twice the number that the Python demo has. Half of the extra "code"
comes from lines which are blank or have only a curly brace on them (332
lines); the rest comes from the code which gets data from libjpeg and
from managing OpenGL handles properly rather than leaking them.

The bad:

* I'm not seeing any bad, yet, actually.

The ugly: 

* Building for multiple platforms. I can (probably) make Windows builds
on Linux using the mingw cross-compiler. I've done that once before, for
mkhexgrid. I have no idea whether I can cross-compile on Linux for Mac
OS. I'd very much like to be able to build for all platforms in once

[1] http://www.vassalengine.org/~uckelman/cpp-test.tar.bz2

Read this topic online here:

More information about the messages mailing list