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

Function main

examples/clients/AnalogCallback.cpp:40–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40int main() {
41 osvr::clientkit::ClientContext context(
42 "com.osvr.exampleclients.AnalogCallback");
43
44 // This is just one of the paths: specifically, the Hydra's left
45 // controller's analog trigger. More are in the docs and/or listed on
46 // startup
47 osvr::clientkit::Interface analogTrigger =
48 context.getInterface("/controller/left/trigger");
49
50 analogTrigger.registerCallback(&myAnalogCallback, NULL);
51
52 // Pretend that this is your application's mainloop.
53 for (int i = 0; i < 1000000; ++i) {
54 context.update();
55 }
56
57 std::cout << "Library shut down, exiting." << std::endl;
58 return 0;
59}

Callers

nothing calls this directly

Calls 3

registerCallbackMethod · 0.80
getInterfaceMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected