]> git.mxchange.org Git - simgear.git/commitdiff
Use simgear internal stuff for the singleton class.
authorMathias Froehlich <Mathias.Froehlich@web.de>
Sat, 3 Mar 2012 13:10:37 +0000 (14:10 +0100)
committerMathias Froehlich <Mathias.Froehlich@web.de>
Sat, 3 Mar 2012 13:39:39 +0000 (14:39 +0100)
This removes the other still present dependency on osg
in the future sgcore library.
It also remove the need for the NO_OPENSCENEGRAPH_INTERFACE
compile time definition.

CMakeLists.txt
simgear/CMakeLists.txt
simgear/simgear_config_cmake.h.in
simgear/structure/Singleton.hxx

index f1e985adbf15f4850ba2c9830d23cba50f8e2074..281b366f5c3a984bfb5c161622cf25d527061566 100644 (file)
@@ -115,7 +115,6 @@ find_package(Threads REQUIRED)
 
 if(SIMGEAR_HEADLESS)
     message(STATUS "headless mode")
-    set(NO_OPENSCENEGRAPH_INTERFACE 1)
 else()
     find_package(OpenGL REQUIRED)
     find_package(OpenAL REQUIRED)
index 096a800c6a19760f1b356e7eec869ddf76f87742..3ad734fa1ab7cfa13cd712d236eff9312bbbc49a 100644 (file)
@@ -46,7 +46,6 @@ if(SIMGEAR_SHARED)
     get_property(publicHeaders GLOBAL PROPERTY PUBLIC_HEADERS)
 
     add_library(SimGearCore SHARED ${coreSources})
-    set_property(TARGET SimGearCore PROPERTY COMPILE_FLAGS "-DNO_OPENSCENEGRAPH_INTERFACE=1")
 
   # set_property(TARGET SimGearCore PROPERTY FRAMEWORK 1)
   #  message(STATUS "public header: ${publicHeaders}")
index a1192283281103dd0525e9338a46b9f73aa8181f..563f9f7355416c0387883bbd6a6a3734a0c55e5b 100644 (file)
@@ -17,6 +17,3 @@
 #cmakedefine HAVE_LIBSVN_CLIENT_1
 
 #cmakedefine GCC_ATOMIC_BUILTINS_FOUND
-
-// set if building headless (no OSG or OpenGL libs)
-#cmakedefine NO_OPENSCENEGRAPH_INTERFACE
index 35c712a28f66c0194f4fec8b8f3c9e26bb1001c2..dda5f78ccb96773db6d38932a49a91e353f90f15 100644 (file)
@@ -3,10 +3,8 @@
 
 #include "singleton.hpp"
 
-#ifndef NO_OPENSCENEGRAPH_INTERFACE
-#include <osg/Referenced>
-#include <osg/ref_ptr>
-#endif
+#include "SGReferenced.hxx"
+#include "SGSharedPtr.hxx"
 
 namespace simgear
 {
@@ -29,7 +27,6 @@ public:
     }
 };
 
-#ifndef NO_OPENSCENEGRAPH_INTERFACE
 template <typename RefClass>
 class SingletonRefPtr
 {
@@ -45,11 +42,11 @@ public:
         return singleton.ptr.get();
     }
 private:
-    osg::ref_ptr<RefClass> ptr;
+    SGSharedPtr<RefClass> ptr;
 };
 
 template <typename RefClass>
-class ReferencedSingleton : public virtual osg::Referenced
+class ReferencedSingleton : public virtual SGReferenced
 {
 public:
     static RefClass* instance()
@@ -57,7 +54,6 @@ public:
         return SingletonRefPtr<RefClass>::instance();
     }
 };
-#endif // of NO_OPENSCENEGRAPH_INTERFACE
 
 }
 #endif