Skip to content

Commit

Permalink
Add some notes to set_rumble's docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Manorhos committed Dec 12, 2018
1 parent a5bf3db commit 64a936c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/sdl2/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,15 @@ impl GameController {

/// Set the rumble motors to their specified intensities, if supported.
/// Automatically resets back to zero after `duration_ms` milliseconds have passed.
///
/// # Notes
///
/// The value range for the intensities is 0 to 0xFFFF.
///
/// Do *not* use `std::u32::MAX` or similar for `duration_ms` if you want
/// the rumble effect to keep playing for a long time, as this results in
/// the effect ending immediately after starting due to an overflow.
/// Use some smaller, "huge enough" number instead.
pub fn set_rumble(&mut self,
low_frequency_rumble: u16,
high_frequency_rumble: u16,
Expand Down
9 changes: 9 additions & 0 deletions src/sdl2/joystick.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,15 @@ impl Joystick {

/// Set the rumble motors to their specified intensities, if supported.
/// Automatically resets back to zero after `duration_ms` milliseconds have passed.
///
/// # Notes
///
/// The value range for the intensities is 0 to 0xFFFF.
///
/// Do *not* use `std::u32::MAX` or similar for `duration_ms` if you want
/// the rumble effect to keep playing for a long time, as this results in
/// the effect ending immediately after starting due to an overflow.
/// Use some smaller, "huge enough" number instead.
pub fn set_rumble(&mut self,
low_frequency_rumble: u16,
high_frequency_rumble: u16,
Expand Down

0 comments on commit 64a936c

Please sign in to comment.