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
|
@@ -35,6 +35,17 @@
|
|
35
35
|
#include "SDL_atomic.h"
|
36
36
|
#include "SDL_mutex.h"
|
37
37
|
|
38
|
+
#if defined(__WIN32__)
|
39
|
+
#include <process.h> /* _beginthreadex() and _endthreadex() */
|
40
|
+
#endif
|
41
|
+
#if defined(__OS2__) /* for _beginthread() and _endthread() */
|
42
|
+
#ifndef __EMX__
|
43
|
+
#include <process.h>
|
44
|
+
#else
|
45
|
+
#include <stdlib.h>
|
46
|
+
#endif
|
47
|
+
#endif
|
48
|
+
|
38
49
|
#include "begin_code.h"
|
39
50
|
/* Set up for C function definitions, even when using C++ */
|
40
51
|
#ifdef __cplusplus
|
@@ -69,11 +80,14 @@ typedef enum {
|
|
69
80
|
} SDL_ThreadPriority;
|
70
81
|
|
71
82
|
/**
|
72
|
-
*
|
73
|
-
*
|
83
|
+
* The function passed to SDL_CreateThread().
|
84
|
+
*
|
85
|
+
* \param data what was passed as `data` to SDL_CreateThread()
|
86
|
+
* \returns a value that can be reported through SDL_WaitThread().
|
74
87
|
*/
|
75
88
|
typedef int (SDLCALL * SDL_ThreadFunction) (void *data);
|
76
89
|
|
90
|
+
|
77
91
|
#if defined(__WIN32__)
|
78
92
|
/**
|
79
93
|
* \file SDL_thread.h
|
@@ -96,7 +110,6 @@ typedef int (SDLCALL * SDL_ThreadFunction) (void *data);
|
|
96
110
|
* library!
|
97
111
|
*/
|
98
112
|
#define SDL_PASSED_BEGINTHREAD_ENDTHREAD
|
99
|
-
#include <process.h> /* _beginthreadex() and _endthreadex() */
|
100
113
|
|
101
114
|
typedef uintptr_t (__cdecl * pfnSDL_CurrentBeginThread)
|
102
115
|
(void *, unsigned, unsigned (__stdcall *func)(void *),
|
@@ -110,9 +123,6 @@ typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code);
|
|
110
123
|
#define SDL_endthread _endthreadex
|
111
124
|
#endif
|
112
125
|
|
113
|
-
/**
|
114
|
-
* Create a thread.
|
115
|
-
*/
|
116
126
|
extern DECLSPEC SDL_Thread *SDLCALL
|
117
127
|
SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data,
|
118
128
|
pfnSDL_CurrentBeginThread pfnBeginThread,
|
@@ -125,9 +135,6 @@ SDL_CreateThreadWithStackSize(int (SDLCALL * fn) (void *),
|
|
125
135
|
pfnSDL_CurrentEndThread pfnEndThread);
|
126
136
|
|
127
137
|
|
128
|
-
/**
|
129
|
-
* Create a thread.
|
130
|
-
*/
|
131
138
|
#if defined(SDL_CreateThread) && SDL_DYNAMIC_API
|
132
139
|
#undef SDL_CreateThread
|
133
140
|
#define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
|
@@ -145,12 +152,6 @@ SDL_CreateThreadWithStackSize(int (SDLCALL * fn) (void *),
|
|
145
152
|
*/
|
146
153
|
#define SDL_PASSED_BEGINTHREAD_ENDTHREAD
|
147
154
|
|
148
|
-
#ifndef __EMX__
|
149
|
-
#include <process.h>
|
150
|
-
#else
|
151
|
-
#include <stdlib.h>
|
152
|
-
#endif
|
153
|
-
|
154
155
|
typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void * /*arg*/);
|
155
156
|
typedef void (*pfnSDL_CurrentEndThread)(void);
|
156
157
|
|
@@ -183,39 +184,71 @@ SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const siz
|
|
183
184
|
#else
|
184
185
|
|
185
186
|
/**
|
186
|
-
*
|
187
|
+
* Create a new thread with a default stack size.
|
188
|
+
*
|
189
|
+
* This is equivalent to calling:
|
190
|
+
*
|
191
|
+
* ```c
|
192
|
+
* SDL_CreateThreadWithStackSize(fn, name, 0, data);
|
193
|
+
* ```
|
187
194
|
*
|
188
|
-
*
|
189
|
-
*
|
195
|
+
* \param fn the SDL_ThreadFunction function to call in the new thread
|
196
|
+
* \param name the name of the thread
|
197
|
+
* \param data a pointer that is passed to `fn`
|
198
|
+
* \returns an opaque pointer to the new thread object on success, NULL if the
|
199
|
+
* new thread could not be created; call SDL_GetError() for more
|
200
|
+
* information.
|
201
|
+
*
|
202
|
+
* \since This function is available since SDL 2.0.0.
|
203
|
+
*
|
204
|
+
* \sa SDL_CreateThreadWithStackSize
|
205
|
+
* \sa SDL_WaitThread
|
190
206
|
*/
|
191
207
|
extern DECLSPEC SDL_Thread *SDLCALL
|
192
208
|
SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data);
|
193
209
|
|
194
210
|
/**
|
195
|
-
*
|
196
|
-
*
|
197
|
-
*
|
198
|
-
*
|
199
|
-
*
|
200
|
-
*
|
201
|
-
*
|
202
|
-
*
|
203
|
-
*
|
204
|
-
*
|
205
|
-
*
|
206
|
-
*
|
207
|
-
*
|
208
|
-
*
|
209
|
-
*
|
210
|
-
*
|
211
|
-
*
|
212
|
-
*
|
213
|
-
*
|
214
|
-
*
|
215
|
-
*
|
216
|
-
*
|
217
|
-
*
|
218
|
-
*
|
211
|
+
* Create a new thread with a specific stack size.
|
212
|
+
*
|
213
|
+
* SDL makes an attempt to report `name` to the system, so that debuggers can
|
214
|
+
* display it. Not all platforms support this.
|
215
|
+
*
|
216
|
+
* Thread naming is a little complicated: Most systems have very small limits
|
217
|
+
* for the string length (Haiku has 32 bytes, Linux currently has 16, Visual
|
218
|
+
* C++ 6.0 has _nine_!), and possibly other arbitrary rules. You'll have to
|
219
|
+
* see what happens with your system's debugger. The name should be UTF-8 (but
|
220
|
+
* using the naming limits of C identifiers is a better bet). There are no
|
221
|
+
* requirements for thread naming conventions, so long as the string is
|
222
|
+
* null-terminated UTF-8, but these guidelines are helpful in choosing a name:
|
223
|
+
*
|
224
|
+
* https://stackoverflow.com/questions/149932/naming-conventions-for-threads
|
225
|
+
*
|
226
|
+
* If a system imposes requirements, SDL will try to munge the string for it
|
227
|
+
* (truncate, etc), but the original string contents will be available from
|
228
|
+
* SDL_GetThreadName().
|
229
|
+
*
|
230
|
+
* The size (in bytes) of the new stack can be specified. Zero means "use the
|
231
|
+
* system default" which might be wildly different between platforms. x86
|
232
|
+
* Linux generally defaults to eight megabytes, an embedded device might be a
|
233
|
+
* few kilobytes instead. You generally need to specify a stack that is a
|
234
|
+
* multiple of the system's page size (in many cases, this is 4 kilobytes, but
|
235
|
+
* check your system documentation).
|
236
|
+
*
|
237
|
+
* In SDL 2.1, stack size will be folded into the original SDL_CreateThread
|
238
|
+
* function, but for backwards compatibility, this is currently a separate
|
239
|
+
* function.
|
240
|
+
*
|
241
|
+
* \param fn the SDL_ThreadFunction function to call in the new thread
|
242
|
+
* \param name the name of the thread
|
243
|
+
* \param stacksize the size, in bytes, to allocate for the new thread stack.
|
244
|
+
* \param data a pointer that is passed to `fn`
|
245
|
+
* \returns an opaque pointer to the new thread object on success, NULL if the
|
246
|
+
* new thread could not be created; call SDL_GetError() for more
|
247
|
+
* information.
|
248
|
+
*
|
249
|
+
* \since This function is available since SDL 2.0.9.
|
250
|
+
*
|
251
|
+
* \sa SDL_WaitThread
|
219
252
|
*/
|
220
253
|
extern DECLSPEC SDL_Thread *SDLCALL
|
221
254
|
SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const size_t stacksize, void *data);
|
@@ -223,137 +256,202 @@ SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const siz
|
|
223
256
|
#endif
|
224
257
|
|
225
258
|
/**
|
226
|
-
* Get the thread name
|
227
|
-
*
|
228
|
-
*
|
229
|
-
*
|
230
|
-
*
|
259
|
+
* Get the thread name as it was specified in SDL_CreateThread().
|
260
|
+
*
|
261
|
+
* This is internal memory, not to be freed by the caller, and remains valid
|
262
|
+
* until the specified thread is cleaned up by SDL_WaitThread().
|
263
|
+
*
|
264
|
+
* \param thread the thread to query
|
265
|
+
* \returns a pointer to a UTF-8 string that names the specified thread, or
|
266
|
+
* NULL if it doesn't have a name.
|
267
|
+
*
|
268
|
+
* \since This function is available since SDL 2.0.0.
|
269
|
+
*
|
270
|
+
* \sa SDL_CreateThread
|
231
271
|
*/
|
232
272
|
extern DECLSPEC const char *SDLCALL SDL_GetThreadName(SDL_Thread *thread);
|
233
273
|
|
234
274
|
/**
|
235
|
-
*
|
275
|
+
* Get the thread identifier for the current thread.
|
276
|
+
*
|
277
|
+
* This thread identifier is as reported by the underlying operating system.
|
278
|
+
* If SDL is running on a platform that does not support threads the return
|
279
|
+
* value will always be zero.
|
280
|
+
*
|
281
|
+
* This function also returns a valid thread ID when called from the main
|
282
|
+
* thread.
|
283
|
+
*
|
284
|
+
* \returns the ID of the current thread.
|
285
|
+
*
|
286
|
+
* \since This function is available since SDL 2.0.0.
|
287
|
+
*
|
288
|
+
* \sa SDL_GetThreadID
|
236
289
|
*/
|
237
290
|
extern DECLSPEC SDL_threadID SDLCALL SDL_ThreadID(void);
|
238
291
|
|
239
292
|
/**
|
240
|
-
*
|
293
|
+
* Get the thread identifier for the specified thread.
|
294
|
+
*
|
295
|
+
* This thread identifier is as reported by the underlying operating system.
|
296
|
+
* If SDL is running on a platform that does not support threads the return
|
297
|
+
* value will always be zero.
|
298
|
+
*
|
299
|
+
* \param thread the thread to query
|
300
|
+
* \returns the ID of the specified thread, or the ID of the current thread if
|
301
|
+
* `thread` is NULL.
|
241
302
|
*
|
242
|
-
*
|
303
|
+
* \since This function is available since SDL 2.0.0.
|
304
|
+
*
|
305
|
+
* \sa SDL_ThreadID
|
243
306
|
*/
|
244
307
|
extern DECLSPEC SDL_threadID SDLCALL SDL_GetThreadID(SDL_Thread * thread);
|
245
308
|
|
246
309
|
/**
|
247
|
-
*
|
310
|
+
* Set the priority for the current thread.
|
311
|
+
*
|
312
|
+
* Note that some platforms will not let you alter the priority (or at least,
|
313
|
+
* promote the thread to a higher priority) at all, and some require you to be
|
314
|
+
* an administrator account. Be prepared for this to fail.
|
315
|
+
*
|
316
|
+
* \param priority the SDL_ThreadPriority to set
|
317
|
+
* \returns 0 on success or a negative error code on failure; call
|
318
|
+
* SDL_GetError() for more information.
|
319
|
+
*
|
320
|
+
* \since This function is available since SDL 2.0.0.
|
248
321
|
*/
|
249
322
|
extern DECLSPEC int SDLCALL SDL_SetThreadPriority(SDL_ThreadPriority priority);
|
250
323
|
|
251
324
|
/**
|
252
|
-
*
|
253
|
-
* remain (as a "zombie") until this function cleans them up. Not doing so
|
254
|
-
* is a resource leak.
|
325
|
+
* Wait for a thread to finish.
|
255
326
|
*
|
256
|
-
*
|
257
|
-
*
|
258
|
-
* As such, only one thread may call SDL_WaitThread() on another.
|
327
|
+
* Threads that haven't been detached will remain (as a "zombie") until this
|
328
|
+
* function cleans them up. Not doing so is a resource leak.
|
259
329
|
*
|
260
|
-
*
|
261
|
-
*
|
330
|
+
* Once a thread has been cleaned up through this function, the SDL_Thread
|
331
|
+
* that references it becomes invalid and should not be referenced again. As
|
332
|
+
* such, only one thread may call SDL_WaitThread() on another.
|
262
333
|
*
|
263
|
-
*
|
264
|
-
*
|
265
|
-
* both, or behavior is undefined.
|
334
|
+
* The return code for the thread function is placed in the area pointed to by
|
335
|
+
* `status`, if `status` is not NULL.
|
266
336
|
*
|
267
|
-
*
|
337
|
+
* You may not wait on a thread that has been used in a call to
|
338
|
+
* SDL_DetachThread(). Use either that function or this one, but not both, or
|
339
|
+
* behavior is undefined.
|
340
|
+
*
|
341
|
+
* It is safe to pass a NULL thread to this function; it is a no-op.
|
342
|
+
*
|
343
|
+
* Note that the thread pointer is freed by this function and is not valid
|
344
|
+
* afterward.
|
345
|
+
*
|
346
|
+
* \param thread the SDL_Thread pointer that was returned from the
|
347
|
+
* SDL_CreateThread() call that started this thread
|
348
|
+
* \param status pointer to an integer that will receive the value returned
|
349
|
+
* from the thread function by its 'return', or NULL to not
|
350
|
+
* receive such value back.
|
351
|
+
*
|
352
|
+
* \since This function is available since SDL 2.0.0.
|
353
|
+
*
|
354
|
+
* \sa SDL_CreateThread
|
355
|
+
* \sa SDL_DetachThread
|
268
356
|
*/
|
269
357
|
extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread * thread, int *status);
|
270
358
|
|
271
359
|
/**
|
272
|
-
*
|
273
|
-
*
|
274
|
-
*
|
275
|
-
*
|
276
|
-
*
|
277
|
-
*
|
278
|
-
*
|
279
|
-
*
|
280
|
-
*
|
281
|
-
*
|
282
|
-
*
|
283
|
-
*
|
284
|
-
*
|
285
|
-
*
|
286
|
-
*
|
287
|
-
*
|
288
|
-
*
|
289
|
-
*
|
290
|
-
*
|
291
|
-
*
|
292
|
-
*
|
293
|
-
*
|
294
|
-
*
|
295
|
-
*
|
360
|
+
* Let a thread clean up on exit without intervention.
|
361
|
+
*
|
362
|
+
* A thread may be "detached" to signify that it should not remain until
|
363
|
+
* another thread has called SDL_WaitThread() on it. Detaching a thread is
|
364
|
+
* useful for long-running threads that nothing needs to synchronize with or
|
365
|
+
* further manage. When a detached thread is done, it simply goes away.
|
366
|
+
*
|
367
|
+
* There is no way to recover the return code of a detached thread. If you
|
368
|
+
* need this, don't detach the thread and instead use SDL_WaitThread().
|
369
|
+
*
|
370
|
+
* Once a thread is detached, you should usually assume the SDL_Thread isn't
|
371
|
+
* safe to reference again, as it will become invalid immediately upon the
|
372
|
+
* detached thread's exit, instead of remaining until someone has called
|
373
|
+
* SDL_WaitThread() to finally clean it up. As such, don't detach the same
|
374
|
+
* thread more than once.
|
375
|
+
*
|
376
|
+
* If a thread has already exited when passed to SDL_DetachThread(), it will
|
377
|
+
* stop waiting for a call to SDL_WaitThread() and clean up immediately. It is
|
378
|
+
* not safe to detach a thread that might be used with SDL_WaitThread().
|
379
|
+
*
|
380
|
+
* You may not call SDL_WaitThread() on a thread that has been detached. Use
|
381
|
+
* either that function or this one, but not both, or behavior is undefined.
|
382
|
+
*
|
383
|
+
* It is safe to pass NULL to this function; it is a no-op.
|
384
|
+
*
|
385
|
+
* \param thread the SDL_Thread pointer that was returned from the
|
386
|
+
* SDL_CreateThread() call that started this thread
|
387
|
+
*
|
388
|
+
* \since This function is available since SDL 2.0.2.
|
389
|
+
*
|
390
|
+
* \sa SDL_CreateThread
|
391
|
+
* \sa SDL_WaitThread
|
296
392
|
*/
|
297
393
|
extern DECLSPEC void SDLCALL SDL_DetachThread(SDL_Thread * thread);
|
298
394
|
|
299
395
|
/**
|
300
|
-
*
|
301
|
-
*
|
302
|
-
*
|
303
|
-
*
|
304
|
-
*
|
305
|
-
*
|
306
|
-
*
|
307
|
-
*
|
308
|
-
*
|
309
|
-
*
|
310
|
-
*
|
311
|
-
* SDL_AtomicLock(&tls_lock);
|
312
|
-
* if (!thread_local_storage) {
|
313
|
-
* thread_local_storage = SDL_TLSCreate();
|
314
|
-
* }
|
315
|
-
* SDL_AtomicUnlock(&tls_lock);
|
316
|
-
* }
|
317
|
-
* SDL_TLSSet(thread_local_storage, value, 0);
|
318
|
-
* }
|
319
|
-
*
|
320
|
-
* void *GetMyThreadData(void)
|
321
|
-
* {
|
322
|
-
* return SDL_TLSGet(thread_local_storage);
|
323
|
-
* }
|
324
|
-
* \endcode
|
325
|
-
*
|
326
|
-
* \sa SDL_TLSGet()
|
327
|
-
* \sa SDL_TLSSet()
|
396
|
+
* Create a piece of thread-local storage.
|
397
|
+
*
|
398
|
+
* This creates an identifier that is globally visible to all threads but
|
399
|
+
* refers to data that is thread-specific.
|
400
|
+
*
|
401
|
+
* \returns the newly created thread local storage identifier or 0 on error.
|
402
|
+
*
|
403
|
+
* \since This function is available since SDL 2.0.0.
|
404
|
+
*
|
405
|
+
* \sa SDL_TLSGet
|
406
|
+
* \sa SDL_TLSSet
|
328
407
|
*/
|
329
408
|
extern DECLSPEC SDL_TLSID SDLCALL SDL_TLSCreate(void);
|
330
409
|
|
331
410
|
/**
|
332
|
-
*
|
411
|
+
* Get the current thread's value associated with a thread local storage ID.
|
333
412
|
*
|
334
|
-
*
|
413
|
+
* \param id the thread local storage ID
|
414
|
+
* \returns the value associated with the ID for the current thread or NULL if
|
415
|
+
* no value has been set; call SDL_GetError() for more information.
|
335
416
|
*
|
336
|
-
*
|
417
|
+
* \since This function is available since SDL 2.0.0.
|
337
418
|
*
|
338
|
-
*
|
339
|
-
*
|
419
|
+
* \sa SDL_TLSCreate
|
420
|
+
* \sa SDL_TLSSet
|
340
421
|
*/
|
341
422
|
extern DECLSPEC void * SDLCALL SDL_TLSGet(SDL_TLSID id);
|
342
423
|
|
343
424
|
/**
|
344
|
-
*
|
425
|
+
* Set the current thread's value associated with a thread local storage ID.
|
426
|
+
*
|
427
|
+
* The function prototype for `destructor` is:
|
428
|
+
*
|
429
|
+
* ```c
|
430
|
+
* void destructor(void *value)
|
431
|
+
* ```
|
345
432
|
*
|
346
|
-
*
|
347
|
-
* \param value The value to associate with the ID for the current thread
|
348
|
-
* \param destructor A function called when the thread exits, to free the value.
|
433
|
+
* where its parameter `value` is what was passed as `value` to SDL_TLSSet().
|
349
434
|
*
|
350
|
-
*
|
435
|
+
* \param id the thread local storage ID
|
436
|
+
* \param value the value to associate with the ID for the current thread
|
437
|
+
* \param destructor a function called when the thread exits, to free the
|
438
|
+
* value
|
439
|
+
* \returns 0 on success or a negative error code on failure; call
|
440
|
+
* SDL_GetError() for more information.
|
351
441
|
*
|
352
|
-
*
|
353
|
-
*
|
442
|
+
* \since This function is available since SDL 2.0.0.
|
443
|
+
*
|
444
|
+
* \sa SDL_TLSCreate
|
445
|
+
* \sa SDL_TLSGet
|
354
446
|
*/
|
355
447
|
extern DECLSPEC int SDLCALL SDL_TLSSet(SDL_TLSID id, const void *value, void (SDLCALL *destructor)(void*));
|
356
448
|
|
449
|
+
/**
|
450
|
+
* Cleanup all TLS data for this thread.
|
451
|
+
*
|
452
|
+
* \since This function is available since SDL 2.0.16.
|
453
|
+
*/
|
454
|
+
extern DECLSPEC void SDLCALL SDL_TLSCleanup(void);
|
357
455
|
|
358
456
|
/* Ends C function definitions when using C++ */
|
359
457
|
#ifdef __cplusplus
|