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
|
@@ -50,7 +50,7 @@ extern "C" {
|
|
50
50
|
#define SDL_PRESSED 1
|
51
51
|
|
52
52
|
/**
|
53
|
-
*
|
53
|
+
* The types of events that can be delivered.
|
54
54
|
*/
|
55
55
|
typedef enum
|
56
56
|
{
|
@@ -160,6 +160,9 @@ typedef enum
|
|
160
160
|
SDL_RENDER_TARGETS_RESET = 0x2000, /**< The render targets have been reset and their contents need to be updated */
|
161
161
|
SDL_RENDER_DEVICE_RESET, /**< The device has been reset and all textures need to be recreated */
|
162
162
|
|
163
|
+
/* Internal events */
|
164
|
+
SDL_POLLSENTINEL = 0x7F00, /**< Signals the end of an event poll cycle */
|
165
|
+
|
163
166
|
/** Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use,
|
164
167
|
* and should be allocated with SDL_RegisterEvents()
|
165
168
|
*/
|
@@ -298,6 +301,8 @@ typedef struct SDL_MouseWheelEvent
|
|
298
301
|
Sint32 x; /**< The amount scrolled horizontally, positive to the right and negative to the left */
|
299
302
|
Sint32 y; /**< The amount scrolled vertically, positive away from the user and negative toward the user */
|
300
303
|
Uint32 direction; /**< Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back */
|
304
|
+
float preciseX; /**< The amount scrolled horizontally, positive to the right and negative to the left, with float precision (added in 2.0.18) */
|
305
|
+
float preciseY; /**< The amount scrolled vertically, positive away from the user and negative toward the user, with float precision (added in 2.0.18) */
|
301
306
|
} SDL_MouseWheelEvent;
|
302
307
|
|
303
308
|
/**
|
@@ -620,28 +625,49 @@ typedef union SDL_Event
|
|
620
625
|
SDL_DollarGestureEvent dgesture; /**< Gesture event data */
|
621
626
|
SDL_DropEvent drop; /**< Drag and drop event data */
|
622
627
|
|
623
|
-
/* This is necessary for ABI compatibility between Visual C++ and GCC
|
624
|
-
Visual C++ will respect the push pack pragma and use 52 bytes
|
625
|
-
|
626
|
-
|
628
|
+
/* This is necessary for ABI compatibility between Visual C++ and GCC.
|
629
|
+
Visual C++ will respect the push pack pragma and use 52 bytes (size of
|
630
|
+
SDL_TextEditingEvent, the largest structure for 32-bit and 64-bit
|
631
|
+
architectures) for this union, and GCC will use the alignment of the
|
632
|
+
largest datatype within the union, which is 8 bytes on 64-bit
|
633
|
+
architectures.
|
627
634
|
|
628
635
|
So... we'll add padding to force the size to be 56 bytes for both.
|
636
|
+
|
637
|
+
On architectures where pointers are 16 bytes, this needs rounding up to
|
638
|
+
the next multiple of 16, 64, and on architectures where pointers are
|
639
|
+
even larger the size of SDL_UserEvent will dominate as being 3 pointers.
|
629
640
|
*/
|
630
|
-
Uint8 padding[56];
|
641
|
+
Uint8 padding[sizeof(void *) <= 8 ? 56 : sizeof(void *) == 16 ? 64 : 3 * sizeof(void *)];
|
631
642
|
} SDL_Event;
|
632
643
|
|
633
644
|
/* Make sure we haven't broken binary compatibility */
|
634
|
-
SDL_COMPILE_TIME_ASSERT(SDL_Event, sizeof(SDL_Event) ==
|
645
|
+
SDL_COMPILE_TIME_ASSERT(SDL_Event, sizeof(SDL_Event) == sizeof(((SDL_Event *)NULL)->padding));
|
635
646
|
|
636
647
|
|
637
648
|
/* Function prototypes */
|
638
649
|
|
639
650
|
/**
|
640
|
-
*
|
651
|
+
* Pump the event loop, gathering events from the input devices.
|
652
|
+
*
|
653
|
+
* This function updates the event queue and internal input device state.
|
641
654
|
*
|
642
|
-
*
|
655
|
+
* **WARNING**: This should only be run in the thread that initialized the
|
656
|
+
* video subsystem, and for extra safety, you should consider only doing those
|
657
|
+
* things on the main thread in any case.
|
643
658
|
*
|
644
|
-
*
|
659
|
+
* SDL_PumpEvents() gathers all the pending input information from devices and
|
660
|
+
* places it in the event queue. Without calls to SDL_PumpEvents() no events
|
661
|
+
* would ever be placed on the queue. Often the need for calls to
|
662
|
+
* SDL_PumpEvents() is hidden from the user since SDL_PollEvent() and
|
663
|
+
* SDL_WaitEvent() implicitly call SDL_PumpEvents(). However, if you are not
|
664
|
+
* polling or waiting for events (e.g. you are filtering them), then you must
|
665
|
+
* call SDL_PumpEvents() to force an event queue update.
|
666
|
+
*
|
667
|
+
* \since This function is available since SDL 2.0.0.
|
668
|
+
*
|
669
|
+
* \sa SDL_PollEvent
|
670
|
+
* \sa SDL_WaitEvent
|
645
671
|
*/
|
646
672
|
extern DECLSPEC void SDLCALL SDL_PumpEvents(void);
|
647
673
|
|
@@ -654,22 +680,42 @@ typedef enum
|
|
654
680
|
} SDL_eventaction;
|
655
681
|
|
656
682
|
/**
|
657
|
-
*
|
683
|
+
* Check the event queue for messages and optionally return them.
|
684
|
+
*
|
685
|
+
* `action` may be any of the following:
|
658
686
|
*
|
659
|
-
*
|
660
|
-
*
|
687
|
+
* - `SDL_ADDEVENT`: up to `numevents` events will be added to the back of the
|
688
|
+
* event queue.
|
689
|
+
* - `SDL_PEEKEVENT`: `numevents` events at the front of the event queue,
|
690
|
+
* within the specified minimum and maximum type, will be returned to the
|
691
|
+
* caller and will _not_ be removed from the queue.
|
692
|
+
* - `SDL_GETEVENT`: up to `numevents` events at the front of the event queue,
|
693
|
+
* within the specified minimum and maximum type, will be returned to the
|
694
|
+
* caller and will be removed from the queue.
|
661
695
|
*
|
662
|
-
*
|
663
|
-
*
|
664
|
-
*
|
696
|
+
* You may have to call SDL_PumpEvents() before calling this function.
|
697
|
+
* Otherwise, the events may not be ready to be filtered when you call
|
698
|
+
* SDL_PeepEvents().
|
665
699
|
*
|
666
|
-
*
|
667
|
-
* of the event queue, within the specified minimum and maximum type,
|
668
|
-
* will be returned and will be removed from the queue.
|
700
|
+
* This function is thread-safe.
|
669
701
|
*
|
670
|
-
*
|
702
|
+
* \param events destination buffer for the retrieved events
|
703
|
+
* \param numevents if action is SDL_ADDEVENT, the number of events to add
|
704
|
+
* back to the event queue; if action is SDL_PEEKEVENT or
|
705
|
+
* SDL_GETEVENT, the maximum number of events to retrieve
|
706
|
+
* \param action action to take; see [[#action|Remarks]] for details
|
707
|
+
* \param minType minimum value of the event type to be considered;
|
708
|
+
* SDL_FIRSTEVENT is a safe choice
|
709
|
+
* \param maxType maximum value of the event type to be considered;
|
710
|
+
* SDL_LASTEVENT is a safe choice
|
711
|
+
* \returns the number of events actually stored or a negative error code on
|
712
|
+
* failure; call SDL_GetError() for more information.
|
671
713
|
*
|
672
|
-
*
|
714
|
+
* \since This function is available since SDL 2.0.0.
|
715
|
+
*
|
716
|
+
* \sa SDL_PollEvent
|
717
|
+
* \sa SDL_PumpEvents
|
718
|
+
* \sa SDL_PushEvent
|
673
719
|
*/
|
674
720
|
extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event * events, int numevents,
|
675
721
|
SDL_eventaction action,
|
@@ -677,113 +723,354 @@ extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event * events, int numevents,
|
|
677
723
|
/* @} */
|
678
724
|
|
679
725
|
/**
|
680
|
-
*
|
726
|
+
* Check for the existence of a certain event type in the event queue.
|
727
|
+
*
|
728
|
+
* If you need to check for a range of event types, use SDL_HasEvents()
|
729
|
+
* instead.
|
730
|
+
*
|
731
|
+
* \param type the type of event to be queried; see SDL_EventType for details
|
732
|
+
* \returns SDL_TRUE if events matching `type` are present, or SDL_FALSE if
|
733
|
+
* events matching `type` are not present.
|
734
|
+
*
|
735
|
+
* \since This function is available since SDL 2.0.0.
|
736
|
+
*
|
737
|
+
* \sa SDL_HasEvents
|
681
738
|
*/
|
682
739
|
extern DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 type);
|
740
|
+
|
741
|
+
|
742
|
+
/**
|
743
|
+
* Check for the existence of certain event types in the event queue.
|
744
|
+
*
|
745
|
+
* If you need to check for a single event type, use SDL_HasEvent() instead.
|
746
|
+
*
|
747
|
+
* \param minType the low end of event type to be queried, inclusive; see
|
748
|
+
* SDL_EventType for details
|
749
|
+
* \param maxType the high end of event type to be queried, inclusive; see
|
750
|
+
* SDL_EventType for details
|
751
|
+
* \returns SDL_TRUE if events with type >= `minType` and <= `maxType` are
|
752
|
+
* present, or SDL_FALSE if not.
|
753
|
+
*
|
754
|
+
* \since This function is available since SDL 2.0.0.
|
755
|
+
*
|
756
|
+
* \sa SDL_HasEvents
|
757
|
+
*/
|
683
758
|
extern DECLSPEC SDL_bool SDLCALL SDL_HasEvents(Uint32 minType, Uint32 maxType);
|
684
759
|
|
685
760
|
/**
|
686
|
-
*
|
687
|
-
*
|
688
|
-
*
|
689
|
-
*
|
761
|
+
* Clear events of a specific type from the event queue.
|
762
|
+
*
|
763
|
+
* This will unconditionally remove any events from the queue that match
|
764
|
+
* `type`. If you need to remove a range of event types, use SDL_FlushEvents()
|
765
|
+
* instead.
|
766
|
+
*
|
767
|
+
* It's also normal to just ignore events you don't care about in your event
|
768
|
+
* loop without calling this function.
|
769
|
+
*
|
770
|
+
* This function only affects currently queued events. If you want to make
|
771
|
+
* sure that all pending OS events are flushed, you can call SDL_PumpEvents()
|
772
|
+
* on the main thread immediately before the flush call.
|
773
|
+
*
|
774
|
+
* \param type the type of event to be cleared; see SDL_EventType for details
|
775
|
+
*
|
776
|
+
* \since This function is available since SDL 2.0.0.
|
777
|
+
*
|
778
|
+
* \sa SDL_FlushEvents
|
690
779
|
*/
|
691
780
|
extern DECLSPEC void SDLCALL SDL_FlushEvent(Uint32 type);
|
781
|
+
|
782
|
+
/**
|
783
|
+
* Clear events of a range of types from the event queue.
|
784
|
+
*
|
785
|
+
* This will unconditionally remove any events from the queue that are in the
|
786
|
+
* range of `minType` to `maxType`, inclusive. If you need to remove a single
|
787
|
+
* event type, use SDL_FlushEvent() instead.
|
788
|
+
*
|
789
|
+
* It's also normal to just ignore events you don't care about in your event
|
790
|
+
* loop without calling this function.
|
791
|
+
*
|
792
|
+
* This function only affects currently queued events. If you want to make
|
793
|
+
* sure that all pending OS events are flushed, you can call SDL_PumpEvents()
|
794
|
+
* on the main thread immediately before the flush call.
|
795
|
+
*
|
796
|
+
* \param minType the low end of event type to be cleared, inclusive; see
|
797
|
+
* SDL_EventType for details
|
798
|
+
* \param maxType the high end of event type to be cleared, inclusive; see
|
799
|
+
* SDL_EventType for details
|
800
|
+
*
|
801
|
+
* \since This function is available since SDL 2.0.0.
|
802
|
+
*
|
803
|
+
* \sa SDL_FlushEvent
|
804
|
+
*/
|
692
805
|
extern DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType);
|
693
806
|
|
694
807
|
/**
|
695
|
-
*
|
808
|
+
* Poll for currently pending events.
|
809
|
+
*
|
810
|
+
* If `event` is not NULL, the next event is removed from the queue and stored
|
811
|
+
* in the SDL_Event structure pointed to by `event`. The 1 returned refers to
|
812
|
+
* this event, immediately stored in the SDL Event structure -- not an event
|
813
|
+
* to follow.
|
696
814
|
*
|
697
|
-
*
|
815
|
+
* If `event` is NULL, it simply returns 1 if there is an event in the queue,
|
816
|
+
* but will not remove it from the queue.
|
698
817
|
*
|
699
|
-
*
|
700
|
-
*
|
818
|
+
* As this function may implicitly call SDL_PumpEvents(), you can only call
|
819
|
+
* this function in the thread that set the video mode.
|
820
|
+
*
|
821
|
+
* SDL_PollEvent() is the favored way of receiving system events since it can
|
822
|
+
* be done from the main loop and does not suspend the main loop while waiting
|
823
|
+
* on an event to be posted.
|
824
|
+
*
|
825
|
+
* The common practice is to fully process the event queue once every frame,
|
826
|
+
* usually as a first step before updating the game's state:
|
827
|
+
*
|
828
|
+
* ```c
|
829
|
+
* while (game_is_still_running) {
|
830
|
+
* SDL_Event event;
|
831
|
+
* while (SDL_PollEvent(&event)) { // poll until all events are handled!
|
832
|
+
* // decide what to do with this event.
|
833
|
+
* }
|
834
|
+
*
|
835
|
+
* // update game state, draw the current frame
|
836
|
+
* }
|
837
|
+
* ```
|
838
|
+
*
|
839
|
+
* \param event the SDL_Event structure to be filled with the next event from
|
840
|
+
* the queue, or NULL
|
841
|
+
* \returns 1 if there is a pending event or 0 if there are none available.
|
842
|
+
*
|
843
|
+
* \since This function is available since SDL 2.0.0.
|
844
|
+
*
|
845
|
+
* \sa SDL_GetEventFilter
|
846
|
+
* \sa SDL_PeepEvents
|
847
|
+
* \sa SDL_PushEvent
|
848
|
+
* \sa SDL_SetEventFilter
|
849
|
+
* \sa SDL_WaitEvent
|
850
|
+
* \sa SDL_WaitEventTimeout
|
701
851
|
*/
|
702
852
|
extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event * event);
|
703
853
|
|
704
854
|
/**
|
705
|
-
*
|
855
|
+
* Wait indefinitely for the next available event.
|
856
|
+
*
|
857
|
+
* If `event` is not NULL, the next event is removed from the queue and stored
|
858
|
+
* in the SDL_Event structure pointed to by `event`.
|
859
|
+
*
|
860
|
+
* As this function may implicitly call SDL_PumpEvents(), you can only call
|
861
|
+
* this function in the thread that initialized the video subsystem.
|
706
862
|
*
|
707
|
-
*
|
863
|
+
* \param event the SDL_Event structure to be filled in with the next event
|
864
|
+
* from the queue, or NULL
|
865
|
+
* \returns 1 on success or 0 if there was an error while waiting for events;
|
866
|
+
* call SDL_GetError() for more information.
|
708
867
|
*
|
709
|
-
*
|
710
|
-
*
|
868
|
+
* \since This function is available since SDL 2.0.0.
|
869
|
+
*
|
870
|
+
* \sa SDL_PollEvent
|
871
|
+
* \sa SDL_PumpEvents
|
872
|
+
* \sa SDL_WaitEventTimeout
|
711
873
|
*/
|
712
874
|
extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event * event);
|
713
875
|
|
714
876
|
/**
|
715
|
-
*
|
716
|
-
*
|
877
|
+
* Wait until the specified timeout (in milliseconds) for the next available
|
878
|
+
* event.
|
879
|
+
*
|
880
|
+
* If `event` is not NULL, the next event is removed from the queue and stored
|
881
|
+
* in the SDL_Event structure pointed to by `event`.
|
717
882
|
*
|
718
|
-
*
|
883
|
+
* As this function may implicitly call SDL_PumpEvents(), you can only call
|
884
|
+
* this function in the thread that initialized the video subsystem.
|
719
885
|
*
|
720
|
-
*
|
721
|
-
*
|
722
|
-
*
|
886
|
+
* \param event the SDL_Event structure to be filled in with the next event
|
887
|
+
* from the queue, or NULL
|
888
|
+
* \param timeout the maximum number of milliseconds to wait for the next
|
889
|
+
* available event
|
890
|
+
* \returns 1 on success or 0 if there was an error while waiting for events;
|
891
|
+
* call SDL_GetError() for more information. This also returns 0 if
|
892
|
+
* the timeout elapsed without an event arriving.
|
893
|
+
*
|
894
|
+
* \since This function is available since SDL 2.0.0.
|
895
|
+
*
|
896
|
+
* \sa SDL_PollEvent
|
897
|
+
* \sa SDL_PumpEvents
|
898
|
+
* \sa SDL_WaitEvent
|
723
899
|
*/
|
724
900
|
extern DECLSPEC int SDLCALL SDL_WaitEventTimeout(SDL_Event * event,
|
725
901
|
int timeout);
|
726
902
|
|
727
903
|
/**
|
728
|
-
*
|
904
|
+
* Add an event to the event queue.
|
905
|
+
*
|
906
|
+
* The event queue can actually be used as a two way communication channel.
|
907
|
+
* Not only can events be read from the queue, but the user can also push
|
908
|
+
* their own events onto it. `event` is a pointer to the event structure you
|
909
|
+
* wish to push onto the queue. The event is copied into the queue, and the
|
910
|
+
* caller may dispose of the memory pointed to after SDL_PushEvent() returns.
|
911
|
+
*
|
912
|
+
* Note: Pushing device input events onto the queue doesn't modify the state
|
913
|
+
* of the device within SDL.
|
914
|
+
*
|
915
|
+
* This function is thread-safe, and can be called from other threads safely.
|
916
|
+
*
|
917
|
+
* Note: Events pushed onto the queue with SDL_PushEvent() get passed through
|
918
|
+
* the event filter but events added with SDL_PeepEvents() do not.
|
729
919
|
*
|
730
|
-
*
|
731
|
-
*
|
920
|
+
* For pushing application-specific events, please use SDL_RegisterEvents() to
|
921
|
+
* get an event type that does not conflict with other code that also wants
|
922
|
+
* its own custom event types.
|
923
|
+
*
|
924
|
+
* \param event the SDL_Event to be added to the queue
|
925
|
+
* \returns 1 on success, 0 if the event was filtered, or a negative error
|
926
|
+
* code on failure; call SDL_GetError() for more information. A
|
927
|
+
* common reason for error is the event queue being full.
|
928
|
+
*
|
929
|
+
* \since This function is available since SDL 2.0.0.
|
930
|
+
*
|
931
|
+
* \sa SDL_PeepEvents
|
932
|
+
* \sa SDL_PollEvent
|
933
|
+
* \sa SDL_RegisterEvents
|
732
934
|
*/
|
733
935
|
extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event * event);
|
734
936
|
|
937
|
+
/**
|
938
|
+
* A function pointer used for callbacks that watch the event queue.
|
939
|
+
*
|
940
|
+
* \param userdata what was passed as `userdata` to SDL_SetEventFilter()
|
941
|
+
* or SDL_AddEventWatch, etc
|
942
|
+
* \param event the event that triggered the callback
|
943
|
+
* \returns 1 to permit event to be added to the queue, and 0 to disallow
|
944
|
+
* it. When used with SDL_AddEventWatch, the return value is ignored.
|
945
|
+
*
|
946
|
+
* \sa SDL_SetEventFilter
|
947
|
+
* \sa SDL_AddEventWatch
|
948
|
+
*/
|
735
949
|
typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event);
|
736
950
|
|
737
951
|
/**
|
738
|
-
*
|
739
|
-
*
|
952
|
+
* Set up a filter to process all events before they change internal state and
|
953
|
+
* are posted to the internal event queue.
|
954
|
+
*
|
955
|
+
* If the filter function returns 1 when called, then the event will be added
|
956
|
+
* to the internal queue. If it returns 0, then the event will be dropped from
|
957
|
+
* the queue, but the internal state will still be updated. This allows
|
958
|
+
* selective filtering of dynamically arriving events.
|
959
|
+
*
|
960
|
+
* **WARNING**: Be very careful of what you do in the event filter function,
|
961
|
+
* as it may run in a different thread!
|
962
|
+
*
|
963
|
+
* On platforms that support it, if the quit event is generated by an
|
964
|
+
* interrupt signal (e.g. pressing Ctrl-C), it will be delivered to the
|
965
|
+
* application at the next event poll.
|
966
|
+
*
|
967
|
+
* There is one caveat when dealing with the ::SDL_QuitEvent event type. The
|
968
|
+
* event filter is only called when the window manager desires to close the
|
969
|
+
* application window. If the event filter returns 1, then the window will be
|
970
|
+
* closed, otherwise the window will remain open if possible.
|
971
|
+
*
|
972
|
+
* Note: Disabled events never make it to the event filter function; see
|
973
|
+
* SDL_EventState().
|
740
974
|
*
|
741
|
-
*
|
742
|
-
*
|
743
|
-
* int SDL_EventFilter(void *userdata, SDL_Event * event);
|
744
|
-
* \endcode
|
975
|
+
* Note: If you just want to inspect events without filtering, you should use
|
976
|
+
* SDL_AddEventWatch() instead.
|
745
977
|
*
|
746
|
-
*
|
747
|
-
*
|
748
|
-
*
|
749
|
-
* dynamically arriving events.
|
978
|
+
* Note: Events pushed onto the queue with SDL_PushEvent() get passed through
|
979
|
+
* the event filter, but events pushed onto the queue with SDL_PeepEvents() do
|
980
|
+
* not.
|
750
981
|
*
|
751
|
-
*
|
752
|
-
*
|
982
|
+
* \param filter An SDL_EventFilter function to call when an event happens
|
983
|
+
* \param userdata a pointer that is passed to `filter`
|
753
984
|
*
|
754
|
-
*
|
755
|
-
* event filter is only called when the window manager desires to close the
|
756
|
-
* application window. If the event filter returns 1, then the window will
|
757
|
-
* be closed, otherwise the window will remain open if possible.
|
985
|
+
* \since This function is available since SDL 2.0.0.
|
758
986
|
*
|
759
|
-
*
|
760
|
-
*
|
987
|
+
* \sa SDL_AddEventWatch
|
988
|
+
* \sa SDL_EventState
|
989
|
+
* \sa SDL_GetEventFilter
|
990
|
+
* \sa SDL_PeepEvents
|
991
|
+
* \sa SDL_PushEvent
|
761
992
|
*/
|
762
993
|
extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter,
|
763
994
|
void *userdata);
|
764
995
|
|
765
996
|
/**
|
766
|
-
*
|
767
|
-
*
|
997
|
+
* Query the current event filter.
|
998
|
+
*
|
999
|
+
* This function can be used to "chain" filters, by saving the existing filter
|
1000
|
+
* before replacing it with a function that will call that saved filter.
|
1001
|
+
*
|
1002
|
+
* \param filter the current callback function will be stored here
|
1003
|
+
* \param userdata the pointer that is passed to the current event filter will
|
1004
|
+
* be stored here
|
1005
|
+
* \returns SDL_TRUE on success or SDL_FALSE if there is no event filter set.
|
1006
|
+
*
|
1007
|
+
* \since This function is available since SDL 2.0.0.
|
1008
|
+
*
|
1009
|
+
* \sa SDL_SetEventFilter
|
768
1010
|
*/
|
769
1011
|
extern DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter * filter,
|
770
1012
|
void **userdata);
|
771
1013
|
|
772
1014
|
/**
|
773
|
-
*
|
1015
|
+
* Add a callback to be triggered when an event is added to the event queue.
|
1016
|
+
*
|
1017
|
+
* `filter` will be called when an event happens, and its return value is
|
1018
|
+
* ignored.
|
1019
|
+
*
|
1020
|
+
* **WARNING**: Be very careful of what you do in the event filter function,
|
1021
|
+
* as it may run in a different thread!
|
1022
|
+
*
|
1023
|
+
* If the quit event is generated by a signal (e.g. SIGINT), it will bypass
|
1024
|
+
* the internal queue and be delivered to the watch callback immediately, and
|
1025
|
+
* arrive at the next event poll.
|
1026
|
+
*
|
1027
|
+
* Note: the callback is called for events posted by the user through
|
1028
|
+
* SDL_PushEvent(), but not for disabled events, nor for events by a filter
|
1029
|
+
* callback set with SDL_SetEventFilter(), nor for events posted by the user
|
1030
|
+
* through SDL_PeepEvents().
|
1031
|
+
*
|
1032
|
+
* \param filter an SDL_EventFilter function to call when an event happens.
|
1033
|
+
* \param userdata a pointer that is passed to `filter`
|
1034
|
+
*
|
1035
|
+
* \since This function is available since SDL 2.0.0.
|
1036
|
+
*
|
1037
|
+
* \sa SDL_DelEventWatch
|
1038
|
+
* \sa SDL_SetEventFilter
|
774
1039
|
*/
|
775
1040
|
extern DECLSPEC void SDLCALL SDL_AddEventWatch(SDL_EventFilter filter,
|
776
1041
|
void *userdata);
|
777
1042
|
|
778
1043
|
/**
|
779
|
-
*
|
1044
|
+
* Remove an event watch callback added with SDL_AddEventWatch().
|
1045
|
+
*
|
1046
|
+
* This function takes the same input as SDL_AddEventWatch() to identify and
|
1047
|
+
* delete the corresponding callback.
|
1048
|
+
*
|
1049
|
+
* \param filter the function originally passed to SDL_AddEventWatch()
|
1050
|
+
* \param userdata the pointer originally passed to SDL_AddEventWatch()
|
1051
|
+
*
|
1052
|
+
* \since This function is available since SDL 2.0.0.
|
1053
|
+
*
|
1054
|
+
* \sa SDL_AddEventWatch
|
780
1055
|
*/
|
781
1056
|
extern DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter,
|
782
1057
|
void *userdata);
|
783
1058
|
|
784
1059
|
/**
|
785
|
-
*
|
786
|
-
*
|
1060
|
+
* Run a specific filter function on the current event queue, removing any
|
1061
|
+
* events for which the filter returns 0.
|
1062
|
+
*
|
1063
|
+
* See SDL_SetEventFilter() for more information. Unlike SDL_SetEventFilter(),
|
1064
|
+
* this function does not change the filter permanently, it only uses the
|
1065
|
+
* supplied filter until this function returns.
|
1066
|
+
*
|
1067
|
+
* \param filter the SDL_EventFilter function to call when an event happens
|
1068
|
+
* \param userdata a pointer that is passed to `filter`
|
1069
|
+
*
|
1070
|
+
* \since This function is available since SDL 2.0.0.
|
1071
|
+
*
|
1072
|
+
* \sa SDL_GetEventFilter
|
1073
|
+
* \sa SDL_SetEventFilter
|
787
1074
|
*/
|
788
1075
|
extern DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter,
|
789
1076
|
void *userdata);
|
@@ -795,24 +1082,45 @@ extern DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter,
|
|
795
1082
|
#define SDL_ENABLE 1
|
796
1083
|
|
797
1084
|
/**
|
798
|
-
*
|
799
|
-
*
|
800
|
-
*
|
801
|
-
*
|
802
|
-
*
|
803
|
-
*
|
804
|
-
*
|
1085
|
+
* Set the state of processing events by type.
|
1086
|
+
*
|
1087
|
+
* `state` may be any of the following:
|
1088
|
+
*
|
1089
|
+
* - `SDL_QUERY`: returns the current processing state of the specified event
|
1090
|
+
* - `SDL_IGNORE` (aka `SDL_DISABLE`): the event will automatically be dropped
|
1091
|
+
* from the event queue and will not be filtered
|
1092
|
+
* - `SDL_ENABLE`: the event will be processed normally
|
1093
|
+
*
|
1094
|
+
* \param type the type of event; see SDL_EventType for details
|
1095
|
+
* \param state how to process the event
|
1096
|
+
* \returns `SDL_DISABLE` or `SDL_ENABLE`, representing the processing state
|
1097
|
+
* of the event before this function makes any changes to it.
|
1098
|
+
*
|
1099
|
+
* \since This function is available since SDL 2.0.0.
|
1100
|
+
*
|
1101
|
+
* \sa SDL_GetEventState
|
805
1102
|
*/
|
806
1103
|
extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint32 type, int state);
|
807
1104
|
/* @} */
|
808
1105
|
#define SDL_GetEventState(type) SDL_EventState(type, SDL_QUERY)
|
809
1106
|
|
810
1107
|
/**
|
811
|
-
*
|
812
|
-
*
|
1108
|
+
* Allocate a set of user-defined events, and return the beginning event
|
1109
|
+
* number for that set of events.
|
1110
|
+
*
|
1111
|
+
* Calling this function with `numevents` <= 0 is an error and will return
|
1112
|
+
* (Uint32)-1.
|
1113
|
+
*
|
1114
|
+
* Note, (Uint32)-1 means the maximum unsigned 32-bit integer value (or
|
1115
|
+
* 0xFFFFFFFF), but is clearer to write.
|
1116
|
+
*
|
1117
|
+
* \param numevents the number of events to be allocated
|
1118
|
+
* \returns the beginning event number, or (Uint32)-1 if there are not enough
|
1119
|
+
* user-defined events left.
|
1120
|
+
*
|
1121
|
+
* \since This function is available since SDL 2.0.0.
|
813
1122
|
*
|
814
|
-
*
|
815
|
-
* returns (Uint32)-1
|
1123
|
+
* \sa SDL_PushEvent
|
816
1124
|
*/
|
817
1125
|
extern DECLSPEC Uint32 SDLCALL SDL_RegisterEvents(int numevents);
|
818
1126
|
|