diff options
-rw-r--r-- | CMakeLists.txt | 10 | ||||
-rw-r--r-- | src/uscxml/concurrency/tinythread.h | 1 | ||||
-rw-r--r-- | src/uscxml/plugins/invoker/graphics/openscenegraph/CompositeDisplay.cpp | 14 | ||||
-rw-r--r-- | src/uscxml/plugins/invoker/graphics/openscenegraph/CompositeDisplay.h | 1 |
4 files changed, 23 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 31fb7c3..e9ce992 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -306,6 +306,7 @@ elseif(WIN32) endif() # prefer rest as static libraries +set(CMAKE_FIND_LIBRARY_SUFFIXES_ORIG ${CMAKE_FIND_LIBRARY_SUFFIXES}) set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) ################################ @@ -519,13 +520,17 @@ endif() # OpenSceneGraph invoker +set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) # link dynamically! -find_package(OpenSceneGraph COMPONENTS osgDB osgGA osgUtil osgText osgFX osgManipulator osgViewer OpenThreads) +find_package(OpenSceneGraph COMPONENTS osgViewer osgGA osgText osgFX osgManipulator osgDB osgUtil OpenThreads) if (OPENSCENEGRAPH_FOUND) + set(CAN_BUILD_OPENSCENEGRAPH_INVOKER ON) + include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS}) file(GLOB_RECURSE OPENSCENEGRAPH_INVOKER src/uscxml/plugins/invoker/graphics/openscenegraph/*.cpp src/uscxml/plugins/invoker/graphics/openscenegraph/*.h) + if (BUILD_AS_PLUGINS) add_library( invoker_openscenegraph SHARED @@ -538,9 +543,10 @@ if (OPENSCENEGRAPH_FOUND) list (APPEND USCXML_FILES ${OPENSCENEGRAPH_INVOKER}) list (APPEND USCXML_OPT_LIBS ${OPENSCENEGRAPH_LIBRARIES}) endif() - endif() +set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) + # MILES modality components diff --git a/src/uscxml/concurrency/tinythread.h b/src/uscxml/concurrency/tinythread.h index 18823c3..537cc04 100644 --- a/src/uscxml/concurrency/tinythread.h +++ b/src/uscxml/concurrency/tinythread.h @@ -82,6 +82,7 @@ freely, subject to the following restrictions: #include <sched.h> #include <unistd.h> #include <sys/time.h> +#include <inttypes.h> #endif // Generic includes diff --git a/src/uscxml/plugins/invoker/graphics/openscenegraph/CompositeDisplay.cpp b/src/uscxml/plugins/invoker/graphics/openscenegraph/CompositeDisplay.cpp index c9b00b6..d7e247b 100644 --- a/src/uscxml/plugins/invoker/graphics/openscenegraph/CompositeDisplay.cpp +++ b/src/uscxml/plugins/invoker/graphics/openscenegraph/CompositeDisplay.cpp @@ -1,4 +1,11 @@ #include "CompositeDisplay.h" +#if 0 +#ifdef MACOSX +USE_GRAPICSWINDOW_IMPLEMENTATION(Cocoa) +#else +USE_GRAPHICSWINDOW() +#endif +#endif CompositeDisplay::CompositeDisplay(unsigned int x, unsigned int y, @@ -113,5 +120,10 @@ osg::GraphicsContext::WindowingSystemInterface* CompositeDisplay::wsi = NULL; void CompositeDisplay::getResolution(unsigned int& width, unsigned int& height, int screenId) { if (!wsi) wsi = osg::GraphicsContext::getWindowingSystemInterface(); - wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(screenId), width, height); + if (wsi) { + wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(screenId), width, height); + } else { + width = 800; + height = 600; + } } diff --git a/src/uscxml/plugins/invoker/graphics/openscenegraph/CompositeDisplay.h b/src/uscxml/plugins/invoker/graphics/openscenegraph/CompositeDisplay.h index 51e17c1..0d08c7f 100644 --- a/src/uscxml/plugins/invoker/graphics/openscenegraph/CompositeDisplay.h +++ b/src/uscxml/plugins/invoker/graphics/openscenegraph/CompositeDisplay.h @@ -3,6 +3,7 @@ #include "uscxml/concurrency/tinythread.h" #include <osgGA/TrackballManipulator> +#include <osgViewer/Viewer> #include <osgViewer/CompositeViewer> #include <osgViewer/ViewerEventHandlers> #include <osgGA/StateSetManipulator> |