X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCanvas%2Fcanvas.hxx;h=2071452997cb88364f9c091a5523b4dd274df985;hb=4994973ef4d5a079acf76267b525313c15376478;hp=29d9ee93e04d368bfb9af56fde5d71b3f2d8b2e5;hpb=6110139197f594f7703cb52235f1de63feb68745;p=flightgear.git diff --git a/src/Canvas/canvas.hxx b/src/Canvas/canvas.hxx index 29d9ee93e..207145299 100644 --- a/src/Canvas/canvas.hxx +++ b/src/Canvas/canvas.hxx @@ -23,10 +23,11 @@ #include "property_based_element.hxx" #include -#include +#include #include #include +#include #include #include @@ -66,6 +67,7 @@ class Canvas: virtual void operator()(osg::Node* node, osg::NodeVisitor* nv); }; typedef osg::ref_ptr CameraCullCallbackPtr; + typedef osg::observer_ptr CameraCullCallbackWeakPtr; /** * This callback is installed on every placement of the canvas in the @@ -78,12 +80,17 @@ class Canvas: CullCallback(CameraCullCallback* camera_cull); private: - CameraCullCallback *_camera_cull; + CameraCullCallbackWeakPtr _camera_cull; virtual void operator()(osg::Node* node, osg::NodeVisitor* nv); }; typedef osg::ref_ptr CullCallbackPtr; + /** + * Callback for resetting the render_dirty flag after rendering a frame. + */ + class DrawCallback; + Canvas(SGPropertyNode* node); virtual ~Canvas(); @@ -91,10 +98,10 @@ class Canvas: int getSizeX() const { return _size_x; } - + int getSizeY() const { return _size_y; } - + void setSizeX(int sx); void setSizeY(int sy); @@ -140,7 +147,8 @@ class Canvas: _mouse_event; bool _sampling_dirty, - _color_dirty; + _color_dirty, + _render_dirty; FGODGauge _texture; std::auto_ptr _root_group;