diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-07-16 09:08:58 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-07-16 09:08:58 +0200 |
commit | b9927696f701065f27cda1110a9256b0c4f4efc8 (patch) | |
tree | 4061c69e2b5ed659e97cac54701b31aceec3eda3 | |
parent | 8511933929a06c99a0ad358653a4db8f177a4527 (diff) |
Print more info when using invalid arguments or no arguments
-rw-r--r-- | README.md | 5 | ||||
-rw-r--r-- | src/main.cpp | 28 |
2 files changed, 25 insertions, 8 deletions
@@ -40,10 +40,7 @@ The video might not be in front of you, so to move the video in front of you, yo killall -USR1 vr-video-player` ``` -You can launch vr-video-player without any arguments to show a list of all arguments: -``` -usage: vr-video-player [--flat] [--left-right|--right-left|--plane] [--stretch|--no-stretch] [--zoom zoom-level] [--cursor-scale scale] [--cursor-wrap|--no-cursor-wrap] <window_id> -``` +You can launch vr-video-player without any arguments to show a list of all arguments. Note: If the cursor position is weird and does not match what you are seeing in stereoscopic vr mode, then try running the vr video player with the --cursor-wrap option: diff --git a/src/main.cpp b/src/main.cpp index aa91167..f799f95 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -411,7 +411,20 @@ void dprintf( const char *fmt, ... ) } static void usage() { - fprintf(stderr, "usage: vr-video-player [--flat] [--left-right|--right-left|--plane] [--stretch|--no-stretch] [--zoom zoom-level] [--cursor-scale scale] [--cursor-wrap|--no-cursor-wrap] <window_id>\n"); + fprintf(stderr, "usage: vr-video-player [--sphere] [--flat] [--left-right|--right-left|--plane] [--stretch|--no-stretch] [--zoom zoom-level] [--cursor-scale scale] [--cursor-wrap|--no-cursor-wrap] <window_id>\n"); + fprintf(stderr, "OPTIONS\n"); + fprintf(stderr, " --sphere View the window as a stereoscopic 180 degrees screen (half sphere). The view will be attached to your head in vr. This is recommended for 180 degrees videos. This option conflicts with the --flat and --plane options. This is the default value\n"); + fprintf(stderr, " --flat View the window as a stereoscopic flat screen. This is recommended for stereoscopic videos and games. This option conflicts with the --sphere and --plane options\n"); + fprintf(stderr, " --left-right This option is used together with --flat, to specify if the left side of the window is meant to be viewed with the left eye and the right side is meant to be viewed by the right eye. This is the default value\n"); + fprintf(stderr, " --right-left This option is used together with --flat, to specify if the left side of the window is meant to be viewed with the right eye and the right side is meant to be viewed by the left eye\n"); + fprintf(stderr, " --plane View the window as a slightly curved screen. This is recommended for non-stereoscopic content. This option conflicts with the --sphere and --flat options\n"); + fprintf(stderr, " --stretch This option is used together with --flat, To specify if the size of both sides of the window should be combined and stretch to that size when viewed in vr. This is the default value\n"); + fprintf(stderr, " --no-stretch This option is used together with --flat, To specify if the size of one side of the window should be the size of the whole window when viewed in vr. This is the option you want if the window looks too wide\n"); + fprintf(stderr, " --zoom Change the distance to the window. This should be a positive value. In flat and plane modes, this is the distance to the window when the window is reset (with W key or controller trigger button). The default value is 0 for all modes except sphere mode, where the default value is 1\n"); + fprintf(stderr, " --cursor-scale Change the size of the cursor. This should be a positive value. If set to 0, then the cursor is hidden. The default value is 1 for all modes except sphere mode, where the default value is 0\n"); + fprintf(stderr, " --cursor-wrap If this option is set, then the cursor position in the vr view will wrap around when it reached the center of the window (i.e when it reaches the edge of one side of the stereoscopic view). This option is only valid for stereoscopic view (flat and sphere modes)\n"); + fprintf(stderr, " --no-cursor-wrap If this option is set, then the cursor position in the vr view will match the the real cursor position inside the window\n"); + fprintf(stderr, " window_id The X11 window id of the window to view in vr. This option is required\n"); exit(1); } @@ -457,7 +470,14 @@ CMainApplication::CMainApplication( int argc, char *argv[] ) bool cursor_wrap_set = false; for(int i = 1; i < argc; ++i) { - if(strcmp(argv[i], "--flat") == 0) { + if(strcmp(argv[i], "--sphere") == 0) { + if(projection_arg) { + fprintf(stderr, "Error: --sphere option can't be used together with the %s option\n", projection_arg); + exit(1); + } + projection_mode = ProjectionMode::SPHERE; + projection_arg = argv[i]; + } else if(strcmp(argv[i], "--flat") == 0) { if(projection_arg) { fprintf(stderr, "Error: --flat option can't be used together with the %s option\n", projection_arg); exit(1); @@ -794,7 +814,7 @@ bool CMainApplication::BInitGL() glUseProgram( m_unSceneProgramID ); - glActiveTexture(GL_TEXTURE1); + //glActiveTexture(GL_TEXTURE0); if(window_texture_init(&window_texture, x_display, src_window_id) != 0) return false; @@ -808,7 +828,7 @@ bool CMainApplication::BInitGL() glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glActiveTexture(GL_TEXTURE1); + //glActiveTexture(GL_TEXTURE1); glGenTextures(1, &arrow_image_texture_id); glBindTexture(GL_TEXTURE_2D, arrow_image_texture_id); if(arrow_image_texture_id == 0) |