/* osgEarth
 * Copyright 2025 Pelican Mapping
 * MIT License
 */
#include <osg/Drawable>
#include <osg/RenderInfo>
#include <osg/Version>
#include <osgEarth/NativeProgramAdapter>
#include <vector>
#include <map>

namespace osgEarth { namespace SilverLining
{
    class SilverLiningContext;
	class SilverLiningContextNode;

    /**
     * Custom drawable for rendering the SilverLining clouds
     */
    class CloudsDrawable : public osg::Drawable
    {
    public:
        CloudsDrawable(SilverLiningContextNode* contexNode =0L);
        META_Object(osgEarth::SilverLining, CloudsDrawable);

		/* Sets whether to draw this item */
		void setDraw(bool draw);
     
    public: // osg::Drawable

        // custom draw (called with an active GC)
        void drawImplementation(osg::RenderInfo& ri) const;
        
        // custom bounds computation
        osg::BoundingBox computeBoundingBox() const;

    protected:
        virtual ~CloudsDrawable() { }

        osg::observer_ptr<SilverLiningContext> _SL;
		SilverLiningContextNode* _contextNode;

        mutable osg::buffered_object<osgEarth::Util::NativeProgramAdapterCollection> _adapters;
        
        CloudsDrawable(const CloudsDrawable& copy, const osg::CopyOp& op=osg::CopyOp::SHALLOW_COPY) { }
    };

} } // namespace osgEarth::SilverLining
