ruby2d 0.10.0 → 0.11.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/include/SDL2/SDL.h +108 -14
- data/assets/include/SDL2/SDL_assert.h +81 -50
- data/assets/include/SDL2/SDL_atomic.h +135 -35
- data/assets/include/SDL2/SDL_audio.h +960 -355
- data/assets/include/SDL2/SDL_bits.h +11 -6
- data/assets/include/SDL2/SDL_blendmode.h +91 -14
- data/assets/include/SDL2/SDL_clipboard.h +30 -7
- data/assets/include/SDL2/SDL_config.h +3 -1
- data/assets/include/SDL2/SDL_config_android.h +11 -1
- data/assets/include/SDL2/SDL_config_emscripten.h +216 -0
- data/assets/include/SDL2/SDL_config_iphoneos.h +9 -1
- data/assets/include/SDL2/SDL_config_macosx.h +16 -2
- data/assets/include/SDL2/SDL_config_minimal.h +4 -1
- data/assets/include/SDL2/SDL_config_os2.h +37 -20
- data/assets/include/SDL2/SDL_config_pandora.h +6 -1
- data/assets/include/SDL2/SDL_config_psp.h +8 -8
- data/assets/include/SDL2/SDL_config_windows.h +39 -22
- data/assets/include/SDL2/SDL_config_winrt.h +23 -8
- data/assets/include/SDL2/SDL_config_wiz.h +6 -1
- data/assets/include/SDL2/SDL_copying.h +1 -1
- data/assets/include/SDL2/SDL_cpuinfo.h +331 -71
- data/assets/include/SDL2/SDL_egl.h +906 -280
- data/assets/include/SDL2/SDL_endian.h +101 -47
- data/assets/include/SDL2/SDL_error.h +70 -19
- data/assets/include/SDL2/SDL_events.h +387 -79
- data/assets/include/SDL2/SDL_filesystem.h +73 -64
- data/assets/include/SDL2/SDL_gamecontroller.h +585 -125
- data/assets/include/SDL2/SDL_gesture.h +36 -6
- data/assets/include/SDL2/SDL_haptic.h +304 -210
- data/assets/include/SDL2/SDL_hidapi.h +451 -0
- data/assets/include/SDL2/SDL_hints.h +1286 -897
- data/assets/include/SDL2/SDL_joystick.h +577 -130
- data/assets/include/SDL2/SDL_keyboard.h +162 -63
- data/assets/include/SDL2/SDL_keycode.h +7 -5
- data/assets/include/SDL2/SDL_loadso.h +42 -8
- data/assets/include/SDL2/SDL_locale.h +34 -32
- data/assets/include/SDL2/SDL_log.h +212 -19
- data/assets/include/SDL2/SDL_main.h +72 -17
- data/assets/include/SDL2/SDL_messagebox.h +70 -23
- data/assets/include/SDL2/SDL_metal.h +27 -32
- data/assets/include/SDL2/SDL_misc.h +19 -15
- data/assets/include/SDL2/SDL_mouse.h +262 -110
- data/assets/include/SDL2/SDL_mutex.h +286 -66
- data/assets/include/SDL2/SDL_name.h +1 -1
- data/assets/include/SDL2/SDL_opengl.h +1 -1
- data/assets/include/SDL2/SDL_opengles.h +1 -1
- data/assets/include/SDL2/SDL_opengles2.h +2 -2
- data/assets/include/SDL2/SDL_pixels.h +199 -34
- data/assets/include/SDL2/SDL_platform.h +39 -2
- data/assets/include/SDL2/SDL_power.h +23 -10
- data/assets/include/SDL2/SDL_quit.h +1 -1
- data/assets/include/SDL2/SDL_rect.h +78 -28
- data/assets/include/SDL2/SDL_render.h +1204 -472
- data/assets/include/SDL2/SDL_revision.h +2 -2
- data/assets/include/SDL2/SDL_rwops.h +605 -33
- data/assets/include/SDL2/SDL_scancode.h +1 -1
- data/assets/include/SDL2/SDL_sensor.h +76 -42
- data/assets/include/SDL2/SDL_shape.h +38 -27
- data/assets/include/SDL2/SDL_stdinc.h +96 -24
- data/assets/include/SDL2/SDL_surface.h +571 -139
- data/assets/include/SDL2/SDL_system.h +339 -101
- data/assets/include/SDL2/SDL_syswm.h +50 -20
- data/assets/include/SDL2/SDL_test.h +1 -1
- data/assets/include/SDL2/SDL_test_assert.h +2 -2
- data/assets/include/SDL2/SDL_test_common.h +23 -6
- data/assets/include/SDL2/SDL_test_compare.h +1 -1
- data/assets/include/SDL2/SDL_test_crc32.h +1 -1
- data/assets/include/SDL2/SDL_test_font.h +3 -3
- data/assets/include/SDL2/SDL_test_fuzzer.h +28 -26
- data/assets/include/SDL2/SDL_test_harness.h +6 -6
- data/assets/include/SDL2/SDL_test_images.h +1 -1
- data/assets/include/SDL2/SDL_test_log.h +1 -1
- data/assets/include/SDL2/SDL_test_md5.h +1 -1
- data/assets/include/SDL2/SDL_test_memory.h +1 -1
- data/assets/include/SDL2/SDL_test_random.h +2 -2
- data/assets/include/SDL2/SDL_thread.h +226 -128
- data/assets/include/SDL2/SDL_timer.h +129 -22
- data/assets/include/SDL2/SDL_touch.h +48 -8
- data/assets/include/SDL2/SDL_ttf.h +102 -9
- data/assets/include/SDL2/SDL_types.h +1 -1
- data/assets/include/SDL2/SDL_version.h +72 -46
- data/assets/include/SDL2/SDL_video.h +1266 -460
- data/assets/include/SDL2/SDL_vulkan.h +100 -161
- data/assets/include/SDL2/begin_code.h +22 -1
- data/assets/include/SDL2/close_code.h +1 -1
- data/assets/include/mrbconf.h +234 -0
- data/assets/include/mruby/array.h +317 -0
- data/assets/include/mruby/boxing_nan.h +130 -0
- data/assets/include/mruby/boxing_no.h +58 -0
- data/assets/include/mruby/boxing_word.h +205 -0
- data/assets/include/mruby/class.h +108 -0
- data/assets/include/mruby/common.h +92 -0
- data/assets/include/mruby/compile.h +210 -0
- data/assets/include/mruby/data.h +76 -0
- data/assets/include/mruby/debug.h +66 -0
- data/assets/include/mruby/dump.h +158 -0
- data/assets/include/mruby/endian.h +44 -0
- data/assets/include/mruby/error.h +137 -0
- data/assets/include/mruby/gc.h +92 -0
- data/assets/include/mruby/hash.h +242 -0
- data/assets/include/mruby/irep.h +147 -0
- data/assets/include/mruby/istruct.h +50 -0
- data/assets/include/mruby/khash.h +284 -0
- data/assets/include/mruby/numeric.h +169 -0
- data/assets/include/mruby/object.h +43 -0
- data/assets/include/mruby/opcode.h +43 -0
- data/assets/include/mruby/ops.h +122 -0
- data/assets/include/mruby/presym/disable.h +70 -0
- data/assets/include/mruby/presym/enable.h +37 -0
- data/assets/include/mruby/presym/scanning.h +73 -0
- data/assets/include/mruby/presym.h +40 -0
- data/assets/include/mruby/proc.h +209 -0
- data/assets/include/mruby/range.h +79 -0
- data/assets/include/mruby/re.h +16 -0
- data/assets/include/mruby/string.h +469 -0
- data/assets/include/mruby/throw.h +66 -0
- data/assets/include/mruby/value.h +400 -0
- data/assets/include/mruby/variable.h +140 -0
- data/assets/include/mruby/version.h +143 -0
- data/assets/include/mruby.h +1444 -0
- data/assets/macos/universal/bin/mrbc +0 -0
- data/assets/macos/universal/lib/libFLAC.a +0 -0
- data/assets/macos/universal/lib/libSDL2.a +0 -0
- data/assets/macos/universal/lib/libSDL2_image.a +0 -0
- data/assets/macos/{lib → universal/lib}/libSDL2_mixer.a +0 -0
- data/assets/macos/universal/lib/libSDL2_ttf.a +0 -0
- data/assets/macos/universal/lib/libfreetype.a +0 -0
- data/assets/macos/universal/lib/libgraphite2.a +0 -0
- data/assets/macos/universal/lib/libharfbuzz.a +0 -0
- data/assets/macos/universal/lib/libjpeg.a +0 -0
- data/assets/macos/universal/lib/libmodplug.a +0 -0
- data/assets/macos/{lib → universal/lib}/libmpg123.a +0 -0
- data/assets/{mingw/lib/libSDL2.a → macos/universal/lib/libmruby.a} +0 -0
- data/assets/macos/{lib → universal/lib}/libogg.a +0 -0
- data/assets/macos/universal/lib/libpng16.a +0 -0
- data/assets/macos/universal/lib/libtiff.a +0 -0
- data/assets/macos/universal/lib/libvorbis.a +0 -0
- data/assets/macos/universal/lib/libvorbisfile.a +0 -0
- data/assets/macos/universal/lib/libwebp.a +0 -0
- data/assets/test_media/README.md +3 -0
- data/assets/test_media/bitstream_vera/COPYRIGHT.txt +124 -0
- data/assets/test_media/bitstream_vera/vera.ttf +0 -0
- data/assets/test_media/boom.png +0 -0
- data/assets/test_media/coin.png +0 -0
- data/assets/test_media/colors.png +0 -0
- data/assets/test_media/controller.png +0 -0
- data/assets/test_media/dial.wav +0 -0
- data/assets/test_media/hero.png +0 -0
- data/assets/test_media/image.bmp +0 -0
- data/assets/test_media/image.jpg +0 -0
- data/assets/test_media/image.png +0 -0
- data/assets/test_media/music.flac +0 -0
- data/assets/test_media/music.mp3 +0 -0
- data/assets/test_media/music.ogg +0 -0
- data/assets/test_media/music.wav +0 -0
- data/assets/test_media/originals/boom.pxm +0 -0
- data/assets/test_media/originals/coin.pxm +0 -0
- data/assets/test_media/originals/controller.sketch +0 -0
- data/assets/test_media/originals/hero.pxm +0 -0
- data/assets/test_media/originals/image.pxm +0 -0
- data/assets/test_media/originals/music.caf +0 -0
- data/assets/test_media/originals/texture_atlas.pxm +0 -0
- data/assets/test_media/rondo_alla_turka.ogg +0 -0
- data/assets/test_media/sound.flac +0 -0
- data/assets/test_media/sound.mp3 +0 -0
- data/assets/test_media/sound.ogg +0 -0
- data/assets/test_media/sound.wav +0 -0
- data/assets/test_media/sprite_sheet.png +0 -0
- data/assets/test_media/texture_atlas.png +0 -0
- data/assets/wasm/build_config.rb +13 -0
- data/assets/wasm/libmruby.a +0 -0
- data/assets/wasm/template.html +17 -0
- data/assets/windows/glew/README.md +10 -0
- data/assets/windows/glew/glew.h +23686 -0
- data/assets/{mingw/lib → windows/glew}/libglew32.a +0 -0
- data/assets/windows/mingw-w64-x86_64/bin/mrbc.exe +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libFLAC.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libLerc.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libSDL2.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libSDL2_image.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libSDL2_mixer.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libSDL2_ttf.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libbrotlicommon.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libbrotlidec.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libbz2.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libdeflate.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libfreetype.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libglew32.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libgraphite2.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libharfbuzz.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libjbig.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libjpeg.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/liblzma.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libmodplug.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libmpg123.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libmruby.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libogg.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libopus.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libopusfile.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libpng16.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libsndfile.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libssp.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libstdc++.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libtiff.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libvorbis.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libvorbisfile.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libwebp.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libz.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libzstd.a +0 -0
- data/assets/{ios → xcode/ios}/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -0
- data/assets/{ios → xcode/ios}/Assets.xcassets/Contents.json +0 -0
- data/assets/{ios → xcode/ios}/Base.lproj/LaunchScreen.storyboard +0 -0
- data/assets/{ios → xcode/ios}/Info.plist +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mrbconf.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/array.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/boxing_nan.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/boxing_no.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/boxing_word.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/class.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/common.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/compile.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/data.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/debug.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/dump.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/error.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/gc.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/hash.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/irep.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/istruct.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/khash.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/numeric.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/object.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/opcode.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/ops.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/proc.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/range.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/re.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/string.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/throw.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/value.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/variable.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/version.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Info.plist +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/MRuby +0 -0
- data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.pbxproj +0 -0
- data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -0
- data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -0
- data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/MyApp.xcscmblueprint +0 -0
- data/assets/{ios → xcode/ios}/main.c +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/LaunchImage.launchimage/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Info.plist +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mrbconf.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/array.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/boxing_nan.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/boxing_no.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/boxing_word.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/class.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/common.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/compile.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/data.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/debug.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/dump.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/error.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/gc.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/hash.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/irep.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/istruct.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/khash.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/numeric.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/object.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/opcode.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/ops.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/proc.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/range.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/re.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/string.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/throw.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/value.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/variable.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/version.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Info.plist +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/MRuby +0 -0
- data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.pbxproj +0 -0
- data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -0
- data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -0
- data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/MyApp.xcscmblueprint +0 -0
- data/assets/{tvos → xcode/tvos}/main.c +0 -0
- data/bin/ruby2d +3 -4
- data/ext/ruby2d/extconf.rb +68 -46
- data/ext/ruby2d/font.c +35 -0
- data/ext/ruby2d/gl.c +9 -58
- data/ext/ruby2d/gl2.c +8 -83
- data/ext/ruby2d/gl3.c +57 -116
- data/ext/ruby2d/gles.c +130 -151
- data/ext/ruby2d/image.c +16 -96
- data/ext/ruby2d/ruby2d.c +265 -298
- data/ext/ruby2d/ruby2d.h +69 -159
- data/ext/ruby2d/sound.c +1 -1
- data/ext/ruby2d/text.c +20 -114
- data/ext/ruby2d/window.c +257 -219
- data/lib/ruby2d/circle.rb +3 -1
- data/lib/ruby2d/cli/build.rb +239 -59
- data/lib/ruby2d/cli/colorize.rb +5 -4
- data/lib/ruby2d/cli/platform.rb +17 -0
- data/lib/ruby2d/font.rb +26 -1
- data/lib/ruby2d/image.rb +22 -17
- data/lib/ruby2d/line.rb +3 -1
- data/lib/ruby2d/quad.rb +3 -1
- data/lib/ruby2d/rectangle.rb +1 -1
- data/lib/ruby2d/renderable.rb +0 -12
- data/lib/ruby2d/sound.rb +25 -0
- data/lib/ruby2d/sprite.rb +44 -89
- data/lib/ruby2d/square.rb +1 -1
- data/lib/ruby2d/text.rb +40 -20
- data/lib/ruby2d/texture.rb +28 -0
- data/lib/ruby2d/tileset.rb +47 -28
- data/lib/ruby2d/triangle.rb +3 -1
- data/lib/ruby2d/version.rb +1 -1
- data/lib/ruby2d/vertices.rb +89 -0
- data/lib/ruby2d/window.rb +13 -3
- data/lib/ruby2d.rb +16 -20
- metadata +249 -153
- data/assets/README.md +0 -22
- data/assets/Rakefile +0 -85
- data/assets/macos/lib/libFLAC.a +0 -0
- data/assets/macos/lib/libSDL2.a +0 -0
- data/assets/macos/lib/libSDL2_image.a +0 -0
- data/assets/macos/lib/libSDL2_ttf.a +0 -0
- data/assets/macos/lib/libfreetype.a +0 -0
- data/assets/macos/lib/libjpeg.a +0 -0
- data/assets/macos/lib/libpng16.a +0 -0
- data/assets/macos/lib/libtiff.a +0 -0
- data/assets/macos/lib/libvorbis.a +0 -0
- data/assets/macos/lib/libvorbisfile.a +0 -0
- data/assets/macos/lib/libwebp.a +0 -0
- data/assets/mingw/bin/SDL2.dll +0 -0
- data/assets/mingw/bin/SDL2_image.dll +0 -0
- data/assets/mingw/bin/SDL2_mixer.dll +0 -0
- data/assets/mingw/bin/SDL2_ttf.dll +0 -0
- data/assets/mingw/bin/glew32.dll +0 -0
- data/assets/mingw/bin/libFLAC-8.dll +0 -0
- data/assets/mingw/bin/libfreetype-6.dll +0 -0
- data/assets/mingw/bin/libjpeg-9.dll +0 -0
- data/assets/mingw/bin/libmodplug-1.dll +0 -0
- data/assets/mingw/bin/libmpg123-0.dll +0 -0
- data/assets/mingw/bin/libogg-0.dll +0 -0
- data/assets/mingw/bin/libopus-0.dll +0 -0
- data/assets/mingw/bin/libopusfile-0.dll +0 -0
- data/assets/mingw/bin/libpng16-16.dll +0 -0
- data/assets/mingw/bin/libtiff-5.dll +0 -0
- data/assets/mingw/bin/libvorbis-0.dll +0 -0
- data/assets/mingw/bin/libvorbisfile-3.dll +0 -0
- data/assets/mingw/bin/libwebp-7.dll +0 -0
- data/assets/mingw/bin/zlib1.dll +0 -0
- data/assets/mingw/lib/libSDL2.dll.a +0 -0
- data/assets/mingw/lib/libSDL2_image.a +0 -0
- data/assets/mingw/lib/libSDL2_image.dll.a +0 -0
- data/assets/mingw/lib/libSDL2_mixer.a +0 -0
- data/assets/mingw/lib/libSDL2_mixer.dll.a +0 -0
- data/assets/mingw/lib/libSDL2_test.a +0 -0
- data/assets/mingw/lib/libSDL2_ttf.a +0 -0
- data/assets/mingw/lib/libSDL2_ttf.dll.a +0 -0
- data/assets/mingw/lib/libSDL2main.a +0 -0
- data/assets/mingw/lib/libglew32.dll.a +0 -0
- data/ext/ruby2d/sprite.c +0 -147
- data/ext/ruby2d/tileset.c +0 -30
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
Simple DirectMedia Layer
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
4
4
|
|
5
5
|
This software is provided 'as-is', without any express or implied
|
6
6
|
warranty. In no event will the authors be held liable for any damages
|
@@ -30,10 +30,12 @@
|
|
30
30
|
* The term "instance_id" is the current instantiation of a joystick device in the system, if the joystick is removed and then re-inserted
|
31
31
|
* then it will get a new instance_id, instance_id's are monotonically increasing identifiers of a joystick plugged in.
|
32
32
|
*
|
33
|
+
* The term "player_index" is the number assigned to a player on a specific
|
34
|
+
* controller. For XInput controllers this returns the XInput user index.
|
35
|
+
* Many joysticks will not be able to supply this information.
|
36
|
+
*
|
33
37
|
* The term JoystickGUID is a stable 128-bit identifier for a joystick device that does not change over time, it identifies class of
|
34
38
|
* the device (a X360 wired controller for example). This identifier is platform dependent.
|
35
|
-
*
|
36
|
-
*
|
37
39
|
*/
|
38
40
|
|
39
41
|
#ifndef SDL_joystick_h_
|
@@ -122,92 +124,206 @@ typedef enum
|
|
122
124
|
* In particular, you are guaranteed that the joystick list won't change, so
|
123
125
|
* the API functions that take a joystick index will be valid, and joystick
|
124
126
|
* and game controller events will not be delivered.
|
127
|
+
*
|
128
|
+
* \since This function is available since SDL 2.0.7.
|
125
129
|
*/
|
126
130
|
extern DECLSPEC void SDLCALL SDL_LockJoysticks(void);
|
131
|
+
|
132
|
+
|
133
|
+
/**
|
134
|
+
* Unlocking for multi-threaded access to the joystick API
|
135
|
+
*
|
136
|
+
* If you are using the joystick API or handling events from multiple threads
|
137
|
+
* you should use these locking functions to protect access to the joysticks.
|
138
|
+
*
|
139
|
+
* In particular, you are guaranteed that the joystick list won't change, so
|
140
|
+
* the API functions that take a joystick index will be valid, and joystick
|
141
|
+
* and game controller events will not be delivered.
|
142
|
+
*
|
143
|
+
* \since This function is available since SDL 2.0.7.
|
144
|
+
*/
|
127
145
|
extern DECLSPEC void SDLCALL SDL_UnlockJoysticks(void);
|
128
146
|
|
129
147
|
/**
|
130
|
-
*
|
148
|
+
* Count the number of joysticks attached to the system.
|
149
|
+
*
|
150
|
+
* \returns the number of attached joysticks on success or a negative error
|
151
|
+
* code on failure; call SDL_GetError() for more information.
|
152
|
+
*
|
153
|
+
* \since This function is available since SDL 2.0.0.
|
154
|
+
*
|
155
|
+
* \sa SDL_JoystickName
|
156
|
+
* \sa SDL_JoystickOpen
|
131
157
|
*/
|
132
158
|
extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
|
133
159
|
|
134
160
|
/**
|
135
|
-
*
|
136
|
-
*
|
137
|
-
*
|
161
|
+
* Get the implementation dependent name of a joystick.
|
162
|
+
*
|
163
|
+
* This can be called before any joysticks are opened.
|
164
|
+
*
|
165
|
+
* \param device_index the index of the joystick to query (the N'th joystick
|
166
|
+
* on the system)
|
167
|
+
* \returns the name of the selected joystick. If no name can be found, this
|
168
|
+
* function returns NULL; call SDL_GetError() for more information.
|
169
|
+
*
|
170
|
+
* \since This function is available since SDL 2.0.0.
|
171
|
+
*
|
172
|
+
* \sa SDL_JoystickName
|
173
|
+
* \sa SDL_JoystickOpen
|
138
174
|
*/
|
139
175
|
extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index);
|
140
176
|
|
141
177
|
/**
|
142
|
-
*
|
143
|
-
*
|
178
|
+
* Get the player index of a joystick, or -1 if it's not available This can be
|
179
|
+
* called before any joysticks are opened.
|
180
|
+
*
|
181
|
+
* \since This function is available since SDL 2.0.9.
|
144
182
|
*/
|
145
183
|
extern DECLSPEC int SDLCALL SDL_JoystickGetDevicePlayerIndex(int device_index);
|
146
184
|
|
147
185
|
/**
|
148
|
-
*
|
149
|
-
*
|
186
|
+
* Get the implementation-dependent GUID for the joystick at a given device
|
187
|
+
* index.
|
188
|
+
*
|
189
|
+
* This function can be called before any joysticks are opened.
|
190
|
+
*
|
191
|
+
* \param device_index the index of the joystick to query (the N'th joystick
|
192
|
+
* on the system
|
193
|
+
* \returns the GUID of the selected joystick. If called on an invalid index,
|
194
|
+
* this function returns a zero GUID
|
195
|
+
*
|
196
|
+
* \since This function is available since SDL 2.0.0.
|
197
|
+
*
|
198
|
+
* \sa SDL_JoystickGetGUID
|
199
|
+
* \sa SDL_JoystickGetGUIDString
|
150
200
|
*/
|
151
201
|
extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetDeviceGUID(int device_index);
|
152
202
|
|
153
203
|
/**
|
154
|
-
*
|
155
|
-
*
|
156
|
-
*
|
204
|
+
* Get the USB vendor ID of a joystick, if available.
|
205
|
+
*
|
206
|
+
* This can be called before any joysticks are opened. If the vendor ID isn't
|
207
|
+
* available this function returns 0.
|
208
|
+
*
|
209
|
+
* \param device_index the index of the joystick to query (the N'th joystick
|
210
|
+
* on the system
|
211
|
+
* \returns the USB vendor ID of the selected joystick. If called on an
|
212
|
+
* invalid index, this function returns zero
|
213
|
+
*
|
214
|
+
* \since This function is available since SDL 2.0.6.
|
157
215
|
*/
|
158
216
|
extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceVendor(int device_index);
|
159
217
|
|
160
218
|
/**
|
161
|
-
*
|
162
|
-
*
|
163
|
-
*
|
219
|
+
* Get the USB product ID of a joystick, if available.
|
220
|
+
*
|
221
|
+
* This can be called before any joysticks are opened. If the product ID isn't
|
222
|
+
* available this function returns 0.
|
223
|
+
*
|
224
|
+
* \param device_index the index of the joystick to query (the N'th joystick
|
225
|
+
* on the system
|
226
|
+
* \returns the USB product ID of the selected joystick. If called on an
|
227
|
+
* invalid index, this function returns zero
|
228
|
+
*
|
229
|
+
* \since This function is available since SDL 2.0.6.
|
164
230
|
*/
|
165
231
|
extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProduct(int device_index);
|
166
232
|
|
167
233
|
/**
|
168
|
-
*
|
169
|
-
*
|
170
|
-
*
|
234
|
+
* Get the product version of a joystick, if available.
|
235
|
+
*
|
236
|
+
* This can be called before any joysticks are opened. If the product version
|
237
|
+
* isn't available this function returns 0.
|
238
|
+
*
|
239
|
+
* \param device_index the index of the joystick to query (the N'th joystick
|
240
|
+
* on the system
|
241
|
+
* \returns the product version of the selected joystick. If called on an
|
242
|
+
* invalid index, this function returns zero
|
243
|
+
*
|
244
|
+
* \since This function is available since SDL 2.0.6.
|
171
245
|
*/
|
172
246
|
extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProductVersion(int device_index);
|
173
247
|
|
174
248
|
/**
|
175
|
-
*
|
176
|
-
*
|
249
|
+
* Get the type of a joystick, if available.
|
250
|
+
*
|
251
|
+
* This can be called before any joysticks are opened.
|
252
|
+
*
|
253
|
+
* \param device_index the index of the joystick to query (the N'th joystick
|
254
|
+
* on the system
|
255
|
+
* \returns the SDL_JoystickType of the selected joystick. If called on an
|
256
|
+
* invalid index, this function returns `SDL_JOYSTICK_TYPE_UNKNOWN`
|
257
|
+
*
|
258
|
+
* \since This function is available since SDL 2.0.6.
|
177
259
|
*/
|
178
260
|
extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetDeviceType(int device_index);
|
179
261
|
|
180
262
|
/**
|
181
|
-
*
|
182
|
-
*
|
183
|
-
*
|
263
|
+
* Get the instance ID of a joystick.
|
264
|
+
*
|
265
|
+
* This can be called before any joysticks are opened. If the index is out of
|
266
|
+
* range, this function will return -1.
|
267
|
+
*
|
268
|
+
* \param device_index the index of the joystick to query (the N'th joystick
|
269
|
+
* on the system
|
270
|
+
* \returns the instance id of the selected joystick. If called on an invalid
|
271
|
+
* index, this function returns zero
|
272
|
+
*
|
273
|
+
* \since This function is available since SDL 2.0.6.
|
184
274
|
*/
|
185
275
|
extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickGetDeviceInstanceID(int device_index);
|
186
276
|
|
187
277
|
/**
|
188
|
-
*
|
189
|
-
*
|
190
|
-
*
|
191
|
-
*
|
192
|
-
*
|
278
|
+
* Open a joystick for use.
|
279
|
+
*
|
280
|
+
* The `device_index` argument refers to the N'th joystick presently
|
281
|
+
* recognized by SDL on the system. It is **NOT** the same as the instance ID
|
282
|
+
* used to identify the joystick in future events. See
|
283
|
+
* SDL_JoystickInstanceID() for more details about instance IDs.
|
193
284
|
*
|
194
|
-
*
|
285
|
+
* The joystick subsystem must be initialized before a joystick can be opened
|
286
|
+
* for use.
|
287
|
+
*
|
288
|
+
* \param device_index the index of the joystick to query
|
289
|
+
* \returns a joystick identifier or NULL if an error occurred; call
|
290
|
+
* SDL_GetError() for more information.
|
291
|
+
*
|
292
|
+
* \since This function is available since SDL 2.0.0.
|
293
|
+
*
|
294
|
+
* \sa SDL_JoystickClose
|
295
|
+
* \sa SDL_JoystickInstanceID
|
195
296
|
*/
|
196
297
|
extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickOpen(int device_index);
|
197
298
|
|
198
299
|
/**
|
199
|
-
*
|
300
|
+
* Get the SDL_Joystick associated with an instance id.
|
301
|
+
*
|
302
|
+
* \param instance_id the instance id to get the SDL_Joystick for
|
303
|
+
* \returns an SDL_Joystick on success or NULL on failure; call SDL_GetError()
|
304
|
+
* for more information.
|
305
|
+
*
|
306
|
+
* \since This function is available since SDL 2.0.4.
|
200
307
|
*/
|
201
308
|
extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromInstanceID(SDL_JoystickID instance_id);
|
202
309
|
|
203
310
|
/**
|
204
|
-
*
|
311
|
+
* Get the SDL_Joystick associated with a player index.
|
312
|
+
*
|
313
|
+
* \param player_index the player index to get the SDL_Joystick for
|
314
|
+
* \returns an SDL_Joystick on success or NULL on failure; call SDL_GetError()
|
315
|
+
* for more information.
|
316
|
+
*
|
317
|
+
* \since This function is available since SDL 2.0.12.
|
205
318
|
*/
|
206
319
|
extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromPlayerIndex(int player_index);
|
207
320
|
|
208
321
|
/**
|
209
|
-
*
|
210
|
-
*
|
322
|
+
* Attach a new virtual joystick.
|
323
|
+
*
|
324
|
+
* \returns the joystick's device index, or -1 if an error occurred.
|
325
|
+
*
|
326
|
+
* \since This function is available since SDL 2.0.14.
|
211
327
|
*/
|
212
328
|
extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtual(SDL_JoystickType type,
|
213
329
|
int naxes,
|
@@ -215,166 +331,396 @@ extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtual(SDL_JoystickType type,
|
|
215
331
|
int nhats);
|
216
332
|
|
217
333
|
/**
|
218
|
-
*
|
219
|
-
*
|
334
|
+
* Detach a virtual joystick.
|
335
|
+
*
|
336
|
+
* \param device_index a value previously returned from
|
337
|
+
* SDL_JoystickAttachVirtual()
|
338
|
+
* \returns 0 on success, or -1 if an error occurred.
|
339
|
+
*
|
340
|
+
* \since This function is available since SDL 2.0.14.
|
220
341
|
*/
|
221
342
|
extern DECLSPEC int SDLCALL SDL_JoystickDetachVirtual(int device_index);
|
222
343
|
|
223
344
|
/**
|
224
|
-
*
|
345
|
+
* Query whether or not the joystick at a given device index is virtual.
|
346
|
+
*
|
347
|
+
* \param device_index a joystick device index.
|
348
|
+
* \returns SDL_TRUE if the joystick is virtual, SDL_FALSE otherwise.
|
349
|
+
*
|
350
|
+
* \since This function is available since SDL 2.0.14.
|
225
351
|
*/
|
226
352
|
extern DECLSPEC SDL_bool SDLCALL SDL_JoystickIsVirtual(int device_index);
|
227
353
|
|
228
354
|
/**
|
229
|
-
* Set values on an opened, virtual-joystick's
|
230
|
-
*
|
231
|
-
*
|
232
|
-
*
|
233
|
-
* including, but not limited to
|
234
|
-
* SDL_PumpEvents, SDL_WaitEventTimeout,
|
235
|
-
*
|
236
|
-
*
|
355
|
+
* Set values on an opened, virtual-joystick's axis.
|
356
|
+
*
|
357
|
+
* Please note that values set here will not be applied until the next call to
|
358
|
+
* SDL_JoystickUpdate, which can either be called directly, or can be called
|
359
|
+
* indirectly through various other SDL APIs, including, but not limited to
|
360
|
+
* the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout,
|
361
|
+
* SDL_WaitEvent.
|
362
|
+
*
|
363
|
+
* \param joystick the virtual joystick on which to set state.
|
364
|
+
* \param axis the specific axis on the virtual joystick to set.
|
365
|
+
* \param value the new value for the specified axis.
|
366
|
+
* \returns 0 on success, -1 on error.
|
367
|
+
*
|
368
|
+
* \since This function is available since SDL 2.0.14.
|
237
369
|
*/
|
238
370
|
extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 value);
|
371
|
+
|
372
|
+
/**
|
373
|
+
* Set values on an opened, virtual-joystick's button.
|
374
|
+
*
|
375
|
+
* Please note that values set here will not be applied until the next call to
|
376
|
+
* SDL_JoystickUpdate, which can either be called directly, or can be called
|
377
|
+
* indirectly through various other SDL APIs, including, but not limited to
|
378
|
+
* the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout,
|
379
|
+
* SDL_WaitEvent.
|
380
|
+
*
|
381
|
+
* \param joystick the virtual joystick on which to set state.
|
382
|
+
* \param button the specific button on the virtual joystick to set.
|
383
|
+
* \param value the new value for the specified button.
|
384
|
+
* \returns 0 on success, -1 on error.
|
385
|
+
*
|
386
|
+
* \since This function is available since SDL 2.0.14.
|
387
|
+
*/
|
239
388
|
extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualButton(SDL_Joystick *joystick, int button, Uint8 value);
|
389
|
+
|
390
|
+
/**
|
391
|
+
* Set values on an opened, virtual-joystick's hat.
|
392
|
+
*
|
393
|
+
* Please note that values set here will not be applied until the next call to
|
394
|
+
* SDL_JoystickUpdate, which can either be called directly, or can be called
|
395
|
+
* indirectly through various other SDL APIs, including, but not limited to
|
396
|
+
* the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout,
|
397
|
+
* SDL_WaitEvent.
|
398
|
+
*
|
399
|
+
* \param joystick the virtual joystick on which to set state.
|
400
|
+
* \param hat the specific hat on the virtual joystick to set.
|
401
|
+
* \param value the new value for the specified hat.
|
402
|
+
* \returns 0 on success, -1 on error.
|
403
|
+
*
|
404
|
+
* \since This function is available since SDL 2.0.14.
|
405
|
+
*/
|
240
406
|
extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualHat(SDL_Joystick *joystick, int hat, Uint8 value);
|
241
407
|
|
242
408
|
/**
|
243
|
-
*
|
244
|
-
*
|
409
|
+
* Get the implementation dependent name of a joystick.
|
410
|
+
*
|
411
|
+
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
|
412
|
+
* \returns the name of the selected joystick. If no name can be found, this
|
413
|
+
* function returns NULL; call SDL_GetError() for more information.
|
414
|
+
*
|
415
|
+
* \since This function is available since SDL 2.0.0.
|
416
|
+
*
|
417
|
+
* \sa SDL_JoystickNameForIndex
|
418
|
+
* \sa SDL_JoystickOpen
|
245
419
|
*/
|
246
420
|
extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick *joystick);
|
247
421
|
|
248
422
|
/**
|
249
|
-
*
|
423
|
+
* Get the player index of an opened joystick.
|
424
|
+
*
|
425
|
+
* For XInput controllers this returns the XInput user index. Many joysticks
|
426
|
+
* will not be able to supply this information.
|
427
|
+
*
|
428
|
+
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
|
429
|
+
* \returns the player index, or -1 if it's not available.
|
250
430
|
*
|
251
|
-
*
|
431
|
+
* \since This function is available since SDL 2.0.9.
|
252
432
|
*/
|
253
433
|
extern DECLSPEC int SDLCALL SDL_JoystickGetPlayerIndex(SDL_Joystick *joystick);
|
254
434
|
|
255
435
|
/**
|
256
|
-
*
|
436
|
+
* Set the player index of an opened joystick.
|
437
|
+
*
|
438
|
+
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
|
439
|
+
* \param player_index the player index to set.
|
440
|
+
*
|
441
|
+
* \since This function is available since SDL 2.0.12.
|
257
442
|
*/
|
258
443
|
extern DECLSPEC void SDLCALL SDL_JoystickSetPlayerIndex(SDL_Joystick *joystick, int player_index);
|
259
444
|
|
260
445
|
/**
|
261
|
-
*
|
446
|
+
* Get the implementation-dependent GUID for the joystick.
|
447
|
+
*
|
448
|
+
* This function requires an open joystick.
|
449
|
+
*
|
450
|
+
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
|
451
|
+
* \returns the GUID of the given joystick. If called on an invalid index,
|
452
|
+
* this function returns a zero GUID; call SDL_GetError() for more
|
453
|
+
* information.
|
454
|
+
*
|
455
|
+
* \since This function is available since SDL 2.0.0.
|
456
|
+
*
|
457
|
+
* \sa SDL_JoystickGetDeviceGUID
|
458
|
+
* \sa SDL_JoystickGetGUIDString
|
262
459
|
*/
|
263
460
|
extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUID(SDL_Joystick *joystick);
|
264
461
|
|
265
462
|
/**
|
266
|
-
*
|
267
|
-
*
|
463
|
+
* Get the USB vendor ID of an opened joystick, if available.
|
464
|
+
*
|
465
|
+
* If the vendor ID isn't available this function returns 0.
|
466
|
+
*
|
467
|
+
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
|
468
|
+
* \returns the USB vendor ID of the selected joystick, or 0 if unavailable.
|
469
|
+
*
|
470
|
+
* \since This function is available since SDL 2.0.6.
|
268
471
|
*/
|
269
472
|
extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetVendor(SDL_Joystick *joystick);
|
270
473
|
|
271
474
|
/**
|
272
|
-
*
|
273
|
-
*
|
475
|
+
* Get the USB product ID of an opened joystick, if available.
|
476
|
+
*
|
477
|
+
* If the product ID isn't available this function returns 0.
|
478
|
+
*
|
479
|
+
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
|
480
|
+
* \returns the USB product ID of the selected joystick, or 0 if unavailable.
|
481
|
+
*
|
482
|
+
* \since This function is available since SDL 2.0.6.
|
274
483
|
*/
|
275
484
|
extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProduct(SDL_Joystick *joystick);
|
276
485
|
|
277
486
|
/**
|
278
|
-
*
|
279
|
-
*
|
487
|
+
* Get the product version of an opened joystick, if available.
|
488
|
+
*
|
489
|
+
* If the product version isn't available this function returns 0.
|
490
|
+
*
|
491
|
+
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
|
492
|
+
* \returns the product version of the selected joystick, or 0 if unavailable.
|
493
|
+
*
|
494
|
+
* \since This function is available since SDL 2.0.6.
|
280
495
|
*/
|
281
496
|
extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProductVersion(SDL_Joystick *joystick);
|
282
497
|
|
283
498
|
/**
|
284
|
-
*
|
285
|
-
*
|
286
|
-
*
|
499
|
+
* Get the serial number of an opened joystick, if available.
|
500
|
+
*
|
501
|
+
* Returns the serial number of the joystick, or NULL if it is not available.
|
502
|
+
*
|
503
|
+
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
|
504
|
+
* \returns the serial number of the selected joystick, or NULL if
|
505
|
+
* unavailable.
|
506
|
+
*
|
507
|
+
* \since This function is available since SDL 2.0.14.
|
287
508
|
*/
|
288
509
|
extern DECLSPEC const char * SDLCALL SDL_JoystickGetSerial(SDL_Joystick *joystick);
|
289
510
|
|
290
511
|
/**
|
291
|
-
*
|
512
|
+
* Get the type of an opened joystick.
|
513
|
+
*
|
514
|
+
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
|
515
|
+
* \returns the SDL_JoystickType of the selected joystick.
|
516
|
+
*
|
517
|
+
* \since This function is available since SDL 2.0.6.
|
292
518
|
*/
|
293
519
|
extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetType(SDL_Joystick *joystick);
|
294
520
|
|
295
521
|
/**
|
296
|
-
*
|
297
|
-
*
|
522
|
+
* Get an ASCII string representation for a given SDL_JoystickGUID.
|
523
|
+
*
|
524
|
+
* You should supply at least 33 bytes for pszGUID.
|
525
|
+
*
|
526
|
+
* \param guid the SDL_JoystickGUID you wish to convert to string
|
527
|
+
* \param pszGUID buffer in which to write the ASCII string
|
528
|
+
* \param cbGUID the size of pszGUID
|
529
|
+
*
|
530
|
+
* \since This function is available since SDL 2.0.0.
|
531
|
+
*
|
532
|
+
* \sa SDL_JoystickGetDeviceGUID
|
533
|
+
* \sa SDL_JoystickGetGUID
|
534
|
+
* \sa SDL_JoystickGetGUIDFromString
|
298
535
|
*/
|
299
536
|
extern DECLSPEC void SDLCALL SDL_JoystickGetGUIDString(SDL_JoystickGUID guid, char *pszGUID, int cbGUID);
|
300
537
|
|
301
538
|
/**
|
302
|
-
*
|
539
|
+
* Convert a GUID string into a SDL_JoystickGUID structure.
|
540
|
+
*
|
541
|
+
* Performs no error checking. If this function is given a string containing
|
542
|
+
* an invalid GUID, the function will silently succeed, but the GUID generated
|
543
|
+
* will not be useful.
|
544
|
+
*
|
545
|
+
* \param pchGUID string containing an ASCII representation of a GUID
|
546
|
+
* \returns a SDL_JoystickGUID structure.
|
547
|
+
*
|
548
|
+
* \since This function is available since SDL 2.0.0.
|
549
|
+
*
|
550
|
+
* \sa SDL_JoystickGetGUIDString
|
303
551
|
*/
|
304
552
|
extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUIDFromString(const char *pchGUID);
|
305
553
|
|
306
554
|
/**
|
307
|
-
*
|
555
|
+
* Get the status of a specified joystick.
|
556
|
+
*
|
557
|
+
* \param joystick the joystick to query
|
558
|
+
* \returns SDL_TRUE if the joystick has been opened, SDL_FALSE if it has not;
|
559
|
+
* call SDL_GetError() for more information.
|
560
|
+
*
|
561
|
+
* \since This function is available since SDL 2.0.0.
|
562
|
+
*
|
563
|
+
* \sa SDL_JoystickClose
|
564
|
+
* \sa SDL_JoystickOpen
|
308
565
|
*/
|
309
566
|
extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAttached(SDL_Joystick *joystick);
|
310
567
|
|
311
568
|
/**
|
312
|
-
*
|
569
|
+
* Get the instance ID of an opened joystick.
|
570
|
+
*
|
571
|
+
* \param joystick an SDL_Joystick structure containing joystick information
|
572
|
+
* \returns the instance ID of the specified joystick on success or a negative
|
573
|
+
* error code on failure; call SDL_GetError() for more information.
|
574
|
+
*
|
575
|
+
* \since This function is available since SDL 2.0.0.
|
576
|
+
*
|
577
|
+
* \sa SDL_JoystickOpen
|
313
578
|
*/
|
314
579
|
extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickInstanceID(SDL_Joystick *joystick);
|
315
580
|
|
316
581
|
/**
|
317
|
-
*
|
582
|
+
* Get the number of general axis controls on a joystick.
|
583
|
+
*
|
584
|
+
* Often, the directional pad on a game controller will either look like 4
|
585
|
+
* separate buttons or a POV hat, and not axes, but all of this is up to the
|
586
|
+
* device and platform.
|
587
|
+
*
|
588
|
+
* \param joystick an SDL_Joystick structure containing joystick information
|
589
|
+
* \returns the number of axis controls/number of axes on success or a
|
590
|
+
* negative error code on failure; call SDL_GetError() for more
|
591
|
+
* information.
|
592
|
+
*
|
593
|
+
* \since This function is available since SDL 2.0.0.
|
594
|
+
*
|
595
|
+
* \sa SDL_JoystickGetAxis
|
596
|
+
* \sa SDL_JoystickOpen
|
318
597
|
*/
|
319
598
|
extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick *joystick);
|
320
599
|
|
321
600
|
/**
|
322
|
-
*
|
601
|
+
* Get the number of trackballs on a joystick.
|
323
602
|
*
|
324
|
-
*
|
325
|
-
*
|
603
|
+
* Joystick trackballs have only relative motion events associated with them
|
604
|
+
* and their state cannot be polled.
|
605
|
+
*
|
606
|
+
* Most joysticks do not have trackballs.
|
607
|
+
*
|
608
|
+
* \param joystick an SDL_Joystick structure containing joystick information
|
609
|
+
* \returns the number of trackballs on success or a negative error code on
|
610
|
+
* failure; call SDL_GetError() for more information.
|
611
|
+
*
|
612
|
+
* \since This function is available since SDL 2.0.0.
|
613
|
+
*
|
614
|
+
* \sa SDL_JoystickGetBall
|
326
615
|
*/
|
327
616
|
extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick *joystick);
|
328
617
|
|
329
618
|
/**
|
330
|
-
*
|
619
|
+
* Get the number of POV hats on a joystick.
|
620
|
+
*
|
621
|
+
* \param joystick an SDL_Joystick structure containing joystick information
|
622
|
+
* \returns the number of POV hats on success or a negative error code on
|
623
|
+
* failure; call SDL_GetError() for more information.
|
624
|
+
*
|
625
|
+
* \since This function is available since SDL 2.0.0.
|
626
|
+
*
|
627
|
+
* \sa SDL_JoystickGetHat
|
628
|
+
* \sa SDL_JoystickOpen
|
331
629
|
*/
|
332
630
|
extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick *joystick);
|
333
631
|
|
334
632
|
/**
|
335
|
-
*
|
633
|
+
* Get the number of buttons on a joystick.
|
634
|
+
*
|
635
|
+
* \param joystick an SDL_Joystick structure containing joystick information
|
636
|
+
* \returns the number of buttons on success or a negative error code on
|
637
|
+
* failure; call SDL_GetError() for more information.
|
638
|
+
*
|
639
|
+
* \since This function is available since SDL 2.0.0.
|
640
|
+
*
|
641
|
+
* \sa SDL_JoystickGetButton
|
642
|
+
* \sa SDL_JoystickOpen
|
336
643
|
*/
|
337
644
|
extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick *joystick);
|
338
645
|
|
339
646
|
/**
|
340
|
-
*
|
647
|
+
* Update the current state of the open joysticks.
|
648
|
+
*
|
649
|
+
* This is called automatically by the event loop if any joystick events are
|
650
|
+
* enabled.
|
341
651
|
*
|
342
|
-
*
|
343
|
-
*
|
652
|
+
* \since This function is available since SDL 2.0.0.
|
653
|
+
*
|
654
|
+
* \sa SDL_JoystickEventState
|
344
655
|
*/
|
345
656
|
extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void);
|
346
657
|
|
347
658
|
/**
|
348
|
-
*
|
659
|
+
* Enable/disable joystick event polling.
|
660
|
+
*
|
661
|
+
* If joystick events are disabled, you must call SDL_JoystickUpdate()
|
662
|
+
* yourself and manually check the state of the joystick when you want
|
663
|
+
* joystick information.
|
664
|
+
*
|
665
|
+
* It is recommended that you leave joystick event handling enabled.
|
666
|
+
*
|
667
|
+
* **WARNING**: Calling this function may delete all events currently in SDL's
|
668
|
+
* event queue.
|
669
|
+
*
|
670
|
+
* \param state can be one of `SDL_QUERY`, `SDL_IGNORE`, or `SDL_ENABLE`
|
671
|
+
* \returns 1 if enabled, 0 if disabled, or a negative error code on failure;
|
672
|
+
* call SDL_GetError() for more information.
|
349
673
|
*
|
350
|
-
*
|
351
|
-
*
|
352
|
-
* information.
|
674
|
+
* If `state` is `SDL_QUERY` then the current state is returned,
|
675
|
+
* otherwise the new processing state is returned.
|
353
676
|
*
|
354
|
-
*
|
677
|
+
* \since This function is available since SDL 2.0.0.
|
678
|
+
*
|
679
|
+
* \sa SDL_GameControllerEventState
|
355
680
|
*/
|
356
681
|
extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state);
|
357
682
|
|
358
683
|
#define SDL_JOYSTICK_AXIS_MAX 32767
|
359
684
|
#define SDL_JOYSTICK_AXIS_MIN -32768
|
685
|
+
|
360
686
|
/**
|
361
|
-
*
|
687
|
+
* Get the current state of an axis control on a joystick.
|
688
|
+
*
|
689
|
+
* SDL makes no promises about what part of the joystick any given axis refers
|
690
|
+
* to. Your game should have some sort of configuration UI to let users
|
691
|
+
* specify what each axis should be bound to. Alternately, SDL's higher-level
|
692
|
+
* Game Controller API makes a great effort to apply order to this lower-level
|
693
|
+
* interface, so you know that a specific axis is the "left thumb stick," etc.
|
362
694
|
*
|
363
|
-
*
|
695
|
+
* The value returned by SDL_JoystickGetAxis() is a signed integer (-32768 to
|
696
|
+
* 32767) representing the current position of the axis. It may be necessary
|
697
|
+
* to impose certain tolerances on these values to account for jitter.
|
364
698
|
*
|
365
|
-
*
|
699
|
+
* \param joystick an SDL_Joystick structure containing joystick information
|
700
|
+
* \param axis the axis to query; the axis indices start at index 0
|
701
|
+
* \returns a 16-bit signed integer representing the current position of the
|
702
|
+
* axis or 0 on failure; call SDL_GetError() for more information.
|
703
|
+
*
|
704
|
+
* \since This function is available since SDL 2.0.0.
|
705
|
+
*
|
706
|
+
* \sa SDL_JoystickNumAxes
|
366
707
|
*/
|
367
708
|
extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick *joystick,
|
368
709
|
int axis);
|
369
710
|
|
370
711
|
/**
|
371
|
-
*
|
712
|
+
* Get the initial state of an axis control on a joystick.
|
713
|
+
*
|
714
|
+
* The state is a value ranging from -32768 to 32767.
|
372
715
|
*
|
373
|
-
*
|
716
|
+
* The axis indices start at index 0.
|
374
717
|
*
|
375
|
-
*
|
718
|
+
* \param joystick an SDL_Joystick structure containing joystick information
|
719
|
+
* \param axis the axis to query; the axis indices start at index 0
|
720
|
+
* \param state Upon return, the initial value is supplied here.
|
721
|
+
* \return SDL_TRUE if this axis has any initial value, or SDL_FALSE if not.
|
376
722
|
*
|
377
|
-
*
|
723
|
+
* \since This function is available since SDL 2.0.6.
|
378
724
|
*/
|
379
725
|
extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAxisInitialState(SDL_Joystick *joystick,
|
380
726
|
int axis, Sint16 *state);
|
@@ -395,96 +741,197 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAxisInitialState(SDL_Joystick *j
|
|
395
741
|
/* @} */
|
396
742
|
|
397
743
|
/**
|
398
|
-
*
|
744
|
+
* Get the current state of a POV hat on a joystick.
|
399
745
|
*
|
400
|
-
*
|
746
|
+
* The returned value will be one of the following positions:
|
401
747
|
*
|
402
|
-
*
|
403
|
-
*
|
404
|
-
*
|
405
|
-
*
|
406
|
-
*
|
407
|
-
*
|
408
|
-
*
|
409
|
-
*
|
410
|
-
*
|
411
|
-
*
|
748
|
+
* - `SDL_HAT_CENTERED`
|
749
|
+
* - `SDL_HAT_UP`
|
750
|
+
* - `SDL_HAT_RIGHT`
|
751
|
+
* - `SDL_HAT_DOWN`
|
752
|
+
* - `SDL_HAT_LEFT`
|
753
|
+
* - `SDL_HAT_RIGHTUP`
|
754
|
+
* - `SDL_HAT_RIGHTDOWN`
|
755
|
+
* - `SDL_HAT_LEFTUP`
|
756
|
+
* - `SDL_HAT_LEFTDOWN`
|
757
|
+
*
|
758
|
+
* \param joystick an SDL_Joystick structure containing joystick information
|
759
|
+
* \param hat the hat index to get the state from; indices start at index 0
|
760
|
+
* \returns the current hat position.
|
761
|
+
*
|
762
|
+
* \since This function is available since SDL 2.0.0.
|
763
|
+
*
|
764
|
+
* \sa SDL_JoystickNumHats
|
412
765
|
*/
|
413
766
|
extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick *joystick,
|
414
767
|
int hat);
|
415
768
|
|
416
769
|
/**
|
417
|
-
*
|
770
|
+
* Get the ball axis change since the last poll.
|
771
|
+
*
|
772
|
+
* Trackballs can only return relative motion since the last call to
|
773
|
+
* SDL_JoystickGetBall(), these motion deltas are placed into `dx` and `dy`.
|
774
|
+
*
|
775
|
+
* Most joysticks do not have trackballs.
|
418
776
|
*
|
419
|
-
*
|
777
|
+
* \param joystick the SDL_Joystick to query
|
778
|
+
* \param ball the ball index to query; ball indices start at index 0
|
779
|
+
* \param dx stores the difference in the x axis position since the last poll
|
780
|
+
* \param dy stores the difference in the y axis position since the last poll
|
781
|
+
* \returns 0 on success or a negative error code on failure; call
|
782
|
+
* SDL_GetError() for more information.
|
420
783
|
*
|
421
|
-
*
|
784
|
+
* \since This function is available since SDL 2.0.0.
|
785
|
+
*
|
786
|
+
* \sa SDL_JoystickNumBalls
|
422
787
|
*/
|
423
788
|
extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick *joystick,
|
424
789
|
int ball, int *dx, int *dy);
|
425
790
|
|
426
791
|
/**
|
427
|
-
*
|
792
|
+
* Get the current state of a button on a joystick.
|
793
|
+
*
|
794
|
+
* \param joystick an SDL_Joystick structure containing joystick information
|
795
|
+
* \param button the button index to get the state from; indices start at
|
796
|
+
* index 0
|
797
|
+
* \returns 1 if the specified button is pressed, 0 otherwise.
|
798
|
+
*
|
799
|
+
* \since This function is available since SDL 2.0.0.
|
428
800
|
*
|
429
|
-
*
|
801
|
+
* \sa SDL_JoystickNumButtons
|
430
802
|
*/
|
431
803
|
extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick *joystick,
|
432
804
|
int button);
|
433
805
|
|
434
806
|
/**
|
435
|
-
*
|
436
|
-
* Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling.
|
807
|
+
* Start a rumble effect.
|
437
808
|
*
|
438
|
-
*
|
439
|
-
*
|
440
|
-
* \param high_frequency_rumble The intensity of the high frequency (right) rumble motor, from 0 to 0xFFFF
|
441
|
-
* \param duration_ms The duration of the rumble effect, in milliseconds
|
809
|
+
* Each call to this function cancels any previous rumble effect, and calling
|
810
|
+
* it with 0 intensity stops any rumbling.
|
442
811
|
*
|
443
|
-
*
|
812
|
+
* \param joystick The joystick to vibrate
|
813
|
+
* \param low_frequency_rumble The intensity of the low frequency (left)
|
814
|
+
* rumble motor, from 0 to 0xFFFF
|
815
|
+
* \param high_frequency_rumble The intensity of the high frequency (right)
|
816
|
+
* rumble motor, from 0 to 0xFFFF
|
817
|
+
* \param duration_ms The duration of the rumble effect, in milliseconds
|
818
|
+
* \returns 0, or -1 if rumble isn't supported on this joystick
|
819
|
+
*
|
820
|
+
* \since This function is available since SDL 2.0.9.
|
821
|
+
*
|
822
|
+
* \sa SDL_JoystickHasRumble
|
444
823
|
*/
|
445
824
|
extern DECLSPEC int SDLCALL SDL_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
|
446
825
|
|
447
826
|
/**
|
448
|
-
*
|
449
|
-
*
|
827
|
+
* Start a rumble effect in the joystick's triggers
|
828
|
+
*
|
829
|
+
* Each call to this function cancels any previous trigger rumble effect, and
|
830
|
+
* calling it with 0 intensity stops any rumbling.
|
450
831
|
*
|
451
|
-
*
|
452
|
-
*
|
453
|
-
*
|
454
|
-
*
|
832
|
+
* Note that this function is for _trigger_ rumble; the first joystick to
|
833
|
+
* support this was the PlayStation 5's DualShock 5 controller. If you want
|
834
|
+
* the (more common) whole-controller rumble, use SDL_JoystickRumble()
|
835
|
+
* instead.
|
455
836
|
*
|
456
|
-
*
|
837
|
+
* \param joystick The joystick to vibrate
|
838
|
+
* \param left_rumble The intensity of the left trigger rumble motor, from 0
|
839
|
+
* to 0xFFFF
|
840
|
+
* \param right_rumble The intensity of the right trigger rumble motor, from 0
|
841
|
+
* to 0xFFFF
|
842
|
+
* \param duration_ms The duration of the rumble effect, in milliseconds
|
843
|
+
* \returns 0, or -1 if trigger rumble isn't supported on this joystick
|
844
|
+
*
|
845
|
+
* \since This function is available since SDL 2.0.14.
|
846
|
+
*
|
847
|
+
* \sa SDL_JoystickHasRumbleTriggers
|
457
848
|
*/
|
458
849
|
extern DECLSPEC int SDLCALL SDL_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms);
|
459
850
|
|
460
851
|
/**
|
461
|
-
*
|
852
|
+
* Query whether a joystick has an LED.
|
853
|
+
*
|
854
|
+
* An example of a joystick LED is the light on the back of a PlayStation 4's
|
855
|
+
* DualShock 4 controller.
|
462
856
|
*
|
463
|
-
*
|
857
|
+
* \param joystick The joystick to query
|
858
|
+
* \return SDL_TRUE if the joystick has a modifiable LED, SDL_FALSE otherwise.
|
464
859
|
*
|
465
|
-
*
|
860
|
+
* \since This function is available since SDL 2.0.14.
|
466
861
|
*/
|
467
862
|
extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasLED(SDL_Joystick *joystick);
|
468
863
|
|
469
864
|
/**
|
470
|
-
*
|
865
|
+
* Query whether a joystick has rumble support.
|
471
866
|
*
|
472
|
-
*
|
473
|
-
*
|
474
|
-
* \param green The intensity of the green LED
|
475
|
-
* \param blue The intensity of the blue LED
|
867
|
+
* \param joystick The joystick to query
|
868
|
+
* \return SDL_TRUE if the joystick has rumble, SDL_FALSE otherwise.
|
476
869
|
*
|
477
|
-
*
|
870
|
+
* \since This function is available since SDL 2.0.18.
|
871
|
+
*
|
872
|
+
* \sa SDL_JoystickRumble
|
873
|
+
*/
|
874
|
+
extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasRumble(SDL_Joystick *joystick);
|
875
|
+
|
876
|
+
/**
|
877
|
+
* Query whether a joystick has rumble support on triggers.
|
878
|
+
*
|
879
|
+
* \param joystick The joystick to query
|
880
|
+
* \return SDL_TRUE if the joystick has trigger rumble, SDL_FALSE otherwise.
|
881
|
+
*
|
882
|
+
* \since This function is available since SDL 2.0.18.
|
883
|
+
*
|
884
|
+
* \sa SDL_JoystickRumbleTriggers
|
885
|
+
*/
|
886
|
+
extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasRumbleTriggers(SDL_Joystick *joystick);
|
887
|
+
|
888
|
+
/**
|
889
|
+
* Update a joystick's LED color.
|
890
|
+
*
|
891
|
+
* An example of a joystick LED is the light on the back of a PlayStation 4's
|
892
|
+
* DualShock 4 controller.
|
893
|
+
*
|
894
|
+
* \param joystick The joystick to update
|
895
|
+
* \param red The intensity of the red LED
|
896
|
+
* \param green The intensity of the green LED
|
897
|
+
* \param blue The intensity of the blue LED
|
898
|
+
* \returns 0 on success, -1 if this joystick does not have a modifiable LED
|
899
|
+
*
|
900
|
+
* \since This function is available since SDL 2.0.14.
|
478
901
|
*/
|
479
902
|
extern DECLSPEC int SDLCALL SDL_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue);
|
480
903
|
|
481
904
|
/**
|
482
|
-
*
|
905
|
+
* Send a joystick specific effect packet
|
906
|
+
*
|
907
|
+
* \param joystick The joystick to affect
|
908
|
+
* \param data The data to send to the joystick
|
909
|
+
* \param size The size of the data to send to the joystick
|
910
|
+
* \returns 0, or -1 if this joystick or driver doesn't support effect packets
|
911
|
+
*
|
912
|
+
* \since This function is available since SDL 2.0.16.
|
913
|
+
*/
|
914
|
+
extern DECLSPEC int SDLCALL SDL_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size);
|
915
|
+
|
916
|
+
/**
|
917
|
+
* Close a joystick previously opened with SDL_JoystickOpen().
|
918
|
+
*
|
919
|
+
* \param joystick The joystick device to close
|
920
|
+
*
|
921
|
+
* \since This function is available since SDL 2.0.0.
|
922
|
+
*
|
923
|
+
* \sa SDL_JoystickOpen
|
483
924
|
*/
|
484
925
|
extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick *joystick);
|
485
926
|
|
486
927
|
/**
|
487
|
-
*
|
928
|
+
* Get the battery level of a joystick as SDL_JoystickPowerLevel.
|
929
|
+
*
|
930
|
+
* \param joystick the SDL_Joystick to query
|
931
|
+
* \returns the current battery level as SDL_JoystickPowerLevel on success or
|
932
|
+
* `SDL_JOYSTICK_POWER_UNKNOWN` if it is unknown
|
933
|
+
*
|
934
|
+
* \since This function is available since SDL 2.0.4.
|
488
935
|
*/
|
489
936
|
extern DECLSPEC SDL_JoystickPowerLevel SDLCALL SDL_JoystickCurrentPowerLevel(SDL_Joystick *joystick);
|
490
937
|
|