Skip to content

Commit 1b68845

Browse files
authored
Merge pull request #1231 from 17cupsofcoffee/patch-1
Fix XInput support in the game-controller example (fixes #1230)
2 parents 278eda3 + 047eb79 commit 1b68845

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

examples/game-controller.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
extern crate sdl2;
22

33
fn main() -> Result<(), String> {
4+
// This is required for certain controllers to work on Windows without the
5+
// video subsystem enabled:
6+
sdl2::hint::set("SDL_JOYSTICK_THREAD", "1");
7+
48
let sdl_context = sdl2::init()?;
59
let game_controller_subsystem = sdl_context.game_controller()?;
610

0 commit comments

Comments
 (0)