Compositor: Add resetOrderOffset()

To allow for custom compositors and passes created by C++ code alongside
those created by Compositor::create(), add a resetOrderOffset() function
which resets _order_offset back to zero. This will allow FlightGear to
prevent repeated compositor reloads from increasing _order_offset
indefinitely, which soon results in render orders beyond those set
statically for the GUI and upcoming VR mirror compositors.
This commit is contained in:
James Hogan 2021-09-11 16:32:18 +01:00
parent a68a0b1ccb
commit d4496d3b2c
No known key found for this signature in database
GPG Key ID: 35CEE4862B1023F2

View File

@ -137,6 +137,7 @@ public:
Pass * getPass(const std::string &name) const; Pass * getPass(const std::string &name) const;
int getOrderOffset() const { return _order_offset; } int getOrderOffset() const { return _order_offset; }
static void resetOrderOffset() { _order_offset = 0; }
protected: protected:
osg::View *_view; osg::View *_view;
osg::GraphicsContext *_gc; osg::GraphicsContext *_gc;