diff --git a/applications/CMakeLists.txt b/applications/CMakeLists.txt index 3cb567509..ab491c606 100644 --- a/applications/CMakeLists.txt +++ b/applications/CMakeLists.txt @@ -38,5 +38,6 @@ ELSE() ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC) ADD_SUBDIRECTORY(osgversion) + ADD_SUBDIRECTORY(present3D) ENDIF() diff --git a/applications/present3D/CMakeLists.txt b/applications/present3D/CMakeLists.txt index bfe76afc6..3c30baa09 100644 --- a/applications/present3D/CMakeLists.txt +++ b/applications/present3D/CMakeLists.txt @@ -54,8 +54,24 @@ ENDIF() SET(TARGET_ADDED_LIBRARIES osgVolume osgFX) -IF (WIN32) - SET(TARGET_EXTERNAL_LIBRARIES ${TARGET_EXTERNAL_LIBRARIES} ws2_32) +IF (NOT DYNAMIC_OPENSCENEGRAPH) + SET(TARGET_ADDED_LIBRARIES + ${TARGET_ADDED_LIBRARIES} + osgdb_ive + osgdb_freetype + osgdb_openflight + osgdb_osg + osgdb_rgb + osgdb_jpeg + osgdb_png + osgdb_ffmpeg + ) ENDIF() +IF (WIN32) + # to support cluster code + SET(TARGET_EXTERNAL_LIBRARIES ${TARGET_EXTERNAL_LIBRARIES} ws2_32) +ENDIF() + + SETUP_APPLICATION(present3D-osg) diff --git a/applications/present3D/ReaderWriterP3D.cpp b/applications/present3D/ReaderWriterP3D.cpp index 199871e5d..fde58a5cd 100644 --- a/applications/present3D/ReaderWriterP3D.cpp +++ b/applications/present3D/ReaderWriterP3D.cpp @@ -207,8 +207,10 @@ public: }; -// Register with Registry to instantiate the above reader/writer. -osgDB::RegisterReaderWriterProxy g_readerWriter_P3DXML_Proxy; +// now register with Registry to instantiate the above +// reader/writer. +REGISTER_OSGPLUGIN(p3d, ReaderWriterP3DXML) + std::string ReaderWriterP3DXML::expandEnvVarsInFileName(const std::string& filename) const { diff --git a/applications/present3D/ReaderWriterPaths.cpp b/applications/present3D/ReaderWriterPaths.cpp index d5e79d9ca..5984274df 100644 --- a/applications/present3D/ReaderWriterPaths.cpp +++ b/applications/present3D/ReaderWriterPaths.cpp @@ -70,8 +70,10 @@ public: virtual osgDB::ReaderWriter::ReadResult read_rotation_path(std::istream& fin, const osgDB::Options* options) const; }; -// Register with Registry to instantiate the above reader/writer. -osgDB::RegisterReaderWriterProxy g_readerWriter_PathsL_Proxy; +// now register with Registry to instantiate the above +// reader/writer. +REGISTER_OSGPLUGIN(paths, ReaderWriterPaths) + osgDB::ReaderWriter::ReadResult ReaderWriterPaths::readObject(const std::string& file, const osgDB::Options* options) const { diff --git a/applications/present3D/present3D.cpp b/applications/present3D/present3D.cpp index 2eefc3399..5acc9ca78 100644 --- a/applications/present3D/present3D.cpp +++ b/applications/present3D/present3D.cpp @@ -54,6 +54,26 @@ #include "SDLIntegration.h" #endif +#if OSG_LIBRARY_STATIC + + // include the plugins we need + USE_OSGPLUGIN(ive) + USE_OSGPLUGIN(freetype) + USE_OSGPLUGIN(osg) + USE_OSGPLUGIN(rgb) + USE_OSGPLUGIN(OpenFlight) + USE_OSGPLUGIN(png) + USE_OSGPLUGIN(jpeg) + USE_OSGPLUGIN(ffmpeg) + + USE_OSGPLUGIN(p3d) + USE_OSGPLUGIN(paths) + + // include the platform specific GraphicsWindow implementation. + USE_GRAPHICSWINDOW() + +#endif + static const char* s_version = "1.3"; void setViewer(osgViewer::Viewer& viewer, float width, float height, float distance) diff --git a/src/osgPlugins/p3d/ReaderWriterP3D.cpp b/src/osgPlugins/p3d/ReaderWriterP3D.cpp index 14eafef2a..498762a92 100644 --- a/src/osgPlugins/p3d/ReaderWriterP3D.cpp +++ b/src/osgPlugins/p3d/ReaderWriterP3D.cpp @@ -207,8 +207,10 @@ public: }; -// Register with Registry to instantiate the above reader/writer. -osgDB::RegisterReaderWriterProxy g_readerWriter_P3DXML_Proxy; +// now register with Registry to instantiate the above +// reader/writer. +REGISTER_OSGPLUGIN(p3d, ReaderWriterP3DXML) + std::string ReaderWriterP3DXML::expandEnvVarsInFileName(const std::string& filename) const { diff --git a/src/osgPlugins/p3d/ReaderWriterPaths.cpp b/src/osgPlugins/p3d/ReaderWriterPaths.cpp index d5e79d9ca..4888aab95 100644 --- a/src/osgPlugins/p3d/ReaderWriterPaths.cpp +++ b/src/osgPlugins/p3d/ReaderWriterPaths.cpp @@ -70,8 +70,9 @@ public: virtual osgDB::ReaderWriter::ReadResult read_rotation_path(std::istream& fin, const osgDB::Options* options) const; }; -// Register with Registry to instantiate the above reader/writer. -osgDB::RegisterReaderWriterProxy g_readerWriter_PathsL_Proxy; +// now register with Registry to instantiate the above +// reader/writer. +REGISTER_OSGPLUGIN(paths, ReaderWriterPaths) osgDB::ReaderWriter::ReadResult ReaderWriterPaths::readObject(const std::string& file, const osgDB::Options* options) const {