ruby2d 0.11.1 → 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/{lib → 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 +39 -25
- data/ext/ruby2d/gl.c +1 -1
- data/ext/ruby2d/gl3.c +0 -1
- data/ext/ruby2d/gles.c +137 -84
- data/ext/ruby2d/ruby2d.c +126 -32
- data/ext/ruby2d/ruby2d.h +53 -6
- data/ext/ruby2d/text.c +14 -1
- data/ext/ruby2d/window.c +253 -215
- data/lib/ruby2d/cli/build.rb +237 -59
- data/lib/ruby2d/cli/colorize.rb +5 -4
- data/lib/ruby2d/cli/platform.rb +17 -0
- data/lib/ruby2d/font.rb +7 -1
- data/lib/ruby2d/sprite.rb +7 -2
- data/lib/ruby2d/text.rb +1 -3
- data/lib/ruby2d/texture.rb +21 -21
- data/lib/ruby2d/tileset.rb +34 -33
- data/lib/ruby2d/version.rb +1 -1
- data/lib/ruby2d/vertices.rb +11 -6
- data/lib/ruby2d.rb +14 -20
- metadata +246 -152
- 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
@@ -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
|
@@ -67,7 +67,9 @@ typedef enum
|
|
67
67
|
SDL_CONTROLLER_TYPE_PS4,
|
68
68
|
SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO,
|
69
69
|
SDL_CONTROLLER_TYPE_VIRTUAL,
|
70
|
-
SDL_CONTROLLER_TYPE_PS5
|
70
|
+
SDL_CONTROLLER_TYPE_PS5,
|
71
|
+
SDL_CONTROLLER_TYPE_AMAZON_LUNA,
|
72
|
+
SDL_CONTROLLER_TYPE_GOOGLE_STADIA
|
71
73
|
} SDL_GameControllerType;
|
72
74
|
|
73
75
|
typedef enum
|
@@ -99,6 +101,8 @@ typedef struct SDL_GameControllerButtonBind
|
|
99
101
|
|
100
102
|
/**
|
101
103
|
* To count the number of game controllers in the system for the following:
|
104
|
+
*
|
105
|
+
* ```c
|
102
106
|
* int nJoysticks = SDL_NumJoysticks();
|
103
107
|
* int nGameControllers = 0;
|
104
108
|
* for (int i = 0; i < nJoysticks; i++) {
|
@@ -106,6 +110,7 @@ typedef struct SDL_GameControllerButtonBind
|
|
106
110
|
* nGameControllers++;
|
107
111
|
* }
|
108
112
|
* }
|
113
|
+
* ```
|
109
114
|
*
|
110
115
|
* Using the SDL_HINT_GAMECONTROLLERCONFIG hint or the SDL_GameControllerAddMapping() you can add support for controllers SDL is unaware of or cause an existing controller to have a different binding. The format is:
|
111
116
|
* guid,name,mappings
|
@@ -119,17 +124,39 @@ typedef struct SDL_GameControllerButtonBind
|
|
119
124
|
* Buttons can be used as a controller axis and vice versa.
|
120
125
|
*
|
121
126
|
* This string shows an example of a valid mapping for a controller
|
122
|
-
* "03000000341a00003608000000000000,PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7",
|
123
127
|
*
|
128
|
+
* ```c
|
129
|
+
* "03000000341a00003608000000000000,PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7",
|
130
|
+
* ```
|
124
131
|
*/
|
125
132
|
|
126
133
|
/**
|
127
|
-
*
|
128
|
-
*
|
134
|
+
* Load a set of Game Controller mappings from a seekable SDL data stream.
|
135
|
+
*
|
136
|
+
* You can call this function several times, if needed, to load different
|
137
|
+
* database files.
|
138
|
+
*
|
139
|
+
* If a new mapping is loaded for an already known controller GUID, the later
|
140
|
+
* version will overwrite the one currently loaded.
|
141
|
+
*
|
142
|
+
* Mappings not belonging to the current platform or with no platform field
|
143
|
+
* specified will be ignored (i.e. mappings for Linux will be ignored in
|
144
|
+
* Windows, etc).
|
145
|
+
*
|
146
|
+
* This function will load the text database entirely in memory before
|
147
|
+
* processing it, so take this into consideration if you are in a memory
|
148
|
+
* constrained environment.
|
129
149
|
*
|
130
|
-
*
|
131
|
-
*
|
132
|
-
* \
|
150
|
+
* \param rw the data stream for the mappings to be added
|
151
|
+
* \param freerw non-zero to close the stream after being read
|
152
|
+
* \returns the number of mappings added or -1 on error; call SDL_GetError()
|
153
|
+
* for more information.
|
154
|
+
*
|
155
|
+
* \since This function is available since SDL 2.0.2.
|
156
|
+
*
|
157
|
+
* \sa SDL_GameControllerAddMapping
|
158
|
+
* \sa SDL_GameControllerAddMappingsFromFile
|
159
|
+
* \sa SDL_GameControllerMappingForGUID
|
133
160
|
*/
|
134
161
|
extern DECLSPEC int SDLCALL SDL_GameControllerAddMappingsFromRW(SDL_RWops * rw, int freerw);
|
135
162
|
|
@@ -141,161 +168,372 @@ extern DECLSPEC int SDLCALL SDL_GameControllerAddMappingsFromRW(SDL_RWops * rw,
|
|
141
168
|
#define SDL_GameControllerAddMappingsFromFile(file) SDL_GameControllerAddMappingsFromRW(SDL_RWFromFile(file, "rb"), 1)
|
142
169
|
|
143
170
|
/**
|
144
|
-
*
|
171
|
+
* Add support for controllers that SDL is unaware of or to cause an existing
|
172
|
+
* controller to have a different binding.
|
173
|
+
*
|
174
|
+
* The mapping string has the format "GUID,name,mapping", where GUID is the
|
175
|
+
* string value from SDL_JoystickGetGUIDString(), name is the human readable
|
176
|
+
* string for the device and mappings are controller mappings to joystick
|
177
|
+
* ones. Under Windows there is a reserved GUID of "xinput" that covers all
|
178
|
+
* XInput devices. The mapping format for joystick is: {| |bX |a joystick
|
179
|
+
* button, index X |- |hX.Y |hat X with value Y |- |aX |axis X of the joystick
|
180
|
+
* |} Buttons can be used as a controller axes and vice versa.
|
181
|
+
*
|
182
|
+
* This string shows an example of a valid mapping for a controller:
|
183
|
+
*
|
184
|
+
* ```c
|
185
|
+
* "341a3608000000000000504944564944,Afterglow PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7"
|
186
|
+
* ```
|
145
187
|
*
|
146
|
-
* \
|
188
|
+
* \param mappingString the mapping string
|
189
|
+
* \returns 1 if a new mapping is added, 0 if an existing mapping is updated,
|
190
|
+
* -1 on error; call SDL_GetError() for more information.
|
191
|
+
*
|
192
|
+
* \since This function is available since SDL 2.0.0.
|
193
|
+
*
|
194
|
+
* \sa SDL_GameControllerMapping
|
195
|
+
* \sa SDL_GameControllerMappingForGUID
|
147
196
|
*/
|
148
197
|
extern DECLSPEC int SDLCALL SDL_GameControllerAddMapping(const char* mappingString);
|
149
198
|
|
150
199
|
/**
|
151
|
-
*
|
200
|
+
* Get the number of mappings installed.
|
201
|
+
*
|
202
|
+
* \returns the number of mappings.
|
152
203
|
*
|
153
|
-
*
|
204
|
+
* \since This function is available since SDL 2.0.6.
|
154
205
|
*/
|
155
206
|
extern DECLSPEC int SDLCALL SDL_GameControllerNumMappings(void);
|
156
207
|
|
157
208
|
/**
|
158
|
-
*
|
209
|
+
* Get the mapping at a particular index.
|
159
210
|
*
|
160
|
-
*
|
211
|
+
* \returns the mapping string. Must be freed with SDL_free(). Returns NULL if
|
212
|
+
* the index is out of range.
|
213
|
+
*
|
214
|
+
* \since This function is available since SDL 2.0.6.
|
161
215
|
*/
|
162
216
|
extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForIndex(int mapping_index);
|
163
217
|
|
164
218
|
/**
|
165
|
-
*
|
219
|
+
* Get the game controller mapping string for a given GUID.
|
220
|
+
*
|
221
|
+
* The returned string must be freed with SDL_free().
|
166
222
|
*
|
167
|
-
*
|
223
|
+
* \param guid a structure containing the GUID for which a mapping is desired
|
224
|
+
* \returns a mapping string or NULL on error; call SDL_GetError() for more
|
225
|
+
* information.
|
226
|
+
*
|
227
|
+
* \since This function is available since SDL 2.0.0.
|
228
|
+
*
|
229
|
+
* \sa SDL_JoystickGetDeviceGUID
|
230
|
+
* \sa SDL_JoystickGetGUID
|
168
231
|
*/
|
169
232
|
extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForGUID(SDL_JoystickGUID guid);
|
170
233
|
|
171
234
|
/**
|
172
|
-
*
|
235
|
+
* Get the current mapping of a Game Controller.
|
236
|
+
*
|
237
|
+
* The returned string must be freed with SDL_free().
|
238
|
+
*
|
239
|
+
* Details about mappings are discussed with SDL_GameControllerAddMapping().
|
240
|
+
*
|
241
|
+
* \param gamecontroller the game controller you want to get the current
|
242
|
+
* mapping for
|
243
|
+
* \returns a string that has the controller's mapping or NULL if no mapping
|
244
|
+
* is available; call SDL_GetError() for more information.
|
173
245
|
*
|
174
|
-
*
|
246
|
+
* \since This function is available since SDL 2.0.0.
|
247
|
+
*
|
248
|
+
* \sa SDL_GameControllerAddMapping
|
249
|
+
* \sa SDL_GameControllerMappingForGUID
|
175
250
|
*/
|
176
251
|
extern DECLSPEC char * SDLCALL SDL_GameControllerMapping(SDL_GameController *gamecontroller);
|
177
252
|
|
178
253
|
/**
|
179
|
-
*
|
254
|
+
* Check if the given joystick is supported by the game controller interface.
|
255
|
+
*
|
256
|
+
* `joystick_index` is the same as the `device_index` passed to
|
257
|
+
* SDL_JoystickOpen().
|
258
|
+
*
|
259
|
+
* \param joystick_index the device_index of a device, up to
|
260
|
+
* SDL_NumJoysticks()
|
261
|
+
* \returns SDL_TRUE if the given joystick is supported by the game controller
|
262
|
+
* interface, SDL_FALSE if it isn't or it's an invalid index.
|
263
|
+
*
|
264
|
+
* \since This function is available since SDL 2.0.0.
|
265
|
+
*
|
266
|
+
* \sa SDL_GameControllerNameForIndex
|
267
|
+
* \sa SDL_GameControllerOpen
|
180
268
|
*/
|
181
269
|
extern DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index);
|
182
270
|
|
183
271
|
/**
|
184
|
-
*
|
185
|
-
*
|
186
|
-
*
|
272
|
+
* Get the implementation dependent name for the game controller.
|
273
|
+
*
|
274
|
+
* This function can be called before any controllers are opened.
|
275
|
+
*
|
276
|
+
* `joystick_index` is the same as the `device_index` passed to
|
277
|
+
* SDL_JoystickOpen().
|
278
|
+
*
|
279
|
+
* \param joystick_index the device_index of a device, from zero to
|
280
|
+
* SDL_NumJoysticks()-1
|
281
|
+
* \returns the implementation-dependent name for the game controller, or NULL
|
282
|
+
* if there is no name or the index is invalid.
|
283
|
+
*
|
284
|
+
* \since This function is available since SDL 2.0.0.
|
285
|
+
*
|
286
|
+
* \sa SDL_GameControllerName
|
287
|
+
* \sa SDL_GameControllerOpen
|
288
|
+
* \sa SDL_IsGameController
|
187
289
|
*/
|
188
290
|
extern DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_index);
|
189
291
|
|
190
292
|
/**
|
191
|
-
*
|
192
|
-
*
|
293
|
+
* Get the type of a game controller.
|
294
|
+
*
|
295
|
+
* This can be called before any controllers are opened.
|
296
|
+
*
|
297
|
+
* \param joystick_index the device_index of a device, from zero to
|
298
|
+
* SDL_NumJoysticks()-1
|
299
|
+
* \returns the controller type.
|
300
|
+
*
|
301
|
+
* \since This function is available since SDL 2.0.12.
|
193
302
|
*/
|
194
303
|
extern DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerTypeForIndex(int joystick_index);
|
195
304
|
|
196
305
|
/**
|
197
|
-
*
|
198
|
-
*
|
306
|
+
* Get the mapping of a game controller.
|
307
|
+
*
|
308
|
+
* This can be called before any controllers are opened.
|
309
|
+
*
|
310
|
+
* \param joystick_index the device_index of a device, from zero to
|
311
|
+
* SDL_NumJoysticks()-1
|
312
|
+
* \returns the mapping string. Must be freed with SDL_free(). Returns NULL if
|
313
|
+
* no mapping is available.
|
199
314
|
*
|
200
|
-
*
|
315
|
+
* \since This function is available since SDL 2.0.9.
|
201
316
|
*/
|
202
317
|
extern DECLSPEC char *SDLCALL SDL_GameControllerMappingForDeviceIndex(int joystick_index);
|
203
318
|
|
204
319
|
/**
|
205
|
-
*
|
206
|
-
* The index passed as an argument refers to the N'th game controller on the system.
|
207
|
-
* This index is not the value which will identify this controller in future
|
208
|
-
* controller events. The joystick's instance id (::SDL_JoystickID) will be
|
209
|
-
* used there instead.
|
320
|
+
* Open a game controller for use.
|
210
321
|
*
|
211
|
-
*
|
322
|
+
* `joystick_index` is the same as the `device_index` passed to
|
323
|
+
* SDL_JoystickOpen().
|
324
|
+
*
|
325
|
+
* The index passed as an argument refers to the N'th game controller on the
|
326
|
+
* system. This index is not the value which will identify this controller in
|
327
|
+
* future controller events. The joystick's instance id (SDL_JoystickID) will
|
328
|
+
* be used there instead.
|
329
|
+
*
|
330
|
+
* \param joystick_index the device_index of a device, up to
|
331
|
+
* SDL_NumJoysticks()
|
332
|
+
* \returns a gamecontroller identifier or NULL if an error occurred; call
|
333
|
+
* SDL_GetError() for more information.
|
334
|
+
*
|
335
|
+
* \since This function is available since SDL 2.0.0.
|
336
|
+
*
|
337
|
+
* \sa SDL_GameControllerClose
|
338
|
+
* \sa SDL_GameControllerNameForIndex
|
339
|
+
* \sa SDL_IsGameController
|
212
340
|
*/
|
213
341
|
extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerOpen(int joystick_index);
|
214
342
|
|
215
343
|
/**
|
216
|
-
*
|
344
|
+
* Get the SDL_GameController associated with an instance id.
|
345
|
+
*
|
346
|
+
* \param joyid the instance id to get the SDL_GameController for
|
347
|
+
* \returns an SDL_GameController on success or NULL on failure; call
|
348
|
+
* SDL_GetError() for more information.
|
349
|
+
*
|
350
|
+
* \since This function is available since SDL 2.0.4.
|
217
351
|
*/
|
218
352
|
extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromInstanceID(SDL_JoystickID joyid);
|
219
353
|
|
220
354
|
/**
|
221
|
-
*
|
355
|
+
* Get the SDL_GameController associated with a player index.
|
356
|
+
*
|
357
|
+
* Please note that the player index is _not_ the device index, nor is it the
|
358
|
+
* instance id!
|
359
|
+
*
|
360
|
+
* \param player_index the player index, which is not the device index or the
|
361
|
+
* instance id!
|
362
|
+
* \returns the SDL_GameController associated with a player index.
|
363
|
+
*
|
364
|
+
* \since This function is available since SDL 2.0.12.
|
365
|
+
*
|
366
|
+
* \sa SDL_GameControllerGetPlayerIndex
|
367
|
+
* \sa SDL_GameControllerSetPlayerIndex
|
222
368
|
*/
|
223
369
|
extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromPlayerIndex(int player_index);
|
224
370
|
|
225
371
|
/**
|
226
|
-
*
|
372
|
+
* Get the implementation-dependent name for an opened game controller.
|
373
|
+
*
|
374
|
+
* This is the same name as returned by SDL_GameControllerNameForIndex(), but
|
375
|
+
* it takes a controller identifier instead of the (unstable) device index.
|
376
|
+
*
|
377
|
+
* \param gamecontroller a game controller identifier previously returned by
|
378
|
+
* SDL_GameControllerOpen()
|
379
|
+
* \returns the implementation dependent name for the game controller, or NULL
|
380
|
+
* if there is no name or the identifier passed is invalid.
|
381
|
+
*
|
382
|
+
* \since This function is available since SDL 2.0.0.
|
383
|
+
*
|
384
|
+
* \sa SDL_GameControllerNameForIndex
|
385
|
+
* \sa SDL_GameControllerOpen
|
227
386
|
*/
|
228
387
|
extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller);
|
229
388
|
|
230
389
|
/**
|
231
|
-
*
|
390
|
+
* Get the type of this currently opened controller
|
391
|
+
*
|
392
|
+
* This is the same name as returned by SDL_GameControllerTypeForIndex(), but
|
393
|
+
* it takes a controller identifier instead of the (unstable) device index.
|
394
|
+
*
|
395
|
+
* \param gamecontroller the game controller object to query.
|
396
|
+
* \returns the controller type.
|
397
|
+
*
|
398
|
+
* \since This function is available since SDL 2.0.12.
|
232
399
|
*/
|
233
400
|
extern DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerGetType(SDL_GameController *gamecontroller);
|
234
401
|
|
235
402
|
/**
|
236
|
-
*
|
403
|
+
* Get the player index of an opened game controller.
|
404
|
+
*
|
405
|
+
* For XInput controllers this returns the XInput user index.
|
237
406
|
*
|
238
|
-
*
|
407
|
+
* \param gamecontroller the game controller object to query.
|
408
|
+
* \returns the player index for controller, or -1 if it's not available.
|
409
|
+
*
|
410
|
+
* \since This function is available since SDL 2.0.9.
|
239
411
|
*/
|
240
412
|
extern DECLSPEC int SDLCALL SDL_GameControllerGetPlayerIndex(SDL_GameController *gamecontroller);
|
241
413
|
|
242
414
|
/**
|
243
|
-
*
|
415
|
+
* Set the player index of an opened game controller.
|
416
|
+
*
|
417
|
+
* \param gamecontroller the game controller object to adjust.
|
418
|
+
* \param player_index Player index to assign to this controller.
|
419
|
+
*
|
420
|
+
* \since This function is available since SDL 2.0.12.
|
244
421
|
*/
|
245
422
|
extern DECLSPEC void SDLCALL SDL_GameControllerSetPlayerIndex(SDL_GameController *gamecontroller, int player_index);
|
246
423
|
|
247
424
|
/**
|
248
|
-
*
|
249
|
-
*
|
425
|
+
* Get the USB vendor ID of an opened controller, if available.
|
426
|
+
*
|
427
|
+
* If the vendor ID isn't available this function returns 0.
|
428
|
+
*
|
429
|
+
* \param gamecontroller the game controller object to query.
|
430
|
+
* \return the USB vendor ID, or zero if unavailable.
|
431
|
+
*
|
432
|
+
* \since This function is available since SDL 2.0.6.
|
250
433
|
*/
|
251
434
|
extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetVendor(SDL_GameController *gamecontroller);
|
252
435
|
|
253
436
|
/**
|
254
|
-
*
|
255
|
-
*
|
437
|
+
* Get the USB product ID of an opened controller, if available.
|
438
|
+
*
|
439
|
+
* If the product ID isn't available this function returns 0.
|
440
|
+
*
|
441
|
+
* \param gamecontroller the game controller object to query.
|
442
|
+
* \return the USB product ID, or zero if unavailable.
|
443
|
+
*
|
444
|
+
* \since This function is available since SDL 2.0.6.
|
256
445
|
*/
|
257
446
|
extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProduct(SDL_GameController *gamecontroller);
|
258
447
|
|
259
448
|
/**
|
260
|
-
*
|
261
|
-
*
|
449
|
+
* Get the product version of an opened controller, if available.
|
450
|
+
*
|
451
|
+
* If the product version isn't available this function returns 0.
|
452
|
+
*
|
453
|
+
* \param gamecontroller the game controller object to query.
|
454
|
+
* \return the USB product version, or zero if unavailable.
|
455
|
+
*
|
456
|
+
* \since This function is available since SDL 2.0.6.
|
262
457
|
*/
|
263
458
|
extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProductVersion(SDL_GameController *gamecontroller);
|
264
459
|
|
265
460
|
/**
|
266
|
-
*
|
267
|
-
*
|
268
|
-
*
|
461
|
+
* Get the serial number of an opened controller, if available.
|
462
|
+
*
|
463
|
+
* Returns the serial number of the controller, or NULL if it is not
|
464
|
+
* available.
|
465
|
+
*
|
466
|
+
* \param gamecontroller the game controller object to query.
|
467
|
+
* \return the serial number, or NULL if unavailable.
|
468
|
+
*
|
469
|
+
* \since This function is available since SDL 2.0.14.
|
269
470
|
*/
|
270
471
|
extern DECLSPEC const char * SDLCALL SDL_GameControllerGetSerial(SDL_GameController *gamecontroller);
|
271
472
|
|
272
473
|
/**
|
273
|
-
*
|
274
|
-
*
|
474
|
+
* Check if a controller has been opened and is currently connected.
|
475
|
+
*
|
476
|
+
* \param gamecontroller a game controller identifier previously returned by
|
477
|
+
* SDL_GameControllerOpen()
|
478
|
+
* \returns SDL_TRUE if the controller has been opened and is currently
|
479
|
+
* connected, or SDL_FALSE if not.
|
480
|
+
*
|
481
|
+
* \since This function is available since SDL 2.0.0.
|
482
|
+
*
|
483
|
+
* \sa SDL_GameControllerClose
|
484
|
+
* \sa SDL_GameControllerOpen
|
275
485
|
*/
|
276
486
|
extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerGetAttached(SDL_GameController *gamecontroller);
|
277
487
|
|
278
488
|
/**
|
279
|
-
*
|
489
|
+
* Get the Joystick ID from a Game Controller.
|
490
|
+
*
|
491
|
+
* This function will give you a SDL_Joystick object, which allows you to use
|
492
|
+
* the SDL_Joystick functions with a SDL_GameController object. This would be
|
493
|
+
* useful for getting a joystick's position at any given time, even if it
|
494
|
+
* hasn't moved (moving it would produce an event, which would have the axis'
|
495
|
+
* value).
|
496
|
+
*
|
497
|
+
* The pointer returned is owned by the SDL_GameController. You should not
|
498
|
+
* call SDL_JoystickClose() on it, for example, since doing so will likely
|
499
|
+
* cause SDL to crash.
|
500
|
+
*
|
501
|
+
* \param gamecontroller the game controller object that you want to get a
|
502
|
+
* joystick from
|
503
|
+
* \returns a SDL_Joystick object; call SDL_GetError() for more information.
|
504
|
+
*
|
505
|
+
* \since This function is available since SDL 2.0.0.
|
280
506
|
*/
|
281
507
|
extern DECLSPEC SDL_Joystick *SDLCALL SDL_GameControllerGetJoystick(SDL_GameController *gamecontroller);
|
282
508
|
|
283
509
|
/**
|
284
|
-
*
|
510
|
+
* Query or change current state of Game Controller events.
|
285
511
|
*
|
286
|
-
*
|
287
|
-
*
|
288
|
-
*
|
512
|
+
* If controller events are disabled, you must call SDL_GameControllerUpdate()
|
513
|
+
* yourself and check the state of the controller when you want controller
|
514
|
+
* information.
|
289
515
|
*
|
290
|
-
*
|
516
|
+
* Any number can be passed to SDL_GameControllerEventState(), but only -1, 0,
|
517
|
+
* and 1 will have any effect. Other numbers will just be returned.
|
518
|
+
*
|
519
|
+
* \param state can be one of `SDL_QUERY`, `SDL_IGNORE`, or `SDL_ENABLE`
|
520
|
+
* \returns the same value passed to the function, with exception to -1
|
521
|
+
* (SDL_QUERY), which will return the current state.
|
522
|
+
*
|
523
|
+
* \since This function is available since SDL 2.0.0.
|
524
|
+
*
|
525
|
+
* \sa SDL_JoystickEventState
|
291
526
|
*/
|
292
527
|
extern DECLSPEC int SDLCALL SDL_GameControllerEventState(int state);
|
293
528
|
|
294
529
|
/**
|
295
|
-
*
|
530
|
+
* Manually pump game controller updates if not using the loop.
|
531
|
+
*
|
532
|
+
* This function is called automatically by the event loop if events are
|
533
|
+
* enabled. Under such circumstances, it will not be necessary to call this
|
534
|
+
* function.
|
296
535
|
*
|
297
|
-
*
|
298
|
-
* events are enabled.
|
536
|
+
* \since This function is available since SDL 2.0.0.
|
299
537
|
*/
|
300
538
|
extern DECLSPEC void SDLCALL SDL_GameControllerUpdate(void);
|
301
539
|
|
@@ -322,35 +560,91 @@ typedef enum
|
|
322
560
|
} SDL_GameControllerAxis;
|
323
561
|
|
324
562
|
/**
|
325
|
-
*
|
563
|
+
* Convert a string into SDL_GameControllerAxis enum.
|
564
|
+
*
|
565
|
+
* This function is called internally to translate SDL_GameController mapping
|
566
|
+
* strings for the underlying joystick device into the consistent
|
567
|
+
* SDL_GameController mapping. You do not normally need to call this function
|
568
|
+
* unless you are parsing SDL_GameController mappings in your own code.
|
569
|
+
*
|
570
|
+
* Note specially that "righttrigger" and "lefttrigger" map to
|
571
|
+
* `SDL_CONTROLLER_AXIS_TRIGGERRIGHT` and `SDL_CONTROLLER_AXIS_TRIGGERLEFT`,
|
572
|
+
* respectively.
|
573
|
+
*
|
574
|
+
* \param str string representing a SDL_GameController axis
|
575
|
+
* \returns the SDL_GameControllerAxis enum corresponding to the input string,
|
576
|
+
* or `SDL_CONTROLLER_AXIS_INVALID` if no match was found.
|
577
|
+
*
|
578
|
+
* \since This function is available since SDL 2.0.0.
|
579
|
+
*
|
580
|
+
* \sa SDL_GameControllerGetStringForAxis
|
326
581
|
*/
|
327
|
-
extern DECLSPEC SDL_GameControllerAxis SDLCALL SDL_GameControllerGetAxisFromString(const char *
|
582
|
+
extern DECLSPEC SDL_GameControllerAxis SDLCALL SDL_GameControllerGetAxisFromString(const char *str);
|
328
583
|
|
329
584
|
/**
|
330
|
-
*
|
585
|
+
* Convert from an SDL_GameControllerAxis enum to a string.
|
586
|
+
*
|
587
|
+
* The caller should not SDL_free() the returned string.
|
588
|
+
*
|
589
|
+
* \param axis an enum value for a given SDL_GameControllerAxis
|
590
|
+
* \returns a string for the given axis, or NULL if an invalid axis is
|
591
|
+
* specified. The string returned is of the format used by
|
592
|
+
* SDL_GameController mapping strings.
|
593
|
+
*
|
594
|
+
* \since This function is available since SDL 2.0.0.
|
595
|
+
*
|
596
|
+
* \sa SDL_GameControllerGetAxisFromString
|
331
597
|
*/
|
332
598
|
extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForAxis(SDL_GameControllerAxis axis);
|
333
599
|
|
334
600
|
/**
|
335
|
-
*
|
601
|
+
* Get the SDL joystick layer binding for a controller axis mapping.
|
602
|
+
*
|
603
|
+
* \param gamecontroller a game controller
|
604
|
+
* \param axis an axis enum value (one of the SDL_GameControllerAxis values)
|
605
|
+
* \returns a SDL_GameControllerButtonBind describing the bind. On failure
|
606
|
+
* (like the given Controller axis doesn't exist on the device), its
|
607
|
+
* `.bindType` will be `SDL_CONTROLLER_BINDTYPE_NONE`.
|
608
|
+
*
|
609
|
+
* \since This function is available since SDL 2.0.0.
|
610
|
+
*
|
611
|
+
* \sa SDL_GameControllerGetBindForButton
|
336
612
|
*/
|
337
613
|
extern DECLSPEC SDL_GameControllerButtonBind SDLCALL
|
338
614
|
SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller,
|
339
615
|
SDL_GameControllerAxis axis);
|
340
616
|
|
341
617
|
/**
|
342
|
-
*
|
618
|
+
* Query whether a game controller has a given axis.
|
619
|
+
*
|
620
|
+
* This merely reports whether the controller's mapping defined this axis, as
|
621
|
+
* that is all the information SDL has about the physical device.
|
622
|
+
*
|
623
|
+
* \param gamecontroller a game controller
|
624
|
+
* \param axis an axis enum value (an SDL_GameControllerAxis value)
|
625
|
+
* \returns SDL_TRUE if the controller has this axis, SDL_FALSE otherwise.
|
626
|
+
*
|
627
|
+
* \since This function is available since SDL 2.0.14.
|
343
628
|
*/
|
344
629
|
extern DECLSPEC SDL_bool SDLCALL
|
345
630
|
SDL_GameControllerHasAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis);
|
346
631
|
|
347
632
|
/**
|
348
|
-
*
|
633
|
+
* Get the current state of an axis control on a game controller.
|
349
634
|
*
|
350
|
-
*
|
351
|
-
* which range from 0 to 32767).
|
635
|
+
* The axis indices start at index 0.
|
352
636
|
*
|
353
|
-
*
|
637
|
+
* The state is a value ranging from -32768 to 32767. Triggers, however, range
|
638
|
+
* from 0 to 32767 (they never return a negative value).
|
639
|
+
*
|
640
|
+
* \param gamecontroller a game controller
|
641
|
+
* \param axis an axis index (one of the SDL_GameControllerAxis values)
|
642
|
+
* \returns axis state (including 0) on success or 0 (also) on failure; call
|
643
|
+
* SDL_GetError() for more information.
|
644
|
+
*
|
645
|
+
* \since This function is available since SDL 2.0.0.
|
646
|
+
*
|
647
|
+
* \sa SDL_GameControllerGetButton
|
354
648
|
*/
|
355
649
|
extern DECLSPEC Sint16 SDLCALL
|
356
650
|
SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis);
|
@@ -376,7 +670,7 @@ typedef enum
|
|
376
670
|
SDL_CONTROLLER_BUTTON_DPAD_DOWN,
|
377
671
|
SDL_CONTROLLER_BUTTON_DPAD_LEFT,
|
378
672
|
SDL_CONTROLLER_BUTTON_DPAD_RIGHT,
|
379
|
-
SDL_CONTROLLER_BUTTON_MISC1, /* Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button */
|
673
|
+
SDL_CONTROLLER_BUTTON_MISC1, /* Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button */
|
380
674
|
SDL_CONTROLLER_BUTTON_PADDLE1, /* Xbox Elite paddle P1 */
|
381
675
|
SDL_CONTROLLER_BUTTON_PADDLE2, /* Xbox Elite paddle P3 */
|
382
676
|
SDL_CONTROLLER_BUTTON_PADDLE3, /* Xbox Elite paddle P2 */
|
@@ -386,149 +680,315 @@ typedef enum
|
|
386
680
|
} SDL_GameControllerButton;
|
387
681
|
|
388
682
|
/**
|
389
|
-
*
|
683
|
+
* Convert a string into an SDL_GameControllerButton enum.
|
684
|
+
*
|
685
|
+
* This function is called internally to translate SDL_GameController mapping
|
686
|
+
* strings for the underlying joystick device into the consistent
|
687
|
+
* SDL_GameController mapping. You do not normally need to call this function
|
688
|
+
* unless you are parsing SDL_GameController mappings in your own code.
|
689
|
+
*
|
690
|
+
* \param str string representing a SDL_GameController axis
|
691
|
+
* \returns the SDL_GameControllerButton enum corresponding to the input
|
692
|
+
* string, or `SDL_CONTROLLER_AXIS_INVALID` if no match was found.
|
693
|
+
*
|
694
|
+
* \since This function is available since SDL 2.0.0.
|
390
695
|
*/
|
391
|
-
extern DECLSPEC SDL_GameControllerButton SDLCALL SDL_GameControllerGetButtonFromString(const char *
|
696
|
+
extern DECLSPEC SDL_GameControllerButton SDLCALL SDL_GameControllerGetButtonFromString(const char *str);
|
392
697
|
|
393
698
|
/**
|
394
|
-
*
|
699
|
+
* Convert from an SDL_GameControllerButton enum to a string.
|
700
|
+
*
|
701
|
+
* The caller should not SDL_free() the returned string.
|
702
|
+
*
|
703
|
+
* \param button an enum value for a given SDL_GameControllerButton
|
704
|
+
* \returns a string for the given button, or NULL if an invalid axis is
|
705
|
+
* specified. The string returned is of the format used by
|
706
|
+
* SDL_GameController mapping strings.
|
707
|
+
*
|
708
|
+
* \since This function is available since SDL 2.0.0.
|
709
|
+
*
|
710
|
+
* \sa SDL_GameControllerGetButtonFromString
|
395
711
|
*/
|
396
712
|
extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForButton(SDL_GameControllerButton button);
|
397
713
|
|
398
714
|
/**
|
399
|
-
*
|
715
|
+
* Get the SDL joystick layer binding for a controller button mapping.
|
716
|
+
*
|
717
|
+
* \param gamecontroller a game controller
|
718
|
+
* \param button an button enum value (an SDL_GameControllerButton value)
|
719
|
+
* \returns a SDL_GameControllerButtonBind describing the bind. On failure
|
720
|
+
* (like the given Controller button doesn't exist on the device),
|
721
|
+
* its `.bindType` will be `SDL_CONTROLLER_BINDTYPE_NONE`.
|
722
|
+
*
|
723
|
+
* \since This function is available since SDL 2.0.0.
|
724
|
+
*
|
725
|
+
* \sa SDL_GameControllerGetBindForAxis
|
400
726
|
*/
|
401
727
|
extern DECLSPEC SDL_GameControllerButtonBind SDLCALL
|
402
728
|
SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller,
|
403
729
|
SDL_GameControllerButton button);
|
404
730
|
|
405
731
|
/**
|
406
|
-
*
|
732
|
+
* Query whether a game controller has a given button.
|
733
|
+
*
|
734
|
+
* This merely reports whether the controller's mapping defined this button,
|
735
|
+
* as that is all the information SDL has about the physical device.
|
736
|
+
*
|
737
|
+
* \param gamecontroller a game controller
|
738
|
+
* \param button a button enum value (an SDL_GameControllerButton value)
|
739
|
+
* \returns SDL_TRUE if the controller has this button, SDL_FALSE otherwise.
|
740
|
+
*
|
741
|
+
* \since This function is available since SDL 2.0.14.
|
407
742
|
*/
|
408
743
|
extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasButton(SDL_GameController *gamecontroller,
|
409
744
|
SDL_GameControllerButton button);
|
410
745
|
|
411
746
|
/**
|
412
|
-
*
|
747
|
+
* Get the current state of a button on a game controller.
|
748
|
+
*
|
749
|
+
* \param gamecontroller a game controller
|
750
|
+
* \param button a button index (one of the SDL_GameControllerButton values)
|
751
|
+
* \returns 1 for pressed state or 0 for not pressed state or error; call
|
752
|
+
* SDL_GetError() for more information.
|
753
|
+
*
|
754
|
+
* \since This function is available since SDL 2.0.0.
|
413
755
|
*
|
414
|
-
*
|
756
|
+
* \sa SDL_GameControllerGetAxis
|
415
757
|
*/
|
416
758
|
extern DECLSPEC Uint8 SDLCALL SDL_GameControllerGetButton(SDL_GameController *gamecontroller,
|
417
759
|
SDL_GameControllerButton button);
|
418
760
|
|
419
761
|
/**
|
420
|
-
*
|
762
|
+
* Get the number of touchpads on a game controller.
|
763
|
+
*
|
764
|
+
* \since This function is available since SDL 2.0.14.
|
421
765
|
*/
|
422
766
|
extern DECLSPEC int SDLCALL SDL_GameControllerGetNumTouchpads(SDL_GameController *gamecontroller);
|
423
767
|
|
424
768
|
/**
|
425
|
-
*
|
769
|
+
* Get the number of supported simultaneous fingers on a touchpad on a game
|
770
|
+
* controller.
|
771
|
+
*
|
772
|
+
* \since This function is available since SDL 2.0.14.
|
426
773
|
*/
|
427
774
|
extern DECLSPEC int SDLCALL SDL_GameControllerGetNumTouchpadFingers(SDL_GameController *gamecontroller, int touchpad);
|
428
775
|
|
429
776
|
/**
|
430
|
-
*
|
777
|
+
* Get the current state of a finger on a touchpad on a game controller.
|
778
|
+
*
|
779
|
+
* \since This function is available since SDL 2.0.14.
|
431
780
|
*/
|
432
781
|
extern DECLSPEC int SDLCALL SDL_GameControllerGetTouchpadFinger(SDL_GameController *gamecontroller, int touchpad, int finger, Uint8 *state, float *x, float *y, float *pressure);
|
433
782
|
|
434
783
|
/**
|
435
|
-
*
|
784
|
+
* Return whether a game controller has a particular sensor.
|
436
785
|
*
|
437
|
-
*
|
438
|
-
*
|
786
|
+
* \param gamecontroller The controller to query
|
787
|
+
* \param type The type of sensor to query
|
788
|
+
* \returns SDL_TRUE if the sensor exists, SDL_FALSE otherwise.
|
439
789
|
*
|
440
|
-
*
|
790
|
+
* \since This function is available since SDL 2.0.14.
|
441
791
|
*/
|
442
792
|
extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasSensor(SDL_GameController *gamecontroller, SDL_SensorType type);
|
443
793
|
|
444
794
|
/**
|
445
|
-
*
|
795
|
+
* Set whether data reporting for a game controller sensor is enabled.
|
446
796
|
*
|
447
|
-
*
|
448
|
-
*
|
449
|
-
*
|
797
|
+
* \param gamecontroller The controller to update
|
798
|
+
* \param type The type of sensor to enable/disable
|
799
|
+
* \param enabled Whether data reporting should be enabled
|
800
|
+
* \returns 0 or -1 if an error occurred.
|
450
801
|
*
|
451
|
-
*
|
802
|
+
* \since This function is available since SDL 2.0.14.
|
452
803
|
*/
|
453
804
|
extern DECLSPEC int SDLCALL SDL_GameControllerSetSensorEnabled(SDL_GameController *gamecontroller, SDL_SensorType type, SDL_bool enabled);
|
454
805
|
|
455
806
|
/**
|
456
|
-
*
|
807
|
+
* Query whether sensor data reporting is enabled for a game controller.
|
457
808
|
*
|
458
|
-
*
|
459
|
-
*
|
809
|
+
* \param gamecontroller The controller to query
|
810
|
+
* \param type The type of sensor to query
|
811
|
+
* \returns SDL_TRUE if the sensor is enabled, SDL_FALSE otherwise.
|
460
812
|
*
|
461
|
-
*
|
813
|
+
* \since This function is available since SDL 2.0.14.
|
462
814
|
*/
|
463
815
|
extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerIsSensorEnabled(SDL_GameController *gamecontroller, SDL_SensorType type);
|
464
816
|
|
465
817
|
/**
|
466
|
-
*
|
818
|
+
* Get the data rate (number of events per second) of a game controller
|
819
|
+
* sensor.
|
820
|
+
*
|
821
|
+
* \param gamecontroller The controller to query
|
822
|
+
* \param type The type of sensor to query
|
823
|
+
* \return the data rate, or 0.0f if the data rate is not available.
|
824
|
+
*
|
825
|
+
* \since This function is available since SDL 2.0.16.
|
826
|
+
*/
|
827
|
+
extern DECLSPEC float SDLCALL SDL_GameControllerGetSensorDataRate(SDL_GameController *gamecontroller, SDL_SensorType type);
|
828
|
+
|
829
|
+
/**
|
830
|
+
* Get the current state of a game controller sensor.
|
467
831
|
*
|
468
|
-
*
|
469
|
-
*
|
832
|
+
* The number of values and interpretation of the data is sensor dependent.
|
833
|
+
* See SDL_sensor.h for the details for each type of sensor.
|
470
834
|
*
|
471
|
-
*
|
472
|
-
*
|
473
|
-
*
|
474
|
-
*
|
835
|
+
* \param gamecontroller The controller to query
|
836
|
+
* \param type The type of sensor to query
|
837
|
+
* \param data A pointer filled with the current sensor state
|
838
|
+
* \param num_values The number of values to write to data
|
839
|
+
* \return 0 or -1 if an error occurred.
|
475
840
|
*
|
476
|
-
*
|
841
|
+
* \since This function is available since SDL 2.0.14.
|
477
842
|
*/
|
478
843
|
extern DECLSPEC int SDLCALL SDL_GameControllerGetSensorData(SDL_GameController *gamecontroller, SDL_SensorType type, float *data, int num_values);
|
479
844
|
|
480
845
|
/**
|
481
|
-
*
|
482
|
-
*
|
846
|
+
* Start a rumble effect on a game controller.
|
847
|
+
*
|
848
|
+
* Each call to this function cancels any previous rumble effect, and calling
|
849
|
+
* it with 0 intensity stops any rumbling.
|
483
850
|
*
|
484
|
-
*
|
485
|
-
*
|
486
|
-
*
|
487
|
-
*
|
851
|
+
* \param gamecontroller The controller to vibrate
|
852
|
+
* \param low_frequency_rumble The intensity of the low frequency (left)
|
853
|
+
* rumble motor, from 0 to 0xFFFF
|
854
|
+
* \param high_frequency_rumble The intensity of the high frequency (right)
|
855
|
+
* rumble motor, from 0 to 0xFFFF
|
856
|
+
* \param duration_ms The duration of the rumble effect, in milliseconds
|
857
|
+
* \returns 0, or -1 if rumble isn't supported on this controller
|
488
858
|
*
|
489
|
-
*
|
859
|
+
* \since This function is available since SDL 2.0.9.
|
860
|
+
*
|
861
|
+
* \sa SDL_GameControllerHasRumble
|
490
862
|
*/
|
491
863
|
extern DECLSPEC int SDLCALL SDL_GameControllerRumble(SDL_GameController *gamecontroller, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
|
492
864
|
|
493
865
|
/**
|
494
|
-
*
|
495
|
-
*
|
866
|
+
* Start a rumble effect in the game controller's triggers.
|
867
|
+
*
|
868
|
+
* Each call to this function cancels any previous trigger rumble effect, and
|
869
|
+
* calling it with 0 intensity stops any rumbling.
|
496
870
|
*
|
497
|
-
*
|
498
|
-
*
|
499
|
-
*
|
500
|
-
* \param duration_ms The duration of the rumble effect, in milliseconds
|
871
|
+
* Note that this is rumbling of the _triggers_ and not the game controller as
|
872
|
+
* a whole. The first controller to offer this feature was the PlayStation 5's
|
873
|
+
* DualShock 5.
|
501
874
|
*
|
502
|
-
*
|
875
|
+
* \param gamecontroller The controller to vibrate
|
876
|
+
* \param left_rumble The intensity of the left trigger rumble motor, from 0
|
877
|
+
* to 0xFFFF
|
878
|
+
* \param right_rumble The intensity of the right trigger rumble motor, from 0
|
879
|
+
* to 0xFFFF
|
880
|
+
* \param duration_ms The duration of the rumble effect, in milliseconds
|
881
|
+
* \returns 0, or -1 if trigger rumble isn't supported on this controller
|
882
|
+
*
|
883
|
+
* \since This function is available since SDL 2.0.14.
|
884
|
+
*
|
885
|
+
* \sa SDL_GameControllerHasRumbleTriggers
|
503
886
|
*/
|
504
887
|
extern DECLSPEC int SDLCALL SDL_GameControllerRumbleTriggers(SDL_GameController *gamecontroller, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms);
|
505
888
|
|
506
889
|
/**
|
507
|
-
*
|
890
|
+
* Query whether a game controller has an LED.
|
508
891
|
*
|
509
|
-
*
|
892
|
+
* \param gamecontroller The controller to query
|
893
|
+
* \returns SDL_TRUE, or SDL_FALSE if this controller does not have a
|
894
|
+
* modifiable LED
|
510
895
|
*
|
511
|
-
*
|
896
|
+
* \since This function is available since SDL 2.0.14.
|
512
897
|
*/
|
513
898
|
extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasLED(SDL_GameController *gamecontroller);
|
514
899
|
|
515
900
|
/**
|
516
|
-
*
|
901
|
+
* Query whether a game controller has rumble support.
|
902
|
+
*
|
903
|
+
* \param gamecontroller The controller to query
|
904
|
+
* \returns SDL_TRUE, or SDL_FALSE if this controller does not have rumble
|
905
|
+
* support
|
906
|
+
*
|
907
|
+
* \since This function is available since SDL 2.0.18.
|
908
|
+
*
|
909
|
+
* \sa SDL_GameControllerRumble
|
910
|
+
*/
|
911
|
+
extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasRumble(SDL_GameController *gamecontroller);
|
912
|
+
|
913
|
+
/**
|
914
|
+
* Query whether a game controller has rumble support on triggers.
|
915
|
+
*
|
916
|
+
* \param gamecontroller The controller to query
|
917
|
+
* \returns SDL_TRUE, or SDL_FALSE if this controller does not have trigger
|
918
|
+
* rumble support
|
919
|
+
*
|
920
|
+
* \since This function is available since SDL 2.0.18.
|
921
|
+
*
|
922
|
+
* \sa SDL_GameControllerRumbleTriggers
|
923
|
+
*/
|
924
|
+
extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasRumbleTriggers(SDL_GameController *gamecontroller);
|
925
|
+
|
926
|
+
/**
|
927
|
+
* Update a game controller's LED color.
|
517
928
|
*
|
518
|
-
*
|
519
|
-
*
|
520
|
-
*
|
521
|
-
*
|
929
|
+
* \param gamecontroller The controller to update
|
930
|
+
* \param red The intensity of the red LED
|
931
|
+
* \param green The intensity of the green LED
|
932
|
+
* \param blue The intensity of the blue LED
|
933
|
+
* \returns 0, or -1 if this controller does not have a modifiable LED
|
522
934
|
*
|
523
|
-
*
|
935
|
+
* \since This function is available since SDL 2.0.14.
|
524
936
|
*/
|
525
937
|
extern DECLSPEC int SDLCALL SDL_GameControllerSetLED(SDL_GameController *gamecontroller, Uint8 red, Uint8 green, Uint8 blue);
|
526
938
|
|
527
939
|
/**
|
528
|
-
*
|
940
|
+
* Send a controller specific effect packet
|
941
|
+
*
|
942
|
+
* \param gamecontroller The controller to affect
|
943
|
+
* \param data The data to send to the controller
|
944
|
+
* \param size The size of the data to send to the controller
|
945
|
+
* \returns 0, or -1 if this controller or driver doesn't support effect
|
946
|
+
* packets
|
947
|
+
*
|
948
|
+
* \since This function is available since SDL 2.0.16.
|
949
|
+
*/
|
950
|
+
extern DECLSPEC int SDLCALL SDL_GameControllerSendEffect(SDL_GameController *gamecontroller, const void *data, int size);
|
951
|
+
|
952
|
+
/**
|
953
|
+
* Close a game controller previously opened with SDL_GameControllerOpen().
|
954
|
+
*
|
955
|
+
* \param gamecontroller a game controller identifier previously returned by
|
956
|
+
* SDL_GameControllerOpen()
|
957
|
+
*
|
958
|
+
* \since This function is available since SDL 2.0.0.
|
959
|
+
*
|
960
|
+
* \sa SDL_GameControllerOpen
|
529
961
|
*/
|
530
962
|
extern DECLSPEC void SDLCALL SDL_GameControllerClose(SDL_GameController *gamecontroller);
|
531
963
|
|
964
|
+
/**
|
965
|
+
* Return the sfSymbolsName for a given button on a game controller on Apple
|
966
|
+
* platforms.
|
967
|
+
*
|
968
|
+
* \param gamecontroller the controller to query
|
969
|
+
* \param button a button on the game controller
|
970
|
+
* \returns the sfSymbolsName or NULL if the name can't be found
|
971
|
+
*
|
972
|
+
* \since This function is available since SDL 2.0.18.
|
973
|
+
*
|
974
|
+
* \sa SDL_GameControllerGetAppleSFSymbolsNameForAxis
|
975
|
+
*/
|
976
|
+
extern DECLSPEC const char* SDLCALL SDL_GameControllerGetAppleSFSymbolsNameForButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button);
|
977
|
+
|
978
|
+
/**
|
979
|
+
* Return the sfSymbolsName for a given axis on a game controller on Apple
|
980
|
+
* platforms.
|
981
|
+
*
|
982
|
+
* \param gamecontroller the controller to query
|
983
|
+
* \param axis an axis on the game controller
|
984
|
+
* \returns the sfSymbolsName or NULL if the name can't be found
|
985
|
+
*
|
986
|
+
* \since This function is available since SDL 2.0.18.
|
987
|
+
*
|
988
|
+
* \sa SDL_GameControllerGetAppleSFSymbolsNameForButton
|
989
|
+
*/
|
990
|
+
extern DECLSPEC const char* SDLCALL SDL_GameControllerGetAppleSFSymbolsNameForAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis);
|
991
|
+
|
532
992
|
|
533
993
|
/* Ends C function definitions when using C++ */
|
534
994
|
#ifdef __cplusplus
|