Material cache bug

In the last post, I mentioned a bug in VectorStorm’s new material cache.  Found the bug today.  It was kind of nasty;  compiled OpenGL display lists could change the drawing state without VectorStorm’s knowledge.  Means I need to flush VectorStorm’s material cache every time we run a compiled OpenGL display list, since that compiled display list could have changed the drawing state without notice.

OpenGL display lists have been deprecated since at least OpenGL 3.0.  They still work, but are discouraged.  Maybe I should remove them from VectorStorm.  There’s really very little reason to use them instead of VBOs.  Certainly they’d make the material cache more useful, at least up until I get around to writing a proper material batching system.