]> git.mxchange.org Git - simgear.git/commitdiff
Remove OpenVG dependency from header file
authorThomas Geymayer <tomgey@gmail.com>
Sun, 4 Nov 2012 18:21:33 +0000 (19:21 +0100)
committerThomas Geymayer <tomgey@gmail.com>
Sun, 4 Nov 2012 18:21:33 +0000 (19:21 +0100)
simgear/canvas/CMakeLists.txt
simgear/canvas/VGInitOperation.cxx [new file with mode: 0644]
simgear/canvas/VGInitOperation.hxx

index 2110c9e155b1dc2cf6a9f99b4def0363ba5b55fc..1fa496b6613b84e38d4f2dd523e32370d593b9cf 100644 (file)
@@ -16,6 +16,7 @@ set(SOURCES
   CanvasMgr.cxx
   CanvasPlacement.cxx
   ODGauge.cxx
+  VGInitOperation.cxx
 )
 
 add_subdirectory(ShivaVG/src)
diff --git a/simgear/canvas/VGInitOperation.cxx b/simgear/canvas/VGInitOperation.cxx
new file mode 100644 (file)
index 0000000..e8fefe7
--- /dev/null
@@ -0,0 +1,47 @@
+// osg::Operation to initialize the OpenVG context used for path rendering
+//
+// Copyright (C) 2012  Thomas Geymayer <tomgey@gmail.com>
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA
+
+#include "VGInitOperation.hxx"
+#include <vg/openvg.h>
+
+namespace simgear
+{
+namespace canvas
+{
+
+  //----------------------------------------------------------------------------
+  VGInitOperation::VGInitOperation():
+    GraphicsOperation("canvas::VGInit", false)
+  {
+
+  }
+
+
+  //----------------------------------------------------------------------------
+  virtual void VGInitOperation::operator()(osg::GraphicsContext* context)
+  {
+    GLint vp[4];
+    glGetIntegerv(GL_VIEWPORT, vp);
+
+    // ATTENTION: If using another OpenVG implementation ensure it doesn't
+    //            change any OpenGL state!
+    vgCreateContextSH(vp[2], vp[3]);
+  }
+
+} // namespace canvas
+} // namespace simgear
index b18ace17e3be14db4f136bb2f75c503dc659976b..3b9c6436ae866bfd09d1e73ac2d36aaa7149a1c6 100644 (file)
@@ -19,7 +19,6 @@
 #ifndef CANVAS_VG_INITOPERATION_HXX_
 #define CANVAS_VG_INITOPERATION_HXX_
 
-#include <vg/openvg.h>
 #include <osg/GraphicsThread>
 
 namespace simgear
@@ -37,20 +36,8 @@ namespace canvas
   {
     public:
 
-      VGInitOperation():
-        GraphicsOperation("canvas::VGInit", false)
-      {}
-
-      virtual void operator()(osg::GraphicsContext* context)
-      {
-        GLint vp[4];
-        glGetIntegerv(GL_VIEWPORT, vp);
-
-        // ATTENTION: If using another OpenVG implementation ensure it doesn't
-        //            change any OpenGL state!
-        vgCreateContextSH(vp[2], vp[3]);
-      }
-
+      VGInitOperation();
+      virtual void operator()(osg::GraphicsContext* context);
   };
 
 } // namespace canvas