Skip to content

Commit 4b0f20d

Browse files
author
pierre
committed
Feature version flag
1 parent 7304163 commit 4b0f20d

File tree

5 files changed

+23
-2
lines changed

5 files changed

+23
-2
lines changed

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ keywords = [
2020
"hand",
2121
]
2222

23+
[features]
24+
default = ["gemini"]
25+
gemini = []
26+
2327
[dependencies]
2428
leap-sys = "0.2"
2529
num_enum = "0.5"

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,17 @@ The Ultraleap backend is only compatible with Windows, and so is LeapRS. Older
5353
versions of the software were multi-platform, so it could be possible to create
5454
a more compatible library, but it is not in the scope at the moment.
5555

56+
### Using with previous SDK versions
57+
58+
Disabling the `geminy` feature enables building application for the previous SDK
59+
generation (Orion). In Cargo.toml:
60+
61+
```toml
62+
[dependencies = { version = "*", default-features = false }]
63+
```
64+
65+
You also need to point the `LEAPSDK_LIB_PATH` to a SDK with the Orion version.
66+
5667
## Runtime
5768

5869
At runtime, the application requires the LeapC.dll file to be available. The

src/event.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use leap_sys::*;
33
use crate::{
44
ConfigChangeEvent, ConfigResponseEvent, ConnectionEvent, ConnectionLostEvent, DeviceEvent,
55
DeviceStatusChangeEvent, ImageEvent, LogEvent, LogEvents, PolicyEvent, TrackingEvent,
6-
TrackingModeEvent,
76
};
87

98
#[doc = " The types of event messages resulting from calling LeapPollConnection()."]
@@ -87,7 +86,8 @@ pub enum Event<'a> {
8786
#[doc = " This can be due to changing the hmd or screentop policy with LeapSetPolicyFlags()."]
8887
#[doc = " or setting the tracking mode using LeapSetTrackingMode()."]
8988
#[doc = " @since 5.0.0"]
90-
TrackingMode(TrackingModeEvent<'a>),
89+
#[cfg(feature = "gemini")]
90+
TrackingMode(crate::TrackingModeEvent<'a>),
9191
#[doc = " An array of system messages. @since 4.0.0"]
9292
LogEvents(LogEvents<'a>),
9393
#[doc = " A head pose. The message contains the timestamped head position and orientation."]

src/events/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ mod log_event;
1010
mod log_events;
1111
mod policy_event;
1212
mod tracking_event;
13+
#[cfg(feature = "gemini")]
1314
mod tracking_mode_event;
1415
pub use config_change_event::*;
1516
pub use config_response_event::*;
@@ -23,4 +24,5 @@ pub use log_event::*;
2324
pub use log_events::*;
2425
pub use policy_event::*;
2526
pub use tracking_event::*;
27+
#[cfg(feature = "gemini")]
2628
pub use tracking_mode_event::*;

src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ mod policy_flag;
3030
mod quaternion;
3131
mod service_state;
3232
mod sized_with_trailing_data;
33+
#[cfg(feature = "gemini")]
3334
mod tracking_mode;
3435
mod variant;
36+
#[cfg(feature = "gemini")]
3537
mod version;
3638
mod version_part;
3739
pub use crate::image::*;
@@ -63,8 +65,10 @@ pub use palm::*;
6365
pub use policy_flag::*;
6466
pub use quaternion::*;
6567
pub use service_state::*;
68+
#[cfg(feature = "gemini")]
6669
pub use tracking_mode::*;
6770
pub use variant::*;
71+
#[cfg(feature = "gemini")]
6872
pub use version::*;
6973
pub use version_part::*;
7074

0 commit comments

Comments
 (0)