MCPcopy Create free account
hub / github.com/OSVR/OSVR-Core / main

Function main

examples/plugin-hosts/BasicPluginLoaderWithDetect.cpp:36–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34#include <exception>
35
36int main(int argc, char *argv[]) {
37 if (argc < 2) {
38 std::cerr << "Must supply a plugin name to load." << std::endl;
39 return 1;
40 }
41 osvr::pluginhost::RegistrationContext ctx;
42
43 try {
44 std::cout << "Trying to load plugin " << argv[1] << std::endl;
45 ctx.loadPlugin(argv[1]);
46 std::cout << "Successfully loaded plugin, control returned to host "
47 "application!" << std::endl;
48 } catch (std::exception &e) {
49 std::cerr << "Caught exception tring to load " << argv[1] << ": "
50 << e.what() << std::endl;
51 return 1;
52 }
53 std::cout << "Starting hardware detect..." << std::endl;
54 ctx.triggerHardwareDetect();
55 return 0;
56}

Callers

nothing calls this directly

Calls 2

loadPluginMethod · 0.45
triggerHardwareDetectMethod · 0.45

Tested by

no test coverage detected