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

Function main

examples/clients/ButtonCallback.cpp:41–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

registerCallbackMethod · 0.80
getInterfaceMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected