00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef SG_SCENE_FEATURES_HXX
00023 #define SG_SCENE_FEATURES_HXX
00024
00025 #include <simgear/structure/SGReferenced.hxx>
00026
00027 namespace osg { class Texture; }
00028
00029 class SGSceneFeatures : public SGReferenced {
00030 public:
00031 static SGSceneFeatures* instance();
00032
00033 enum TextureCompression {
00034 DoNotUseCompression,
00035 UseARBCompression,
00036 UseDXT1Compression,
00037 UseDXT3Compression,
00038 UseDXT5Compression
00039 };
00040
00041 void setTextureCompression(TextureCompression textureCompression)
00042 { _textureCompression = textureCompression; }
00043 TextureCompression getTextureCompression() const
00044 { return _textureCompression; }
00045 void setTextureCompression(osg::Texture* texture) const;
00046
00047 void setEnablePointSpriteLights(bool enable)
00048 { _pointSpriteLights = enable; }
00049 bool getEnablePointSpriteLights(unsigned contextId) const
00050 {
00051 if (!_pointSpriteLights)
00052 return false;
00053 return getHavePointSprites(contextId);
00054 }
00055
00056 void setEnableDistanceAttenuationLights(bool enable)
00057 { _distanceAttenuationLights = enable; }
00058 bool getEnableDistanceAttenuationLights(unsigned contextId) const
00059 {
00060 if (!_distanceAttenuationLights)
00061 return false;
00062 return getHavePointParameters(contextId);
00063 }
00064
00065 void setEnableShaderLights(bool enable)
00066 { _shaderLights = enable; }
00067 bool getEnableShaderLights(unsigned contextId) const
00068 {
00069 if (!_shaderLights)
00070 return false;
00071 return getHaveShaderPrograms(contextId);
00072 }
00073
00074 void setTextureFilter(int max)
00075 { _textureFilter = max; }
00076 int getTextureFilter() const
00077 { return _textureFilter; }
00078
00079 protected:
00080 bool getHavePointSprites(unsigned contextId) const;
00081 bool getHaveFragmentPrograms(unsigned contextId) const;
00082 bool getHaveVertexPrograms(unsigned contextId) const;
00083 bool getHaveShaderPrograms(unsigned contextId) const;
00084 bool getHavePointParameters(unsigned contextId) const;
00085
00086 private:
00087 SGSceneFeatures();
00088 SGSceneFeatures(const SGSceneFeatures&);
00089 SGSceneFeatures& operator=(const SGSceneFeatures&);
00090
00091 TextureCompression _textureCompression;
00092 bool _shaderLights;
00093 bool _pointSpriteLights;
00094 bool _distanceAttenuationLights;
00095 int _textureFilter;
00096 };
00097
00098 #endif