X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fscene%2Ftgdb%2FShaderGeometry.hxx;h=30c72fbe0d3092a5f64d278f6d2ab054fcfb5ada;hb=3b5665fe92802d3d36d6304cb2c184dc03e91de4;hp=78eb1d4f75f1fbb47b09bbf78bd1198dc59b57e4;hpb=4b63bc051e701835a12f6f1eca5437b6abd58593;p=simgear.git diff --git a/simgear/scene/tgdb/ShaderGeometry.hxx b/simgear/scene/tgdb/ShaderGeometry.hxx index 78eb1d4f..30c72fbe 100644 --- a/simgear/scene/tgdb/ShaderGeometry.hxx +++ b/simgear/scene/tgdb/ShaderGeometry.hxx @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -38,41 +39,43 @@ 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.*/ ShaderGeometry(const ShaderGeometry& ShaderGeometry,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY): osg::Drawable(ShaderGeometry,copyop) {} - META_Object(osg,ShaderGeometry); - - typedef std::vector PositionSizeList; - + META_Object(flightgear, ShaderGeometry); + virtual void drawImplementation(osg::RenderInfo& renderInfo) const; virtual osg::BoundingBox computeBound() const; - void setGeometry(osg::Geometry* geometry) { _geometry = geometry; } - void addTree(const osg::Vec3& position, float scale) - { - _trees.push_back(osg::Vec4(position, scale)); - } - + 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() {} - }; }