Commit 0407b23a authored by Pablo Toharia's avatar Pablo Toharia
Browse files

Merge branch 'ShadersDowngrade' into 'master'

Downgrade shaders version. Try to catch ZeroEQ init exceptions.

See merge request nsviz/visimpl!61
parents 2e8ea77e af09a776
......@@ -9,7 +9,7 @@
cmake_minimum_required( VERSION 3.1 FATAL_ERROR )
# visimpl project and version
project( visimpl VERSION 1.1.1 )
project( visimpl VERSION 1.1.2 )
set( visimpl_VERSION_ABI 6 )
SET( VISIMPL_LICENSE "GPL")
......
......@@ -1667,16 +1667,38 @@ namespace visimpl
{
if(!uri_.empty())
{
_zeqUri = uri_;
_zeqConnection = true;
_subscriber = new zeroeq::Subscriber( _zeqUri );
bool failed = false;
try
{
_zeqUri = uri_;
_zeqConnection = true;
_subscriber = new zeroeq::Subscriber( _zeqUri );
_subscriber->subscribe(lexis::data::SelectedIDs::ZEROBUF_TYPE_IDENTIFIER( ),
[&]( const void* data_, unsigned long long size_ )
{ _onSelectionEvent( lexis::data::SelectedIDs::create( data_, size_ ));});
_subscriber->subscribe(lexis::data::SelectedIDs::ZEROBUF_TYPE_IDENTIFIER( ),
[&]( const void* data_, unsigned long long size_ )
{ _onSelectionEvent( lexis::data::SelectedIDs::create( data_, size_ ));});
_thread = new std::thread( [this]( )
{ while ( _zeqConnection ) _subscriber->receive( 10000 ); } );
}
catch(std::exception &e)
{
std::cerr << e.what() << std::endl << " " << __FILE__ << ":" << __LINE__ << std::endl;
failed = true;
}
catch(...)
{
std::cerr << "Unknown exception catched when initializing ZeroEQ. " << __FILE__ << ":" << __LINE__ << std::endl;
failed = true;
}
_thread = new std::thread( [this]( )
{ while ( _zeqConnection ) _subscriber->receive( 10000 ); } );
if(failed)
{
_zeqUri.clear();
_zeqConnection = false;
_subscriber = nullptr;
_thread = nullptr;
}
}
}
......
......@@ -173,10 +173,32 @@ namespace visimpl
{
#ifdef VISIMPL_USE_ZEROEQ
if ( !_zeqUri.empty( ) )
_camera = new Camera( _zeqUri );
else
{
bool failed = false;
try
{
_camera = new Camera( _zeqUri );
}
catch(std::exception &e)
{
std::cerr << e.what() << " " << __FILE__ << ":" << __LINE__ << std::endl;
failed = true;
}
catch(...)
{
std::cerr << "Unknown exception catched when initializing camera. " << __FILE__ << ":" << __LINE__ << std::endl;
failed = true;
}
if(failed)
{
_camera = nullptr;
_zeqUri.clear();
}
}
#endif
_camera = new Camera( );
if(!_camera) _camera = new Camera( );
_camera->camera()->farPlane( 100000.f );
......@@ -304,7 +326,20 @@ namespace visimpl
#ifdef VISIMPL_USE_ZEROEQ
if( !_zeqUri.empty( ))
_player->connectZeq( _zeqUri );
{
try
{
_player->connectZeq( _zeqUri );
}
catch(std::exception &e)
{
std::cerr << e.what() << std::endl;
}
catch(...)
{
std::cerr << "Unknown exception catched when connecting player. " << __FILE__ << ":" << __LINE__ << std::endl;
}
}
#endif
this->_paint = true;
update( );
......@@ -372,7 +407,14 @@ namespace visimpl
subsetEventsManager(netData->subsetsEvents());
#ifdef VISIMPL_USE_ZEROEQ
_player->connectZeq( _zeqUri );
try
{
_player->connectZeq( _zeqUri );
}
catch(...)
{
}
#endif
this->_paint = true;
update( );
......
......@@ -27,7 +27,7 @@ namespace prefr
{
const static std::string prefrVertexShader = R"(
#version 430
#version 330
//#extension GL_ARB_separate_shader_objects: enable
uniform mat4 modelViewProjM;
......@@ -63,7 +63,7 @@ void main()
)";
const static std::string prefrFragmentShaderDefault = R"(
#version 430
#version 330
in vec4 color;
in vec2 uvCoord;
out vec4 outputColor;
......@@ -118,7 +118,6 @@ out float id;
void main()
{
vec4 position = vec4((vertexPosition.x * particlePosition.a * cameraRight) +
(vertexPosition.y * particlePosition.a * cameraUp) +
particlePosition.rgb, 1.0);
......@@ -169,7 +168,7 @@ void main( )
})";
const static std::string planeVertCode = R"(
#version 430
#version 330
in vec3 inPos;
......@@ -190,7 +189,7 @@ void main( )
const static std::string planeFragCode = R"(
#version 430
#version 330
in vec4 outColor;
out vec4 outputColor;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment