diff --git a/doc/Changelog.md b/doc/Changelog.md index 589fca1ab7..865c083cc2 100644 --- a/doc/Changelog.md +++ b/doc/Changelog.md @@ -3,6 +3,8 @@ Changelog {#Changelog} # git master +* [619](https://github.com/Eyescale/Equalizer/pull/619) + Fix running from an installed version * [611](https://github.com/Eyescale/Equalizer/pull/611) Add eq::getHelp(), eq::Client::getHelp() and seq::Application::getHelp(), improve help for all applications diff --git a/eq/CMakeLists.txt b/eq/CMakeLists.txt index 417ee466a1..da76a4c281 100644 --- a/eq/CMakeLists.txt +++ b/eq/CMakeLists.txt @@ -2,11 +2,9 @@ include_directories(SYSTEM ${OPENGL_INCLUDE_DIR} ${GLEW_MX_INCLUDE_DIRS}) -install(FILES DESTINATION include/eq COMPONENT dev) +list(APPEND CPPCHECK_EXTRA_ARGS -DEQ_API=) -list(APPEND CPPCHECK_EXTRA_ARGS -DEQUALIZER_DSO_NAME=foo -DEQ_API=) - -add_definitions(-DEQ_PLUGIN_BUILD -DBOOST_PROGRAM_OPTIONS_DYN_LINK) +add_definitions(-DBOOST_PROGRAM_OPTIONS_DYN_LINK) set(EQUALIZER_PUBLIC_HEADERS agl/eventHandler.h @@ -21,9 +19,6 @@ set(EQUALIZER_PUBLIC_HEADERS client.h commandQueue.h compositor.h - compressor/compressor.h - compressor/compressorReadDrawPixels.h - compressor/compressorYUV.h config.h configStatistics.h eq.h @@ -151,9 +146,6 @@ set(EQUALIZER_SOURCES windowStatistics.cpp windowSystem.cpp worker.cpp - compressor/compressor.cpp - compressor/compressorReadDrawPixels.cpp - compressor/compressorYUV.cpp ) set(EQUALIZER_LINK_LIBRARIES @@ -275,8 +267,8 @@ target_compile_definitions(Equalizer PRIVATE EQUALIZERFABRIC_SHARED_INL) if(CMAKE_COMPILER_IS_CLANG) target_compile_options(Equalizer PUBLIC -Wno-overloaded-virtual) endif() -add_dependencies(Equalizer EqualizerServer) # dlopen'ed +add_subdirectory(compressor) add_subdirectory(fabric) add_subdirectory(server) add_subdirectory(admin) diff --git a/eq/compressor/CMakeLists.txt b/eq/compressor/CMakeLists.txt new file mode 100644 index 0000000000..aacfaaa546 --- /dev/null +++ b/eq/compressor/CMakeLists.txt @@ -0,0 +1,21 @@ +# Copyright (c) 2017 Stefan.Eilemann@epfl.ch + +include_directories(SYSTEM ${OPENGL_INCLUDE_DIR} ${GLEW_MX_INCLUDE_DIRS}) + +add_definitions(-DEQ_PLUGIN_BUILD) + +set(EQUALIZERCOMPRESSOR_HEADERS + compressor.h + compressorReadDrawPixels.h + compressorYUV.h + ) + +set(EQUALIZERCOMPRESSOR_SOURCES + compressor.cpp + compressorReadDrawPixels.cpp + compressorYUV.cpp + ) + +set(EQUALIZERCOMPRESSOR_LINK_LIBRARIES PRIVATE Equalizer Pression) + +common_library(EqualizerCompressor) diff --git a/eq/compressor/compressor.cpp b/eq/compressor/compressor.cpp index bdc93fecca..fc40cdd75b 100644 --- a/eq/compressor/compressor.cpp +++ b/eq/compressor/compressor.cpp @@ -80,6 +80,8 @@ void Compressor::registerEngine( const Compressor::Functions& functions ) size_t EqCompressorGetNumCompressors() { + if( !eq::plugin::_functions ) + return 0; return eq::plugin::_functions->size(); } diff --git a/eq/compressor/compressorYUV.cpp b/eq/compressor/compressorYUV.cpp index 7bcb67f2ac..c309fb1f99 100644 --- a/eq/compressor/compressorYUV.cpp +++ b/eq/compressor/compressorYUV.cpp @@ -138,13 +138,23 @@ void CompressorYUV::_compress( const GLEWContext* glewContext, if ( _fbo ) { - LBCHECK( _fbo->resize( outDims[1], outDims[3] )); + const auto error = _fbo->resize( outDims[1], outDims[3] ); + if( error != ERROR_NONE ) + { + LBERROR << "FBO resize failed: " << error << std::endl; + return; + } _fbo->bind(); } else { _fbo = new util::FrameBufferObject( glewContext ); - LBCHECK( _fbo->init( outDims[1], outDims[3], GL_RGBA, 0, 0 )); + const auto error = _fbo->init( outDims[1], outDims[3], GL_RGBA, 0, 0 ); + if( error != ERROR_NONE ) + { + LBERROR << "FBO init failed: " << error << std::endl; + return; + } } _texture->bind(); diff --git a/eq/init.cpp b/eq/init.cpp index df765b1e37..009276e18f 100644 --- a/eq/init.cpp +++ b/eq/init.cpp @@ -144,7 +144,7 @@ bool exit() if( --_initialized > 0 ) // not last return true; - BOOST_FOREACH( WindowSystemIF* windowSystem, _windowSystems ) + for( WindowSystemIF* windowSystem : _windowSystems ) delete windowSystem; _windowSystems.clear(); @@ -296,25 +296,6 @@ void _initPlugins() const char* home = getenv( "HOME" ); if( home ) plugins.loadDirectory( std::string( home ) + "/.eqPlugins" ); - -#ifdef EQUALIZER_DSO_NAME - plugins.loadFile( EQUALIZER_DSO_NAME ); - std::string absDSO = std::string( EQ_BUILD_DIR ) + "lib/" + - EQUALIZER_DSO_NAME; - plugins.loadFile( absDSO ); - -# ifdef NDEBUG - absDSO = std::string( EQ_BUILD_DIR ) + "lib/Release/" + EQUALIZER_DSO_NAME; -# else - absDSO = std::string( EQ_BUILD_DIR ) + "lib/Debug/" + EQUALIZER_DSO_NAME; -# endif - - plugins.loadFile( absDSO ); -#else -# ifndef NDEBUG -# error "EQUALIZER_DSO_NAME not defined" -# endif -#endif } Config* getConfig( const int argc, char** argv ) diff --git a/eq/windowSystem.cpp b/eq/windowSystem.cpp index 0895a06005..b5ceb49d25 100644 --- a/eq/windowSystem.cpp +++ b/eq/windowSystem.cpp @@ -1,5 +1,5 @@ -/* Copyright (c) 2007-2015, Stefan Eilemann +/* Copyright (c) 2007-2017, Stefan Eilemann * Daniel Pfeifer * Daniel Nachbaur * @@ -28,12 +28,18 @@ namespace eq { -static WindowSystemIF* _stack = 0; +namespace +{ + std::vector< WindowSystemIF* >& _getRegistry() + { + static std::vector< WindowSystemIF* > registry; + return registry; + } +} WindowSystemIF::WindowSystemIF() - : _next( _stack ) { - _stack = this; + _getRegistry().push_back( this ); } uint32_t WindowSystemIF::_setupLists( util::ObjectManager& gl, const void* key, @@ -60,9 +66,9 @@ WindowSystem::WindowSystem( const std::string& type ) void WindowSystem::_chooseImpl( const std::string& name ) { - LBASSERTINFO( _stack, "no window system available" ); + LBASSERTINFO( !_getRegistry().empty(), "no window system available" ); - for( WindowSystemIF* ws = _stack; ws; ws = ws->_next ) + for( auto ws : _getRegistry() ) { if( ws->getName() == name ) { @@ -71,11 +77,10 @@ void WindowSystem::_chooseImpl( const std::string& name ) } } - for( WindowSystemIF* ws = _stack; ws; ws = ws->_next ) + for( auto ws : _getRegistry() ) if( !ws->getName().empty( )) _impl = ws; - if( !_impl ) - _impl = _stack; + _impl = _getRegistry().back(); LBWARN << "Window system '" << name << "' not supported, " << "using " << _impl->getName() << " instead." << std::endl; @@ -83,7 +88,7 @@ void WindowSystem::_chooseImpl( const std::string& name ) bool WindowSystem::supports( std::string const& type ) { - for( WindowSystemIF* ws = _stack; ws; ws = ws->_next ) + for( auto ws : _getRegistry() ) { if( ws->getName() == type ) return true; @@ -94,13 +99,13 @@ bool WindowSystem::supports( std::string const& type ) void WindowSystem::configInit( Node* node ) { - for( WindowSystemIF* ws = _stack; ws; ws = ws->_next ) + for( auto ws : _getRegistry() ) ws->configInit( node ); } void WindowSystem::configExit( Node* node ) { - for( WindowSystemIF* ws = _stack; ws; ws = ws->_next ) + for( auto ws : _getRegistry() ) ws->configExit(node ); } diff --git a/eq/windowSystem.h b/eq/windowSystem.h index 9861eff217..e8904a483d 100644 --- a/eq/windowSystem.h +++ b/eq/windowSystem.h @@ -95,7 +95,6 @@ class WindowSystemIF virtual bool hasMainThreadEvents() const { return false; } private: - WindowSystemIF* _next; friend class WindowSystem; };