3 * Copyright (C) 2006-2007 Mathias Froehlich
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of the
8 * License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
22 #ifndef SG_SCENE_FEATURES_HXX
23 #define SG_SCENE_FEATURES_HXX
25 #include <OpenThreads/Mutex>
27 #include <simgear/structure/SGReferenced.hxx>
29 namespace osg { class Texture; }
31 class SGSceneFeatures : public SGReferenced {
33 static SGSceneFeatures* instance();
35 enum TextureCompression {
43 void setTextureCompression(TextureCompression textureCompression)
44 { _textureCompression = textureCompression; }
45 TextureCompression getTextureCompression() const
46 { return _textureCompression; }
47 void setTextureCompression(osg::Texture* texture) const;
49 void setEnablePointSpriteLights(bool enable)
50 { _pointSpriteLights = enable; }
51 bool getEnablePointSpriteLights(unsigned contextId) const
53 if (!_pointSpriteLights)
55 return getHavePointSprites(contextId);
58 void setEnableDistanceAttenuationLights(bool enable)
59 { _distanceAttenuationLights = enable; }
60 bool getEnableDistanceAttenuationLights(unsigned contextId) const
62 if (!_distanceAttenuationLights)
64 return getHavePointParameters(contextId);
67 void setEnableShaderLights(bool enable)
68 { _shaderLights = enable; }
69 bool getEnableShaderLights(unsigned contextId) const
73 return getHaveShaderPrograms(contextId);
76 void setTextureFilter( int max)
77 { _textureFilter = max; }
78 int getTextureFilter() const {
79 return _textureFilter;
83 bool getHavePointSprites(unsigned contextId) const;
84 bool getHaveFragmentPrograms(unsigned contextId) const;
85 bool getHaveVertexPrograms(unsigned contextId) const;
86 bool getHaveShaderPrograms(unsigned contextId) const;
87 bool getHavePointParameters(unsigned contextId) const;
91 SGSceneFeatures(const SGSceneFeatures&);
92 SGSceneFeatures& operator=(const SGSceneFeatures&);
94 TextureCompression _textureCompression;
96 bool _pointSpriteLights;
97 bool _distanceAttenuationLights;
100 static OpenThreads::Mutex _instanceMutex;