Dynamic textures shouldn't have their STATIC attribute set.
map<string,osg::ref_ptr<osg::Texture2D> > FGTextureManager::_textureMap;
osg::Texture2D*
-FGTextureManager::createTexture (const string &relativePath)
+FGTextureManager::createTexture (const string &relativePath, bool staticTexture)
{
osg::Texture2D* texture = _textureMap[relativePath].get();
if (texture == 0) {
SGPath tpath(globals->get_fg_root());
tpath.append(relativePath);
- texture = SGLoadTexture2D(tpath);
+ texture = SGLoadTexture2D(staticTexture, tpath);
_textureMap[relativePath] = texture;
if (!_textureMap[relativePath].valid())
class FGTextureManager
{
public:
- static osg::Texture2D* createTexture(const string &relativePath);
+ static osg::Texture2D* createTexture(const string &relativePath,
+ bool staticTexture = true);
static void addTexture(const string &relativePath, osg::Texture2D* texture);
private:
static map<string,osg::ref_ptr<osg::Texture2D> > _textureMap;
// texture name to use in 2D and 3D instruments
_texture_path = _Instrument->getStringValue("radar-texture-path",
"Aircraft/Instruments/Textures/od_wxradar.rgb");
- _resultTexture = FGTextureManager::createTexture(_texture_path.c_str());
+ _resultTexture = FGTextureManager::createTexture(_texture_path.c_str(),
+ false);
SGPath tpath(globals->get_fg_root());
string path = _Instrument->getStringValue("echo-texture-path",
tpath.append(path);
// no mipmap or else alpha will mix with pixels on the border of shapes, ruining the effect
- _wxEcho = SGLoadTexture2D(tpath.c_str(), false, false);
+ _wxEcho = SGLoadTexture2D(tpath, false, false);
_Instrument->setFloatValue("trk", 0.0);