| 39 | static const char HOST_ENV_VAR[] = "OSVR_HOST"; |
| 40 | |
| 41 | OSVR_ClientContext osvrClientInit(const char applicationIdentifier[], |
| 42 | uint32_t /*flags*/) { |
| 43 | auto host = osvr::common::getEnvironmentVariable(HOST_ENV_VAR); |
| 44 | if (host.is_initialized()) { |
| 45 | OSVR_DEV_VERBOSE("Connecting to non-default host " << *host); |
| 46 | return ::osvr::client::createContext(applicationIdentifier, |
| 47 | host->c_str()); |
| 48 | } else { |
| 49 | OSVR_DEV_VERBOSE("Connecting to default (local) host"); |
| 50 | return ::osvr::client::createContext(applicationIdentifier); |
| 51 | } |
| 52 | } |
| 53 | OSVR_ReturnCode osvrClientCheckStatus(OSVR_ClientContext ctx) { |
| 54 | if (!ctx) { |
| 55 | return OSVR_RETURN_FAILURE; |