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(unsigned contextId) const
51 if (!_pointSpriteLights)
53 return getHavePointSprites(contextId);
56 void setEnableDistanceAttenuationLights(bool enable)
57 { _distanceAttenuationLights = enable; }
58 bool getEnableDistanceAttenuationLights(unsigned contextId) const
60 if (!_distanceAttenuationLights)
62 return getHavePointParameters(contextId);
65 void setEnableShaderLights(bool enable)
66 { _shaderLights = enable; }
67 bool getEnableShaderLights(unsigned contextId) const
71 return getHaveShaderPrograms(contextId);
74 void setTextureFilter(int max)
75 { _textureFilter = max; }
76 int getTextureFilter() const
77 { return _textureFilter; }
80 bool getHavePointSprites(unsigned contextId) const;
81 bool getHaveFragmentPrograms(unsigned contextId) const;
82 bool getHaveVertexPrograms(unsigned contextId) const;
83 bool getHaveShaderPrograms(unsigned contextId) const;
84 bool getHavePointParameters(unsigned contextId) const;
88 SGSceneFeatures(const SGSceneFeatures&);
89 SGSceneFeatures& operator=(const SGSceneFeatures&);
91 TextureCompression _textureCompression;
93 bool _pointSpriteLights;
94 bool _distanceAttenuationLights;