VR-Vantage
Loading...
Searching...
No Matches
exampleSimple

Overview

This example shows how to create a simple VR-Vantage application.

Expected Result

Simple Application Result

Example details

There are three required steps.

The first step is to create the DtVrvApplication.

// A DtVrvApplication wraps up all the components required to build

Once the application has been created, it must be initialized.

// This causes the plugin manager to load plugins, cause a Display Configuration
// to be realized, creates the default environment, etc.
igApp.preInitialize(argc, argv);

Finally, the application's main event loop is started.

// Creates an event loop and begins running it, causing the creation of frames.
igApp.run();

Building the Example

VR-Vantage includes pre-built versions of the example application. To build it yourself, follow the instructions at Building VR-Vantage Examples, Applications, and Plug-ins.

Running the Example

This example is an application. You can run it by running ./bin64/exampleSimple.exe (on Windows) or ./bin64/exampleSimple (on Linux). For more information about running examples, please see Running Applications and Examples.

Example Source Files


exampleSimple.cxx

/******************************************************************************
** Copyright (c) 2025 MAK Technologies, Inc.
** All rights reserved.
******************************************************************************/
#include <vrvCore/svnRev.h>
#include <vlutil/vlMiniDumper.h>
#include <vlutil/vlLogFileInfo.h>
// Use the VR-Vantage namespace.
// All classes in VR-Vantage are in this namespace.
using namespace makVrv;
int main(int argc,char** argv)
{
// Used for error handling
DtLogFileInfo::instance().setAppName("exampleSimple");
DtLogFileInfo::instance().setSvnRev("123456");
DtLogFileInfo::instance().setVersion("1.0");
DtINIT_MINIDUMPER(DtLogFileInfo::instance().getFullString().c_str());
// Create the configuration for the application.
// Here we create a Stealth configuration but you could
// create a Vantage IG configuration
// (makVrv::DtVantageIgConfiguration) instead.
// Create the Application.
// A DtVrvApplication wraps up all the components required to build
// a complete VR-Vantage application (DtDe, DtPluginManager,
// DtEventLoop, and a DtVrvApplicationConfiguration).
DtVrvApplication igApp(config);
// Create and install the command line processor.
// Here we create a Stealth command line processor but you could
// create a Vantage IG command line processor
// (makVrv::DtVantageIgCommandLineProcessor) instead.
igApp.installCommandLineProcessor(&cmdLineProcessor);
// This causes the plugin manager to load plugins, cause a Display Configuration
// to be realized, creates the default environment, etc.
igApp.preInitialize(argc, argv);
// Show the splash screen. Returns a pointer but that pointer will be deleted by the application
// (i.e. no need to delete the returned pointer)
makVrv::vrvSplashScreen::createSplashScreen(igApp, "../data/Overlays/SplashScreens/SplashScreen_VR-Vantage.jpg");
igApp.initialize();
// Creates an event loop and begins running it, causing the creation of frames.
igApp.run();
return 0;
}
Contains makVrv::DtGuiConfiguration class.
Contains makVrv::DtStealthCommandLineProcessor class.
Contains makVrv::DtStealthConfiguration class.
Contains makVrv::DtVrvApplication implementation.
The Stealth Application's command line processor.
Definition DtStealthCommandLineProcessor.h:22
The MAK Vantage Stealth Application. This class contains the information to create and configure the ...
Definition DtStealthConfiguration.h:20
The Root IG Application object. To run the IG simply create one, initialize it and call run.
Definition DtVrvApplication.h:58
Contains necessary ig version information.
DT_DLL_VRVSPLASHSCREEN DtDeSplashScreen * createSplashScreen(DtVrvApplication &app, const std::string &filePath)
Create a splash screen using the image at the provided file path. The pointer will be deleted automat...
Contains DtCreateSensorFieldOfViewCommand and DtCreateSensorFieldOfViewCommandCreator class declarati...
Definition DtGridLinesSettingsRecord.h:16
Contains DLL export macros.