| 39 | } |
| 40 | |
| 41 | int 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 | } |
nothing calls this directly
no test coverage detected