]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/tgdb/pt_lights.hxx
Only disable display lists if using VBOs.
[simgear.git] / simgear / scene / tgdb / pt_lights.hxx
index 5f831cbf47d4248cc42c24f1b64c7c5d36f45e2a..863328dc60bffafcd90500e4aca615bcc8e854e7 100644 (file)
 
 #include <simgear/math/sg_types.hxx>
 #include <simgear/scene/material/matlib.hxx>
+#include <simgear/scene/util/SGReaderWriterOptions.hxx>
 #include <simgear/scene/util/SGSceneFeatures.hxx>
 
 #include "SGLightBin.hxx"
 #include "SGDirectionalLightBin.hxx"
 
-using std::string;
-using std::vector;
+namespace simgear
+{
+class Effect;
+}
 
 // Specify the way we want to draw directional point lights (assuming the
 // appropriate extensions are available.)
@@ -59,28 +62,19 @@ inline void SGConfigureDirectionalLights( bool use_point_sprites,
   sceneFeatures->setEnableDistanceAttenuationLights(distance_attenuation);
 }
 
-class SGPointSpriteLightCullCallback : public osg::NodeCallback {
-public:
-  SGPointSpriteLightCullCallback(const osg::Vec3& da = osg::Vec3(1, 0.001, 0.0002),
-                                 float sz = 4);
-  SGPointSpriteLightCullCallback(osg::Point* point);
-
-  virtual void operator()(osg::Node* node, osg::NodeVisitor* nv);
-
-private:
-  osg::ref_ptr<osg::StateSet> _pointSpriteStateSet;
-  osg::ref_ptr<osg::StateSet> _distanceAttenuationStateSet;
-};
-
 class SGLightFactory {
 public:
 
-  static osg::Node*
-  getLight(const SGLightBin::Light& light);
+  static osg::Drawable*
+  getLightDrawable(const SGLightBin::Light& light);
 
-  static osg::Node*
-  getLight(const SGDirectionalLightBin::Light& light);
+  static osg::Drawable*
+  getLightDrawable(const SGDirectionalLightBin::Light& light);
 
+  /**
+   * Return a drawable for a very simple point light that isn't
+   * distance scaled.
+   */
   static osg::Drawable*
   getLights(const SGLightBin& lights, unsigned inc = 1, float alphaOff = 0);
 
@@ -92,10 +86,19 @@ public:
           const SGVec4f& red, const SGVec4f& white);
 
   static osg::Node*
-  getSequenced(const SGDirectionalLightBin& lights);
+  getSequenced(const SGDirectionalLightBin& lights, const simgear::SGReaderWriterOptions* options);
+
+  static osg::Node*
+  getOdal(const SGLightBin& lights, const simgear::SGReaderWriterOptions* options);
+
+  static osg::Node*
+  getHoldShort(const SGDirectionalLightBin& lights, const simgear::SGReaderWriterOptions* options);
 
   static osg::Node*
-  getOdal(const SGLightBin& lights);
+  getGuard(const SGDirectionalLightBin& lights, const simgear::SGReaderWriterOptions* options);
 };
 
+simgear::Effect* getLightEffect(float size, const osg::Vec3& attenuation,
+                                float minSize, float maxSize, bool directional,
+                                const simgear::SGReaderWriterOptions* options);
 #endif // _SG_PT_LIGHTS_HXX