| 56 | }; |
| 57 | |
| 58 | OSVR_ReturnCode osvrDeviceEyeTrackerConfigure( |
| 59 | OSVR_INOUT_PTR OSVR_DeviceInitOptions opts, |
| 60 | OSVR_OUT_PTR OSVR_EyeTrackerDeviceInterface *iface, |
| 61 | OSVR_IN OSVR_ChannelCount numChan) { |
| 62 | |
| 63 | OSVR_PLUGIN_HANDLE_NULL_CONTEXT("osvrDeviceEyeTrackerConfigure", opts); |
| 64 | OSVR_PLUGIN_HANDLE_NULL_CONTEXT("osvrDeviceEyeTrackerConfigure", iface); |
| 65 | auto ifaceObj = |
| 66 | opts->makeInterfaceObject<OSVR_EyeTrackerDeviceInterfaceObject>(); |
| 67 | *iface = ifaceObj; |
| 68 | |
| 69 | auto location = osvr::common::Location2DComponent::create(); |
| 70 | ifaceObj->location = location.get(); |
| 71 | opts->addComponent(location); |
| 72 | |
| 73 | auto direction = osvr::common::DirectionComponent::create(); |
| 74 | ifaceObj->direction = direction.get(); |
| 75 | opts->addComponent(direction); |
| 76 | |
| 77 | auto eyetracker = osvr::common::EyeTrackerComponent::create(); |
| 78 | ifaceObj->eyetracker = eyetracker.get(); |
| 79 | opts->addComponent(eyetracker); |
| 80 | |
| 81 | opts->setButtons(numChan, ifaceObj->button); |
| 82 | opts->setTracker(ifaceObj->tracker); |
| 83 | |
| 84 | return OSVR_RETURN_SUCCESS; |
| 85 | } |
| 86 | |
| 87 | OSVR_ReturnCode osvrDeviceEyeTrackerReport2DGaze( |
| 88 | OSVR_IN_PTR OSVR_EyeTrackerDeviceInterface iface, |
no test coverage detected