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 <simgear/structure/SGReferenced.hxx>
27 namespace osg { class Texture; }
29 class SGSceneFeatures : public SGReferenced {
31 static SGSceneFeatures* instance();
33 enum TextureCompression {
41 void setTextureCompression(TextureCompression textureCompression)
42 { _textureCompression = textureCompression; }
43 TextureCompression getTextureCompression() const
44 { return _textureCompression; }
45 void setTextureCompression(osg::Texture* texture) const;
47 void setEnablePointSpriteLights(bool enable)
48 { _pointSpriteLights = enable; }
49 bool getEnablePointSpriteLights() const
51 return _pointSpriteLights;
53 bool getEnablePointSpriteLights(unsigned contextId) const
55 if (!_pointSpriteLights)
57 return getHavePointSprites(contextId);
60 void setEnableDistanceAttenuationLights(bool enable)
61 { _distanceAttenuationLights = enable; }
62 bool getEnableDistanceAttenuationLights(unsigned contextId) const
64 if (!_distanceAttenuationLights)
66 return getHavePointParameters(contextId);
69 void setEnableShaderLights(bool enable)
70 { _shaderLights = enable; }
71 bool getEnableShaderLights(unsigned contextId) const
75 return getHaveShaderPrograms(contextId);
78 void setTextureFilter(int max)
79 { _textureFilter = max; }
80 int getTextureFilter() const
81 { return _textureFilter; }
84 bool getHavePointSprites(unsigned contextId) const;
85 bool getHaveFragmentPrograms(unsigned contextId) const;
86 bool getHaveVertexPrograms(unsigned contextId) const;
87 bool getHaveShaderPrograms(unsigned contextId) const;
88 bool getHavePointParameters(unsigned contextId) const;
92 SGSceneFeatures(const SGSceneFeatures&);
93 SGSceneFeatures& operator=(const SGSceneFeatures&);
95 TextureCompression _textureCompression;
97 bool _pointSpriteLights;
98 bool _distanceAttenuationLights;