Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).DisableVSync();
}
+ Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).SetStereoBase( mCommandLineOptions->stereoBase );
+ if( mCommandLineOptions->viewMode != 0 )
+ {
+ ViewMode viewMode = MONO;
+ if( mCommandLineOptions->viewMode <= STEREO_INTERLACED )
+ {
+ viewMode = static_cast<ViewMode>( mCommandLineOptions->viewMode );
+ }
+ Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).SetViewMode( viewMode );
+ }
+
mInitialized = true;
Dali::Application application(this);
return Dali::StyleMonitor::Get().SetTheme(themeFilePath);
}
+// Stereoscopy
+
+void Application::SetViewMode( ViewMode viewMode )
+{
+ Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).SetViewMode( viewMode );
+}
+
+ViewMode Application::GetViewMode() const
+{
+ return Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).GetViewMode();
+}
+
+void Application::SetStereoBase( float stereoBase )
+{
+ Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).SetStereoBase( stereoBase );
+}
+
+float Application::GetStereoBase() const
+{
+ return Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).GetStereoBase();
+}
+
} // namespace Adaptor
} // namespace Internal
*/
void SetTheme(const std::string& themeFilePath);
+public: // Stereoscopy
+
+ /**
+ * @copydoc Dali::Application::SetViewMode()
+ */
+ void SetViewMode( ViewMode viewMode );
+
+ /**
+ * @copydoc Dali::Application::GetViewMode()
+ */
+ ViewMode GetViewMode() const;
+
+ /**
+ * @copydoc Dali::Application::SetStereoBase()
+ */
+ void SetStereoBase( float stereoBase );
+
+ /**
+ * @copydoc Dali::Application::GetStereoBase()
+ */
+ float GetStereoBase() const;
+
public: // From Framework::Observer
/**
void Print()
{
std::cout << std::left << " --";
- std::cout.width( 15 );
+ std::cout.width( 18 );
std::cout << opt;
std::cout << optDescription;
std::cout << std::endl;
Argument EXPECTED_ARGS[] =
{
- { "no-vsync", "Disable VSync on Render" },
- { "width", "Stage Width" },
- { "height", "Stage Height" },
- { "dpi", "Emulated DPI" },
- { "help", "Help" },
-
- { NULL, NULL }
+ { "no-vsync", "Disable VSync on Render" },
+ { "width", "Stage Width" },
+ { "height", "Stage Height" },
+ { "dpi", "Emulated DPI" },
+ { "view", "Stereocopic 3D view mode ([0]=MONO, 1=STEREO_HORZ, 2=STEREO_VERT, 3=STEREO_INTERLACED)" },
+ { "stereo-base", "Distance in millimeters between left/right cameras [65.0]" },
+ { "help", "Help" },
+ { NULL, NULL }
};
enum Option
OPTION_STAGE_WIDTH,
OPTION_STAGE_HEIGHT,
OPTION_DPI,
+ OPTION_STEREO_MODE,
+ OPTION_STEREO_BASE,
OPTION_HELP
};
typedef std::vector< int > UnhandledContainer;
+void ShowHelp()
+{
+ std::cout << "Available options:" << std::endl;
+ Argument* arg = EXPECTED_ARGS;
+ while ( arg->opt )
+ {
+ arg->Print();
+ ++arg;
+ }
+}
+
} // unnamed namespace
CommandLineOptions::CommandLineOptions(int *argc, char **argv[])
: noVSyncOnRender(0),
- stageWidth(0), stageHeight(0)
+ stageWidth(0), stageHeight(0),
+ viewMode(0),
+ stereoBase(65)
{
if ( *argc > 1 )
{
{ EXPECTED_ARGS[OPTION_STAGE_WIDTH].opt, required_argument, NULL, 'w' }, // "--width"
{ EXPECTED_ARGS[OPTION_STAGE_HEIGHT].opt, required_argument, NULL, 'h' }, // "--height"
{ EXPECTED_ARGS[OPTION_DPI].opt, required_argument, NULL, 'd' }, // "--dpi"
- { EXPECTED_ARGS[OPTION_HELP].opt, no_argument, &help, 1 }, // "--help"
+ { EXPECTED_ARGS[OPTION_STEREO_MODE].opt, required_argument, NULL, 'v' }, // "--view"
+ { EXPECTED_ARGS[OPTION_STEREO_BASE].opt, required_argument, NULL, 's' }, // "--stereo-base"
+ { EXPECTED_ARGS[OPTION_HELP].opt, no_argument, &help, '?' }, // "--help"
{ 0, 0, 0, 0 } // end of options
};
int shortOption( 0 );
int optionIndex( 0 );
- const char* optString = "-w:h:d:"; // The '-' ensures that argv is NOT permuted
+ const char* optString = "-w:h:d:v:s:?"; // The '-' ensures that argv is NOT permuted
bool optionProcessed( false );
UnhandledContainer unhandledOptions; // We store indices of options we do not handle here
// Check if we want help
if ( help )
{
- std::cout << "Available options:" << std::endl;
- Argument* arg = EXPECTED_ARGS;
- while ( arg->opt )
- {
- arg->Print();
- ++arg;
- }
+ ShowHelp();
optionProcessed = true;
}
break;
break;
}
+ case 'v':
+ {
+ if ( optarg )
+ {
+ viewMode = atoi(optarg);
+ optionProcessed = true;
+ }
+ break;
+ }
+
+ case 's':
+ {
+ if ( optarg )
+ {
+ stereoBase = atoi(optarg);
+ optionProcessed = true;
+ }
+ break;
+ }
+
+ case '?':
+ {
+ ShowHelp();
+ optionProcessed = true;
+ break;
+ }
case -1:
{
// All command-line options have been parsed.
public: // Command line parsed values
- int noVSyncOnRender; ///< If 1, then the user does not want VSync on Render
- int stageWidth; ///< The width of the stage required. 0 if not set.
- int stageHeight; ///< The height of the stage required. 0 if not set.
+ int noVSyncOnRender; ///< If 1, then the user does not want VSync on Render
+ int stageWidth; ///< The width of the stage required. 0 if not set.
+ int stageHeight; ///< The height of the stage required. 0 if not set.
+ int viewMode; ///< Stereocopic 3D view mode (0=MONO, 1=STEREO_HORZ, 2=STEREO_VERT, 3=STEREO_INTERLACED)
+ int stereoBase; ///< The distance in millimeters between left/right cameras
std::string stageDPI; ///< DPI stored as hxv, where h is horizontal DPI and v is vertical DPI
};
gThreadLocalAdaptor.reset(this);
}
+// Stereoscopy
+
+void Adaptor::SetViewMode( ViewMode viewMode )
+{
+ mCore->SetViewMode( viewMode );
+}
+
+ViewMode Adaptor::GetViewMode() const
+{
+ return mCore->GetViewMode();
+}
+
+void Adaptor::SetStereoBase( float stereoBase )
+{
+ mCore->SetStereoBase( stereoBase );
+}
+
+float Adaptor::GetStereoBase() const
+{
+ return mCore->GetStereoBase();
+}
+
} // namespace Adaptor
} // namespace Internal
// INTERNAL INCLUDES
#include <dali/public-api/common/vector-wrapper.h>
+#include <dali/public-api/common/view-mode.h>
#include <dali/public-api/math/rect.h>
#include <dali/integration-api/render-controller.h>
#include <dali/public-api/adaptor-framework/common/device-layout.h>
#include <dali/public-api/adaptor-framework/common/clipboard.h>
-
#include <slp-platform-abstraction.h>
#include <base/interfaces/adaptor-internal-services.h>
#include <base/log-options.h>
*/
virtual KernelTraceInterface& GetKernelTraceInterface();
+public: // Stereoscopy
+
+ /**
+ * @copydoc Dali::Integration::Core::SetViewMode()
+ */
+ DALI_IMPORT_API void SetViewMode( ViewMode viewMode );
+
+ /**
+ * @copydoc Dali::Integration::Core::GetViewMode()
+ */
+ DALI_IMPORT_API ViewMode GetViewMode() const;
+
+ /**
+ * @copydoc Dali::Integration::Core::SetStereoBase()
+ */
+ DALI_IMPORT_API void SetStereoBase( float stereoBase );
+
+ /**
+ * @copydoc Dali::Integration::Core::GetStereoBase()
+ */
+ DALI_IMPORT_API float GetStereoBase() const;
+
public: // Signals
/**
return Internal::Adaptor::Application::Get();
}
+void Application::SetViewMode( ViewMode viewMode )
+{
+ Internal::Adaptor::GetImplementation(*this).SetViewMode( viewMode );
+}
+
+ViewMode Application::GetViewMode() const
+{
+ return Internal::Adaptor::GetImplementation(*this).GetViewMode();
+}
+
+void Application::SetStereoBase( float stereoBase )
+{
+ Internal::Adaptor::GetImplementation(*this).SetStereoBase( stereoBase );
+}
+
+float Application::GetStereoBase() const
+{
+ return Internal::Adaptor::GetImplementation(*this).GetStereoBase();
+}
+
Application::AppSignalV2& Application::InitSignal()
{
return Internal::Adaptor::GetImplementation(*this).InitSignal();
#include <boost/function.hpp>
#include <string>
#include <dali/public-api/object/base-handle.h>
+#include <dali/public-api/common/view-mode.h>
#include <dali/public-api/adaptor-framework/common/style-monitor.h>
#include <dali/public-api/adaptor-framework/common/device-layout.h>
*/
static Application Get();
+public: // Stereoscopy
+
+ /**
+ * Set the stereoscopic 3D viewing mode for the application
+ * @param[in] viewMode The new viewing mode
+ */
+ void SetViewMode( ViewMode viewMode );
+
+ /**
+ * Get the current stereoscopic 3D viewing mode.
+ * @return The current stereoscopic 3D viewing mode.
+ */
+ ViewMode GetViewMode() const;
+
+ /**
+ * Set the stereo base (eye seperation) for stereoscopic 3D
+ * @param[in] stereoBase The stereo base (eye seperation) for stereoscopic 3D
+ */
+ void SetStereoBase( float stereoBase );
+
+ /**
+ * Get the stereo base (eye seperation) for stereoscopic 3D
+ * @return The stereo base (eye seperation) for stereoscopic 3D
+ */
+ float GetStereoBase() const;
+
public: // Signals
/**