X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCanvas%2Fcanvas_mgr.hxx;h=b14403491b9a1c7a182ce4df27dd34cf61942d0d;hb=733e3b3f0c8ed5c880b57e3175dd6e5e3fd0ce9c;hp=893b50e887e7fc77c094671034e27518611bbfef;hpb=1575fad886a0b18825363d41d53a287e8d36b9c8;p=flightgear.git diff --git a/src/Canvas/canvas_mgr.hxx b/src/Canvas/canvas_mgr.hxx index 893b50e88..b14403491 100644 --- a/src/Canvas/canvas_mgr.hxx +++ b/src/Canvas/canvas_mgr.hxx @@ -19,53 +19,35 @@ #ifndef CANVAS_MGR_H_ #define CANVAS_MGR_H_ -#include -#include - -#include -#include - -class Canvas; -typedef boost::shared_ptr CanvasPtr; +#include +#include class CanvasMgr: - public SGSubsystem, - public SGPropertyChangeListener + public simgear::canvas::CanvasMgr { public: CanvasMgr(); - virtual ~CanvasMgr(); virtual void init(); - virtual void reinit(); virtual void shutdown(); - virtual void bind(); - virtual void unbind(); - - virtual void update(double delta_time_sec); - - virtual void childAdded( SGPropertyNode * parent, - SGPropertyNode * child ); - virtual void childRemoved( SGPropertyNode * parent, - SGPropertyNode * child ); - - private: - - /** Root node for everything concerning the canvas system */ - SGPropertyNode_ptr _props; - - /** The actual canvases */ - std::vector _canvases; - - void textureAdded(SGPropertyNode* node); - /** - * Trigger a childAdded and valueChanged event for every child of node - * (Unlimited depth) and node itself. + * Get OpenGL texture name for given canvas + * + * @deprecated This was only meant to be used by the PUI CanvasWidget + * implementation as PUI can't handle osg::Texture objects. + * Use getCanvas(index)->getTexture() instead. + * + * @return OpenGL texture name */ - void triggerChangeRecursive(SGPropertyNode* node); + unsigned int getCanvasTexId(const simgear::canvas::CanvasPtr& canvas) const; + + protected: + + osg::observer_ptr _gui_camera; + SGPropertyChangeCallback _cb_model_reinit; + void handleModelReinit(SGPropertyNode*); }; #endif /* CANVAS_MGR_H_ */