X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCanvas%2Fcanvas_mgr.hxx;h=b14403491b9a1c7a182ce4df27dd34cf61942d0d;hb=b0dcb657e77579ecc79798ff365737095f96f9e2;hp=b3b5bac0e5328b1e7fd62f313c6f54b804a81a7a;hpb=d82fd7cc5fd4b25bf01f7fe129c7c4d7ea34dc1d;p=flightgear.git diff --git a/src/Canvas/canvas_mgr.hxx b/src/Canvas/canvas_mgr.hxx index b3b5bac0e..b14403491 100644 --- a/src/Canvas/canvas_mgr.hxx +++ b/src/Canvas/canvas_mgr.hxx @@ -19,58 +19,35 @@ #ifndef CANVAS_MGR_H_ #define CANVAS_MGR_H_ -#include -#include - -#include -#include - -class Canvas; +#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; - /** - * Get the value of a property or throw an exception if it doesn't exist. - */ - template - T getParam(const SGPropertyNode* node, const char* prop); + protected: + + osg::observer_ptr _gui_camera; + SGPropertyChangeCallback _cb_model_reinit; + void handleModelReinit(SGPropertyNode*); }; #endif /* CANVAS_MGR_H_ */