pioneerspacesim/pioneer — pull request #892 by robn (2012-01-12 10:41:39+00:00)
Title: Texture refactor

This patchset significantly expands the existing `Texture` class so that it can handle all the details of defining, creating and using a texture. The existing functionality in `Render::Texture` has been merged with it and various subclasses have been created to specific tasks (`ModelTexture, `UITexture`, `TextureFont::GlyphTexture`, `Gui::Gradient::GradientTexture` and `Render::RenderTarget` and its subclasses).

The main test for converting the code over to use this was to look for calls to `glBindTexture` and replace them and their related texture calls with `Texture` objects. Only two of these remain - the currently-unused white noise texture in `DeadVideoLink` and the unused (and non-working) raytrace mode in `modelviewer`. `Texture` is not really designed to be used with a texture that gets created every frame as both these do, but both of these need to be checked and rewritten or removed so I've opted to leave them out for the moment.

The old `TextureManager` has been replaced by a functionally-equivalent `TextureCache` class. Unlike its predecessor it has no global state. Two caches currently exist, one for LMR and for the UI. I'm not really happy with the interface but I have not spent a lot of time on it. I think it can be looked at again later.

Testing has been done by observing that model textures, fonts, UI elements (images and gradient fills) and HDR all work correctly.

/cc @Luomu.