]> git.mxchange.org Git - simgear.git/commitdiff
Extend CanvasSystemAdapter to provide access to Nasal gcSave and gcRelease
authorThomas Geymayer <tomgey@gmail.com>
Wed, 21 Nov 2012 23:54:44 +0000 (00:54 +0100)
committerThomas Geymayer <tomgey@gmail.com>
Wed, 21 Nov 2012 23:54:56 +0000 (00:54 +0100)
simgear/canvas/CanvasSystemAdapter.hxx

index 91fc27400e370c0d121bafe953a70ebedf3a55d4..5dfa8ac3d5bc2bc0a3a8c3e3e5fe388510adbfd6 100644 (file)
@@ -20,6 +20,7 @@
 #define SG_CANVAS_SYSTEM_ADAPTER_HXX_
 
 #include "canvas_fwd.hxx"
+#include <simgear/nasal/naref.h>
 
 namespace simgear
 {
@@ -35,6 +36,18 @@ namespace canvas
       virtual void addCamera(osg::Camera* camera) const = 0;
       virtual void removeCamera(osg::Camera* camera) const = 0;
       virtual osg::Image* getImage(const std::string& path) const = 0;
+
+      /**
+       * Save passed reference to Nasal object from being deleted by the
+       * garbage collector.
+       */
+      virtual int gcSave(naRef r) = 0;
+
+      /**
+       * Release an object previously passed to ::gcSave to allow it being
+       * cleaned up by the garbage collector.
+       */
+      virtual void gcRelease(int key) = 0;
   };
 
 } // namespace canvas