Skip to content

Commit

Permalink
Feature version flag
Browse files Browse the repository at this point in the history
  • Loading branch information
pierre committed Jul 31, 2022
1 parent 7304163 commit 4b0f20d
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ keywords = [
"hand",
]

[features]
default = ["gemini"]
gemini = []

[dependencies]
leap-sys = "0.2"
num_enum = "0.5"
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,17 @@ The Ultraleap backend is only compatible with Windows, and so is LeapRS. Older
versions of the software were multi-platform, so it could be possible to create
a more compatible library, but it is not in the scope at the moment.

### Using with previous SDK versions

Disabling the `geminy` feature enables building application for the previous SDK
generation (Orion). In Cargo.toml:

```toml
[dependencies = { version = "*", default-features = false }]
```

You also need to point the `LEAPSDK_LIB_PATH` to a SDK with the Orion version.

## Runtime

At runtime, the application requires the LeapC.dll file to be available. The
Expand Down
4 changes: 2 additions & 2 deletions src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use leap_sys::*;
use crate::{
ConfigChangeEvent, ConfigResponseEvent, ConnectionEvent, ConnectionLostEvent, DeviceEvent,
DeviceStatusChangeEvent, ImageEvent, LogEvent, LogEvents, PolicyEvent, TrackingEvent,
TrackingModeEvent,
};

#[doc = " The types of event messages resulting from calling LeapPollConnection()."]
Expand Down Expand Up @@ -87,7 +86,8 @@ pub enum Event<'a> {
#[doc = " This can be due to changing the hmd or screentop policy with LeapSetPolicyFlags()."]
#[doc = " or setting the tracking mode using LeapSetTrackingMode()."]
#[doc = " @since 5.0.0"]
TrackingMode(TrackingModeEvent<'a>),
#[cfg(feature = "gemini")]
TrackingMode(crate::TrackingModeEvent<'a>),
#[doc = " An array of system messages. @since 4.0.0"]
LogEvents(LogEvents<'a>),
#[doc = " A head pose. The message contains the timestamped head position and orientation."]
Expand Down
2 changes: 2 additions & 0 deletions src/events/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ mod log_event;
mod log_events;
mod policy_event;
mod tracking_event;
#[cfg(feature = "gemini")]
mod tracking_mode_event;
pub use config_change_event::*;
pub use config_response_event::*;
Expand All @@ -23,4 +24,5 @@ pub use log_event::*;
pub use log_events::*;
pub use policy_event::*;
pub use tracking_event::*;
#[cfg(feature = "gemini")]
pub use tracking_mode_event::*;
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ mod policy_flag;
mod quaternion;
mod service_state;
mod sized_with_trailing_data;
#[cfg(feature = "gemini")]
mod tracking_mode;
mod variant;
#[cfg(feature = "gemini")]
mod version;
mod version_part;
pub use crate::image::*;
Expand Down Expand Up @@ -63,8 +65,10 @@ pub use palm::*;
pub use policy_flag::*;
pub use quaternion::*;
pub use service_state::*;
#[cfg(feature = "gemini")]
pub use tracking_mode::*;
pub use variant::*;
#[cfg(feature = "gemini")]
pub use version::*;
pub use version_part::*;

Expand Down

0 comments on commit 4b0f20d

Please sign in to comment.