Skip to content

Commit

Permalink
Prepare for Eyescale/CMake#533
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Eilemann authored and eile committed Jan 19, 2017
1 parent 76526f0 commit 7d5f89b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 25 deletions.
2 changes: 1 addition & 1 deletion apps/DesktopStreamer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ if(MSVC)
list(APPEND DESKTOPSTREAMER_LINK_LIBRARIES Ws2_32)
endif()

common_application(${DESKTOPSTREAMER_APP_NAME} GUI)
common_application(${DESKTOPSTREAMER_APP_NAME} GUI NOHELP)

if(APPLE)
# create a zip for Puppet deployment
Expand Down
55 changes: 31 additions & 24 deletions apps/SimpleStreamer/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,40 +80,49 @@ int main( int argc, char** argv )
readCommandLineArguments( argc, argv );

if( deflectHost == NULL )
{
syntax( argv[0] );
return EXIT_FAILURE;
}

initGLWindow( argc, argv );
initDeflectStream();

atexit( cleanup );
glutMainLoop(); // enter the main loop

return 0;
return EXIT_SUCCESS;
}

void readCommandLineArguments( int argc, char** argv )
{
for( int i = 1; i < argc; ++i )
{
if( argv[i][0] == '-' )
if( std::string( argv[i] ) == "--help" )
{
syntax( argv[0] );
::exit( EXIT_SUCCESS );
}
else if( argv[i][0] == '-' )
{
switch( argv[i][1] )
{
case 'n':
if( i + 1 < argc )
{
deflectStreamId = argv[i+1];
++i;
}
break;
case 'i':
deflectInteraction = true;
break;
case 'u':
deflectCompressImage = false;
break;
default:
syntax( argv[0] );
case 'n':
if( i + 1 < argc )
{
deflectStreamId = argv[i+1];
++i;
}
break;
case 'i':
deflectInteraction = true;
break;
case 'u':
deflectCompressImage = false;
break;
default:
syntax( argv[0] );
::exit( EXIT_FAILURE );
}
}
else if( i == argc - 1 )
Expand Down Expand Up @@ -167,13 +176,11 @@ void initDeflectStream()

void syntax( char* app )
{
std::cerr << "syntax: " << app << " [options] <host>" << std::endl;
std::cerr << "options:" << std::endl;
std::cerr << " -n <stream id> set stream identifier (default: 'SimpleStreamer')" << std::endl;
std::cerr << " -i enable interaction events (default: OFF)" << std::endl;
std::cerr << " -u enable uncompressed streaming (default: OFF)" << std::endl;

exit( 1 );
std::cout << "syntax: " << app << " [options] <host>" << std::endl;
std::cout << "options:" << std::endl;
std::cout << " -n <stream id> set stream identifier (default: 'SimpleStreamer')" << std::endl;
std::cout << " -i enable interaction events (default: OFF)" << std::endl;
std::cout << " -u enable uncompressed streaming (default: OFF)" << std::endl;
}

void display()
Expand Down

0 comments on commit 7d5f89b

Please sign in to comment.