X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fscene%2Ftgdb%2FShaderGeometry.hxx;h=30c72fbe0d3092a5f64d278f6d2ab054fcfb5ada;hb=3b5665fe92802d3d36d6304cb2c184dc03e91de4;hp=99f2c1e00eeaab36cf09a41684f4c0e158aa6b46;hpb=be616894586358a2804207bc984c5429dafdcc39;p=simgear.git diff --git a/simgear/scene/tgdb/ShaderGeometry.hxx b/simgear/scene/tgdb/ShaderGeometry.hxx index 99f2c1e0..30c72fbe 100644 --- a/simgear/scene/tgdb/ShaderGeometry.hxx +++ b/simgear/scene/tgdb/ShaderGeometry.hxx @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -38,9 +39,16 @@ namespace simgear class ShaderGeometry : public osg::Drawable { public: - ShaderGeometry() - { - setUseDisplayList(false); + ShaderGeometry() : + varieties(1) + { + setSupportsDisplayList(false); + } + + ShaderGeometry(int v) : + varieties(v) + { + setSupportsDisplayList(false); } /** Copy constructor using CopyOp to manage deep vs shallow copy.*/ @@ -48,31 +56,26 @@ class ShaderGeometry : public osg::Drawable osg::Drawable(ShaderGeometry,copyop) {} META_Object(flightgear, ShaderGeometry); - - typedef std::vector PositionSizeList; - + virtual void drawImplementation(osg::RenderInfo& renderInfo) const; virtual osg::BoundingBox computeBound() const; - - void setGeometry(osg::Drawable* geometry) + void setGeometry(osg::Geometry* geometry) { _geometry = geometry; } - void addTree(const osg::Vec3& position, float scale) - { - _trees.push_back(osg::Vec4(position, scale)); - } - - osg::ref_ptr _geometry; + void addObject(const osg::Vec3& position, float scale, int texture_index); + + osg::ref_ptr _geometry; - PositionSizeList _trees; + int varieties; + osg::ref_ptr _posScaleArray; + osg::ref_ptr _vertexAttribArray; protected: virtual ~ShaderGeometry() {} - }; }