ruby2d 0.11.1 → 0.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
|
|
@@ -112,31 +112,108 @@ typedef enum
|
|
|
112
112
|
} SDL_YUV_CONVERSION_MODE;
|
|
113
113
|
|
|
114
114
|
/**
|
|
115
|
-
*
|
|
115
|
+
* Allocate a new RGB surface.
|
|
116
116
|
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
117
|
+
* If `depth` is 4 or 8 bits, an empty palette is allocated for the surface.
|
|
118
|
+
* If `depth` is greater than 8 bits, the pixel format is set using the
|
|
119
|
+
* [RGBA]mask parameters.
|
|
120
120
|
*
|
|
121
|
-
*
|
|
121
|
+
* The [RGBA]mask parameters are the bitmasks used to extract that color from
|
|
122
|
+
* a pixel. For instance, `Rmask` being 0xFF000000 means the red data is
|
|
123
|
+
* stored in the most significant byte. Using zeros for the RGB masks sets a
|
|
124
|
+
* default value, based on the depth. For example:
|
|
122
125
|
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
126
|
+
* ```c++
|
|
127
|
+
* SDL_CreateRGBSurface(0,w,h,32,0,0,0,0);
|
|
128
|
+
* ```
|
|
129
|
+
*
|
|
130
|
+
* However, using zero for the Amask results in an Amask of 0.
|
|
131
|
+
*
|
|
132
|
+
* By default surfaces with an alpha mask are set up for blending as with:
|
|
133
|
+
*
|
|
134
|
+
* ```c++
|
|
135
|
+
* SDL_SetSurfaceBlendMode(surface, SDL_BLENDMODE_BLEND)
|
|
136
|
+
* ```
|
|
137
|
+
*
|
|
138
|
+
* You can change this by calling SDL_SetSurfaceBlendMode() and selecting a
|
|
139
|
+
* different `blendMode`.
|
|
140
|
+
*
|
|
141
|
+
* \param flags the flags are unused and should be set to 0
|
|
142
|
+
* \param width the width of the surface
|
|
143
|
+
* \param height the height of the surface
|
|
144
|
+
* \param depth the depth of the surface in bits
|
|
145
|
+
* \param Rmask the red mask for the pixels
|
|
146
|
+
* \param Gmask the green mask for the pixels
|
|
147
|
+
* \param Bmask the blue mask for the pixels
|
|
148
|
+
* \param Amask the alpha mask for the pixels
|
|
149
|
+
* \returns the new SDL_Surface structure that is created or NULL if it fails;
|
|
150
|
+
* call SDL_GetError() for more information.
|
|
151
|
+
*
|
|
152
|
+
* \since This function is available since SDL 2.0.0.
|
|
153
|
+
*
|
|
154
|
+
* \sa SDL_CreateRGBSurfaceFrom
|
|
155
|
+
* \sa SDL_CreateRGBSurfaceWithFormat
|
|
156
|
+
* \sa SDL_FreeSurface
|
|
131
157
|
*/
|
|
132
158
|
extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurface
|
|
133
159
|
(Uint32 flags, int width, int height, int depth,
|
|
134
160
|
Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
|
|
135
161
|
|
|
162
|
+
|
|
136
163
|
/* !!! FIXME for 2.1: why does this ask for depth? Format provides that. */
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Allocate a new RGB surface with a specific pixel format.
|
|
167
|
+
*
|
|
168
|
+
* This function operates mostly like SDL_CreateRGBSurface(), except instead
|
|
169
|
+
* of providing pixel color masks, you provide it with a predefined format
|
|
170
|
+
* from SDL_PixelFormatEnum.
|
|
171
|
+
*
|
|
172
|
+
* \param flags the flags are unused and should be set to 0
|
|
173
|
+
* \param width the width of the surface
|
|
174
|
+
* \param height the height of the surface
|
|
175
|
+
* \param depth the depth of the surface in bits
|
|
176
|
+
* \param format the SDL_PixelFormatEnum for the new surface's pixel format.
|
|
177
|
+
* \returns the new SDL_Surface structure that is created or NULL if it fails;
|
|
178
|
+
* call SDL_GetError() for more information.
|
|
179
|
+
*
|
|
180
|
+
* \since This function is available since SDL 2.0.5.
|
|
181
|
+
*
|
|
182
|
+
* \sa SDL_CreateRGBSurface
|
|
183
|
+
* \sa SDL_CreateRGBSurfaceFrom
|
|
184
|
+
* \sa SDL_FreeSurface
|
|
185
|
+
*/
|
|
137
186
|
extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceWithFormat
|
|
138
187
|
(Uint32 flags, int width, int height, int depth, Uint32 format);
|
|
139
188
|
|
|
189
|
+
/**
|
|
190
|
+
* Allocate a new RGB surface with existing pixel data.
|
|
191
|
+
*
|
|
192
|
+
* This function operates mostly like SDL_CreateRGBSurface(), except it does
|
|
193
|
+
* not allocate memory for the pixel data, instead the caller provides an
|
|
194
|
+
* existing buffer of data for the surface to use.
|
|
195
|
+
*
|
|
196
|
+
* No copy is made of the pixel data. Pixel data is not managed automatically;
|
|
197
|
+
* you must free the surface before you free the pixel data.
|
|
198
|
+
*
|
|
199
|
+
* \param pixels a pointer to existing pixel data
|
|
200
|
+
* \param width the width of the surface
|
|
201
|
+
* \param height the height of the surface
|
|
202
|
+
* \param depth the depth of the surface in bits
|
|
203
|
+
* \param pitch the pitch of the surface in bytes
|
|
204
|
+
* \param Rmask the red mask for the pixels
|
|
205
|
+
* \param Gmask the green mask for the pixels
|
|
206
|
+
* \param Bmask the blue mask for the pixels
|
|
207
|
+
* \param Amask the alpha mask for the pixels
|
|
208
|
+
* \returns the new SDL_Surface structure that is created or NULL if it fails;
|
|
209
|
+
* call SDL_GetError() for more information.
|
|
210
|
+
*
|
|
211
|
+
* \since This function is available since SDL 2.0.0.
|
|
212
|
+
*
|
|
213
|
+
* \sa SDL_CreateRGBSurface
|
|
214
|
+
* \sa SDL_CreateRGBSurfaceWithFormat
|
|
215
|
+
* \sa SDL_FreeSurface
|
|
216
|
+
*/
|
|
140
217
|
extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels,
|
|
141
218
|
int width,
|
|
142
219
|
int height,
|
|
@@ -146,74 +223,154 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels,
|
|
|
146
223
|
Uint32 Gmask,
|
|
147
224
|
Uint32 Bmask,
|
|
148
225
|
Uint32 Amask);
|
|
226
|
+
|
|
227
|
+
/* !!! FIXME for 2.1: why does this ask for depth? Format provides that. */
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Allocate a new RGB surface with with a specific pixel format and existing
|
|
231
|
+
* pixel data.
|
|
232
|
+
*
|
|
233
|
+
* This function operates mostly like SDL_CreateRGBSurfaceFrom(), except
|
|
234
|
+
* instead of providing pixel color masks, you provide it with a predefined
|
|
235
|
+
* format from SDL_PixelFormatEnum.
|
|
236
|
+
*
|
|
237
|
+
* No copy is made of the pixel data. Pixel data is not managed automatically;
|
|
238
|
+
* you must free the surface before you free the pixel data.
|
|
239
|
+
*
|
|
240
|
+
* \param pixels a pointer to existing pixel data
|
|
241
|
+
* \param width the width of the surface
|
|
242
|
+
* \param height the height of the surface
|
|
243
|
+
* \param depth the depth of the surface in bits
|
|
244
|
+
* \param pitch the pitch of the surface in bytes
|
|
245
|
+
* \param format the SDL_PixelFormatEnum for the new surface's pixel format.
|
|
246
|
+
* \returns the new SDL_Surface structure that is created or NULL if it fails;
|
|
247
|
+
* call SDL_GetError() for more information.
|
|
248
|
+
*
|
|
249
|
+
* \since This function is available since SDL 2.0.5.
|
|
250
|
+
*
|
|
251
|
+
* \sa SDL_CreateRGBSurfaceFrom
|
|
252
|
+
* \sa SDL_CreateRGBSurfaceWithFormat
|
|
253
|
+
* \sa SDL_FreeSurface
|
|
254
|
+
*/
|
|
149
255
|
extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceWithFormatFrom
|
|
150
256
|
(void *pixels, int width, int height, int depth, int pitch, Uint32 format);
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Free an RGB surface.
|
|
260
|
+
*
|
|
261
|
+
* It is safe to pass NULL to this function.
|
|
262
|
+
*
|
|
263
|
+
* \param surface the SDL_Surface to free.
|
|
264
|
+
*
|
|
265
|
+
* \since This function is available since SDL 2.0.0.
|
|
266
|
+
*
|
|
267
|
+
* \sa SDL_CreateRGBSurface
|
|
268
|
+
* \sa SDL_CreateRGBSurfaceFrom
|
|
269
|
+
* \sa SDL_LoadBMP
|
|
270
|
+
* \sa SDL_LoadBMP_RW
|
|
271
|
+
*/
|
|
151
272
|
extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface * surface);
|
|
152
273
|
|
|
153
274
|
/**
|
|
154
|
-
*
|
|
275
|
+
* Set the palette used by a surface.
|
|
276
|
+
*
|
|
277
|
+
* A single palette can be shared with many surfaces.
|
|
155
278
|
*
|
|
156
|
-
*
|
|
279
|
+
* \param surface the SDL_Surface structure to update
|
|
280
|
+
* \param palette the SDL_Palette structure to use
|
|
281
|
+
* \returns 0 on success or a negative error code on failure; call
|
|
282
|
+
* SDL_GetError() for more information.
|
|
157
283
|
*
|
|
158
|
-
*
|
|
284
|
+
* \since This function is available since SDL 2.0.0.
|
|
159
285
|
*/
|
|
160
286
|
extern DECLSPEC int SDLCALL SDL_SetSurfacePalette(SDL_Surface * surface,
|
|
161
287
|
SDL_Palette * palette);
|
|
162
288
|
|
|
163
289
|
/**
|
|
164
|
-
*
|
|
290
|
+
* Set up a surface for directly accessing the pixels.
|
|
165
291
|
*
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
292
|
+
* Between calls to SDL_LockSurface() / SDL_UnlockSurface(), you can write to
|
|
293
|
+
* and read from `surface->pixels`, using the pixel format stored in
|
|
294
|
+
* `surface->format`. Once you are done accessing the surface, you should use
|
|
295
|
+
* SDL_UnlockSurface() to release it.
|
|
170
296
|
*
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
*
|
|
297
|
+
* Not all surfaces require locking. If `SDL_MUSTLOCK(surface)` evaluates to
|
|
298
|
+
* 0, then you can read and write to the surface at any time, and the pixel
|
|
299
|
+
* format of the surface will not change.
|
|
174
300
|
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
301
|
+
* \param surface the SDL_Surface structure to be locked
|
|
302
|
+
* \returns 0 on success or a negative error code on failure; call
|
|
303
|
+
* SDL_GetError() for more information.
|
|
177
304
|
*
|
|
178
|
-
*
|
|
305
|
+
* \since This function is available since SDL 2.0.0.
|
|
179
306
|
*
|
|
180
|
-
*
|
|
307
|
+
* \sa SDL_MUSTLOCK
|
|
308
|
+
* \sa SDL_UnlockSurface
|
|
181
309
|
*/
|
|
182
310
|
extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface * surface);
|
|
183
|
-
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Release a surface after directly accessing the pixels.
|
|
314
|
+
*
|
|
315
|
+
* \param surface the SDL_Surface structure to be unlocked
|
|
316
|
+
*
|
|
317
|
+
* \since This function is available since SDL 2.0.0.
|
|
318
|
+
*
|
|
319
|
+
* \sa SDL_LockSurface
|
|
320
|
+
*/
|
|
184
321
|
extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface * surface);
|
|
185
322
|
|
|
186
323
|
/**
|
|
187
|
-
*
|
|
324
|
+
* Load a BMP image from a seekable SDL data stream.
|
|
188
325
|
*
|
|
189
|
-
*
|
|
326
|
+
* The new surface should be freed with SDL_FreeSurface(). Not doing so will
|
|
327
|
+
* result in a memory leak.
|
|
190
328
|
*
|
|
191
|
-
*
|
|
329
|
+
* src is an open SDL_RWops buffer, typically loaded with SDL_RWFromFile.
|
|
330
|
+
* Alternitavely, you might also use the macro SDL_LoadBMP to load a bitmap
|
|
331
|
+
* from a file, convert it to an SDL_Surface and then close the file.
|
|
192
332
|
*
|
|
193
|
-
*
|
|
333
|
+
* \param src the data stream for the surface
|
|
334
|
+
* \param freesrc non-zero to close the stream after being read
|
|
335
|
+
* \returns a pointer to a new SDL_Surface structure or NULL if there was an
|
|
336
|
+
* error; call SDL_GetError() for more information.
|
|
337
|
+
*
|
|
338
|
+
* \since This function is available since SDL 2.0.0.
|
|
339
|
+
*
|
|
340
|
+
* \sa SDL_FreeSurface
|
|
341
|
+
* \sa SDL_RWFromFile
|
|
342
|
+
* \sa SDL_LoadBMP
|
|
343
|
+
* \sa SDL_SaveBMP_RW
|
|
194
344
|
*/
|
|
195
345
|
extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_RW(SDL_RWops * src,
|
|
196
346
|
int freesrc);
|
|
197
347
|
|
|
198
348
|
/**
|
|
199
|
-
*
|
|
349
|
+
* Load a surface from a file.
|
|
200
350
|
*
|
|
201
|
-
*
|
|
351
|
+
* Convenience macro.
|
|
202
352
|
*/
|
|
203
353
|
#define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1)
|
|
204
354
|
|
|
205
355
|
/**
|
|
206
|
-
*
|
|
356
|
+
* Save a surface to a seekable SDL data stream in BMP format.
|
|
357
|
+
*
|
|
358
|
+
* Surfaces with a 24-bit, 32-bit and paletted 8-bit format get saved in the
|
|
359
|
+
* BMP directly. Other RGB formats with 8-bit or higher get converted to a
|
|
360
|
+
* 24-bit surface or, if they have an alpha mask or a colorkey, to a 32-bit
|
|
361
|
+
* surface before they are saved. YUV and paletted 1-bit and 4-bit formats are
|
|
362
|
+
* not supported.
|
|
207
363
|
*
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
*
|
|
364
|
+
* \param surface the SDL_Surface structure containing the image to be saved
|
|
365
|
+
* \param dst a data stream to save to
|
|
366
|
+
* \param freedst non-zero to close the stream after being written
|
|
367
|
+
* \returns 0 on success or a negative error code on failure; call
|
|
368
|
+
* SDL_GetError() for more information.
|
|
213
369
|
*
|
|
214
|
-
*
|
|
370
|
+
* \since This function is available since SDL 2.0.0.
|
|
215
371
|
*
|
|
216
|
-
*
|
|
372
|
+
* \sa SDL_LoadBMP_RW
|
|
373
|
+
* \sa SDL_SaveBMP
|
|
217
374
|
*/
|
|
218
375
|
extern DECLSPEC int SDLCALL SDL_SaveBMP_RW
|
|
219
376
|
(SDL_Surface * surface, SDL_RWops * dst, int freedst);
|
|
@@ -227,190 +384,335 @@ extern DECLSPEC int SDLCALL SDL_SaveBMP_RW
|
|
|
227
384
|
SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1)
|
|
228
385
|
|
|
229
386
|
/**
|
|
230
|
-
*
|
|
387
|
+
* Set the RLE acceleration hint for a surface.
|
|
231
388
|
*
|
|
232
|
-
*
|
|
389
|
+
* If RLE is enabled, color key and alpha blending blits are much faster, but
|
|
390
|
+
* the surface must be locked before directly accessing the pixels.
|
|
233
391
|
*
|
|
234
|
-
*
|
|
235
|
-
*
|
|
392
|
+
* \param surface the SDL_Surface structure to optimize
|
|
393
|
+
* \param flag 0 to disable, non-zero to enable RLE acceleration
|
|
394
|
+
* \returns 0 on success or a negative error code on failure; call
|
|
395
|
+
* SDL_GetError() for more information.
|
|
396
|
+
*
|
|
397
|
+
* \since This function is available since SDL 2.0.0.
|
|
398
|
+
*
|
|
399
|
+
* \sa SDL_BlitSurface
|
|
400
|
+
* \sa SDL_LockSurface
|
|
401
|
+
* \sa SDL_UnlockSurface
|
|
236
402
|
*/
|
|
237
403
|
extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface * surface,
|
|
238
404
|
int flag);
|
|
239
405
|
|
|
240
406
|
/**
|
|
241
|
-
*
|
|
407
|
+
* Returns whether the surface is RLE enabled
|
|
408
|
+
*
|
|
409
|
+
* It is safe to pass a NULL `surface` here; it will return SDL_FALSE.
|
|
410
|
+
*
|
|
411
|
+
* \param surface the SDL_Surface structure to query
|
|
412
|
+
* \returns SDL_TRUE if the surface is RLE enabled, SDL_FALSE otherwise.
|
|
242
413
|
*
|
|
243
|
-
*
|
|
414
|
+
* \since This function is available since SDL 2.0.14.
|
|
415
|
+
*
|
|
416
|
+
* \sa SDL_SetSurfaceRLE
|
|
244
417
|
*/
|
|
245
418
|
extern DECLSPEC SDL_bool SDLCALL SDL_HasSurfaceRLE(SDL_Surface * surface);
|
|
246
419
|
|
|
247
420
|
/**
|
|
248
|
-
*
|
|
421
|
+
* Set the color key (transparent pixel) in a surface.
|
|
422
|
+
*
|
|
423
|
+
* The color key defines a pixel value that will be treated as transparent in
|
|
424
|
+
* a blit. For example, one can use this to specify that cyan pixels should be
|
|
425
|
+
* considered transparent, and therefore not rendered.
|
|
426
|
+
*
|
|
427
|
+
* It is a pixel of the format used by the surface, as generated by
|
|
428
|
+
* SDL_MapRGB().
|
|
429
|
+
*
|
|
430
|
+
* RLE acceleration can substantially speed up blitting of images with large
|
|
431
|
+
* horizontal runs of transparent pixels. See SDL_SetSurfaceRLE() for details.
|
|
249
432
|
*
|
|
250
|
-
*
|
|
251
|
-
*
|
|
252
|
-
*
|
|
433
|
+
* \param surface the SDL_Surface structure to update
|
|
434
|
+
* \param flag SDL_TRUE to enable color key, SDL_FALSE to disable color key
|
|
435
|
+
* \param key the transparent pixel
|
|
436
|
+
* \returns 0 on success or a negative error code on failure; call
|
|
437
|
+
* SDL_GetError() for more information.
|
|
253
438
|
*
|
|
254
|
-
*
|
|
439
|
+
* \since This function is available since SDL 2.0.0.
|
|
255
440
|
*
|
|
256
|
-
*
|
|
441
|
+
* \sa SDL_BlitSurface
|
|
442
|
+
* \sa SDL_GetColorKey
|
|
257
443
|
*/
|
|
258
444
|
extern DECLSPEC int SDLCALL SDL_SetColorKey(SDL_Surface * surface,
|
|
259
445
|
int flag, Uint32 key);
|
|
260
446
|
|
|
261
447
|
/**
|
|
262
|
-
*
|
|
448
|
+
* Returns whether the surface has a color key
|
|
263
449
|
*
|
|
264
|
-
*
|
|
450
|
+
* It is safe to pass a NULL `surface` here; it will return SDL_FALSE.
|
|
451
|
+
*
|
|
452
|
+
* \param surface the SDL_Surface structure to query
|
|
453
|
+
* \return SDL_TRUE if the surface has a color key, SDL_FALSE otherwise.
|
|
454
|
+
*
|
|
455
|
+
* \since This function is available since SDL 2.0.9.
|
|
456
|
+
*
|
|
457
|
+
* \sa SDL_SetColorKey
|
|
458
|
+
* \sa SDL_GetColorKey
|
|
265
459
|
*/
|
|
266
460
|
extern DECLSPEC SDL_bool SDLCALL SDL_HasColorKey(SDL_Surface * surface);
|
|
267
461
|
|
|
268
462
|
/**
|
|
269
|
-
*
|
|
463
|
+
* Get the color key (transparent pixel) for a surface.
|
|
464
|
+
*
|
|
465
|
+
* The color key is a pixel of the format used by the surface, as generated by
|
|
466
|
+
* SDL_MapRGB().
|
|
270
467
|
*
|
|
271
|
-
*
|
|
272
|
-
* \param key A pointer filled in with the transparent pixel in the native
|
|
273
|
-
* surface format
|
|
468
|
+
* If the surface doesn't have color key enabled this function returns -1.
|
|
274
469
|
*
|
|
275
|
-
*
|
|
276
|
-
*
|
|
470
|
+
* \param surface the SDL_Surface structure to query
|
|
471
|
+
* \param key a pointer filled in with the transparent pixel
|
|
472
|
+
* \returns 0 on success or a negative error code on failure; call
|
|
473
|
+
* SDL_GetError() for more information.
|
|
474
|
+
*
|
|
475
|
+
* \since This function is available since SDL 2.0.0.
|
|
476
|
+
*
|
|
477
|
+
* \sa SDL_BlitSurface
|
|
478
|
+
* \sa SDL_SetColorKey
|
|
277
479
|
*/
|
|
278
480
|
extern DECLSPEC int SDLCALL SDL_GetColorKey(SDL_Surface * surface,
|
|
279
481
|
Uint32 * key);
|
|
280
482
|
|
|
281
483
|
/**
|
|
282
|
-
*
|
|
484
|
+
* Set an additional color value multiplied into blit operations.
|
|
485
|
+
*
|
|
486
|
+
* When this surface is blitted, during the blit operation each source color
|
|
487
|
+
* channel is modulated by the appropriate color value according to the
|
|
488
|
+
* following formula:
|
|
489
|
+
*
|
|
490
|
+
* `srcC = srcC * (color / 255)`
|
|
283
491
|
*
|
|
284
|
-
*
|
|
285
|
-
*
|
|
286
|
-
*
|
|
287
|
-
*
|
|
492
|
+
* \param surface the SDL_Surface structure to update
|
|
493
|
+
* \param r the red color value multiplied into blit operations
|
|
494
|
+
* \param g the green color value multiplied into blit operations
|
|
495
|
+
* \param b the blue color value multiplied into blit operations
|
|
496
|
+
* \returns 0 on success or a negative error code on failure; call
|
|
497
|
+
* SDL_GetError() for more information.
|
|
288
498
|
*
|
|
289
|
-
*
|
|
499
|
+
* \since This function is available since SDL 2.0.0.
|
|
290
500
|
*
|
|
291
|
-
*
|
|
501
|
+
* \sa SDL_GetSurfaceColorMod
|
|
502
|
+
* \sa SDL_SetSurfaceAlphaMod
|
|
292
503
|
*/
|
|
293
504
|
extern DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface * surface,
|
|
294
505
|
Uint8 r, Uint8 g, Uint8 b);
|
|
295
506
|
|
|
296
507
|
|
|
297
508
|
/**
|
|
298
|
-
*
|
|
509
|
+
* Get the additional color value multiplied into blit operations.
|
|
299
510
|
*
|
|
300
|
-
*
|
|
301
|
-
*
|
|
302
|
-
*
|
|
303
|
-
*
|
|
511
|
+
* \param surface the SDL_Surface structure to query
|
|
512
|
+
* \param r a pointer filled in with the current red color value
|
|
513
|
+
* \param g a pointer filled in with the current green color value
|
|
514
|
+
* \param b a pointer filled in with the current blue color value
|
|
515
|
+
* \returns 0 on success or a negative error code on failure; call
|
|
516
|
+
* SDL_GetError() for more information.
|
|
304
517
|
*
|
|
305
|
-
*
|
|
518
|
+
* \since This function is available since SDL 2.0.0.
|
|
306
519
|
*
|
|
307
|
-
*
|
|
520
|
+
* \sa SDL_GetSurfaceAlphaMod
|
|
521
|
+
* \sa SDL_SetSurfaceColorMod
|
|
308
522
|
*/
|
|
309
523
|
extern DECLSPEC int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface * surface,
|
|
310
524
|
Uint8 * r, Uint8 * g,
|
|
311
525
|
Uint8 * b);
|
|
312
526
|
|
|
313
527
|
/**
|
|
314
|
-
*
|
|
528
|
+
* Set an additional alpha value used in blit operations.
|
|
315
529
|
*
|
|
316
|
-
*
|
|
317
|
-
*
|
|
530
|
+
* When this surface is blitted, during the blit operation the source alpha
|
|
531
|
+
* value is modulated by this alpha value according to the following formula:
|
|
318
532
|
*
|
|
319
|
-
*
|
|
533
|
+
* `srcA = srcA * (alpha / 255)`
|
|
320
534
|
*
|
|
321
|
-
*
|
|
535
|
+
* \param surface the SDL_Surface structure to update
|
|
536
|
+
* \param alpha the alpha value multiplied into blit operations
|
|
537
|
+
* \returns 0 on success or a negative error code on failure; call
|
|
538
|
+
* SDL_GetError() for more information.
|
|
539
|
+
*
|
|
540
|
+
* \since This function is available since SDL 2.0.0.
|
|
541
|
+
*
|
|
542
|
+
* \sa SDL_GetSurfaceAlphaMod
|
|
543
|
+
* \sa SDL_SetSurfaceColorMod
|
|
322
544
|
*/
|
|
323
545
|
extern DECLSPEC int SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface * surface,
|
|
324
546
|
Uint8 alpha);
|
|
325
547
|
|
|
326
548
|
/**
|
|
327
|
-
*
|
|
549
|
+
* Get the additional alpha value used in blit operations.
|
|
328
550
|
*
|
|
329
|
-
*
|
|
330
|
-
*
|
|
551
|
+
* \param surface the SDL_Surface structure to query
|
|
552
|
+
* \param alpha a pointer filled in with the current alpha value
|
|
553
|
+
* \returns 0 on success or a negative error code on failure; call
|
|
554
|
+
* SDL_GetError() for more information.
|
|
331
555
|
*
|
|
332
|
-
*
|
|
556
|
+
* \since This function is available since SDL 2.0.0.
|
|
333
557
|
*
|
|
334
|
-
*
|
|
558
|
+
* \sa SDL_GetSurfaceColorMod
|
|
559
|
+
* \sa SDL_SetSurfaceAlphaMod
|
|
335
560
|
*/
|
|
336
561
|
extern DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface * surface,
|
|
337
562
|
Uint8 * alpha);
|
|
338
563
|
|
|
339
564
|
/**
|
|
340
|
-
*
|
|
565
|
+
* Set the blend mode used for blit operations.
|
|
566
|
+
*
|
|
567
|
+
* To copy a surface to another surface (or texture) without blending with the
|
|
568
|
+
* existing data, the blendmode of the SOURCE surface should be set to
|
|
569
|
+
* `SDL_BLENDMODE_NONE`.
|
|
341
570
|
*
|
|
342
|
-
*
|
|
343
|
-
*
|
|
571
|
+
* \param surface the SDL_Surface structure to update
|
|
572
|
+
* \param blendMode the SDL_BlendMode to use for blit blending
|
|
573
|
+
* \returns 0 on success or a negative error code on failure; call
|
|
574
|
+
* SDL_GetError() for more information.
|
|
344
575
|
*
|
|
345
|
-
*
|
|
576
|
+
* \since This function is available since SDL 2.0.0.
|
|
346
577
|
*
|
|
347
|
-
*
|
|
578
|
+
* \sa SDL_GetSurfaceBlendMode
|
|
348
579
|
*/
|
|
349
580
|
extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface * surface,
|
|
350
581
|
SDL_BlendMode blendMode);
|
|
351
582
|
|
|
352
583
|
/**
|
|
353
|
-
*
|
|
584
|
+
* Get the blend mode used for blit operations.
|
|
354
585
|
*
|
|
355
|
-
*
|
|
356
|
-
*
|
|
586
|
+
* \param surface the SDL_Surface structure to query
|
|
587
|
+
* \param blendMode a pointer filled in with the current SDL_BlendMode
|
|
588
|
+
* \returns 0 on success or a negative error code on failure; call
|
|
589
|
+
* SDL_GetError() for more information.
|
|
357
590
|
*
|
|
358
|
-
*
|
|
591
|
+
* \since This function is available since SDL 2.0.0.
|
|
359
592
|
*
|
|
360
|
-
*
|
|
593
|
+
* \sa SDL_SetSurfaceBlendMode
|
|
361
594
|
*/
|
|
362
595
|
extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface * surface,
|
|
363
596
|
SDL_BlendMode *blendMode);
|
|
364
597
|
|
|
365
598
|
/**
|
|
366
|
-
*
|
|
599
|
+
* Set the clipping rectangle for a surface.
|
|
600
|
+
*
|
|
601
|
+
* When `surface` is the destination of a blit, only the area within the clip
|
|
602
|
+
* rectangle is drawn into.
|
|
603
|
+
*
|
|
604
|
+
* Note that blits are automatically clipped to the edges of the source and
|
|
605
|
+
* destination surfaces.
|
|
367
606
|
*
|
|
368
|
-
*
|
|
607
|
+
* \param surface the SDL_Surface structure to be clipped
|
|
608
|
+
* \param rect the SDL_Rect structure representing the clipping rectangle, or
|
|
609
|
+
* NULL to disable clipping
|
|
610
|
+
* \returns SDL_TRUE if the rectangle intersects the surface, otherwise
|
|
611
|
+
* SDL_FALSE and blits will be completely clipped.
|
|
369
612
|
*
|
|
370
|
-
*
|
|
371
|
-
* return SDL_FALSE and blits will be completely clipped. Otherwise the
|
|
372
|
-
* function returns SDL_TRUE and blits to the surface will be clipped to
|
|
373
|
-
* the intersection of the surface area and the clipping rectangle.
|
|
613
|
+
* \since This function is available since SDL 2.0.0.
|
|
374
614
|
*
|
|
375
|
-
*
|
|
376
|
-
*
|
|
615
|
+
* \sa SDL_BlitSurface
|
|
616
|
+
* \sa SDL_GetClipRect
|
|
377
617
|
*/
|
|
378
618
|
extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface * surface,
|
|
379
619
|
const SDL_Rect * rect);
|
|
380
620
|
|
|
381
621
|
/**
|
|
382
|
-
*
|
|
622
|
+
* Get the clipping rectangle for a surface.
|
|
383
623
|
*
|
|
384
|
-
*
|
|
385
|
-
*
|
|
624
|
+
* When `surface` is the destination of a blit, only the area within the clip
|
|
625
|
+
* rectangle is drawn into.
|
|
626
|
+
*
|
|
627
|
+
* \param surface the SDL_Surface structure representing the surface to be
|
|
628
|
+
* clipped
|
|
629
|
+
* \param rect an SDL_Rect structure filled in with the clipping rectangle for
|
|
630
|
+
* the surface
|
|
631
|
+
*
|
|
632
|
+
* \since This function is available since SDL 2.0.0.
|
|
633
|
+
*
|
|
634
|
+
* \sa SDL_BlitSurface
|
|
635
|
+
* \sa SDL_SetClipRect
|
|
386
636
|
*/
|
|
387
637
|
extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface * surface,
|
|
388
638
|
SDL_Rect * rect);
|
|
389
639
|
|
|
390
640
|
/*
|
|
391
|
-
* Creates a new surface identical to the existing surface
|
|
641
|
+
* Creates a new surface identical to the existing surface.
|
|
642
|
+
*
|
|
643
|
+
* The returned surface should be freed with SDL_FreeSurface().
|
|
644
|
+
*
|
|
645
|
+
* \param surface the surface to duplicate.
|
|
646
|
+
* \returns a copy of the surface, or NULL on failure; call SDL_GetError() for
|
|
647
|
+
* more information.
|
|
392
648
|
*/
|
|
393
649
|
extern DECLSPEC SDL_Surface *SDLCALL SDL_DuplicateSurface(SDL_Surface * surface);
|
|
394
650
|
|
|
395
651
|
/**
|
|
396
|
-
*
|
|
397
|
-
*
|
|
398
|
-
*
|
|
652
|
+
* Copy an existing surface to a new surface of the specified format.
|
|
653
|
+
*
|
|
654
|
+
* This function is used to optimize images for faster *repeat* blitting. This
|
|
655
|
+
* is accomplished by converting the original and storing the result as a new
|
|
656
|
+
* surface. The new, optimized surface can then be used as the source for
|
|
657
|
+
* future blits, making them faster.
|
|
658
|
+
*
|
|
659
|
+
* \param src the existing SDL_Surface structure to convert
|
|
660
|
+
* \param fmt the SDL_PixelFormat structure that the new surface is optimized
|
|
661
|
+
* for
|
|
662
|
+
* \param flags the flags are unused and should be set to 0; this is a
|
|
663
|
+
* leftover from SDL 1.2's API
|
|
664
|
+
* \returns the new SDL_Surface structure that is created or NULL if it fails;
|
|
665
|
+
* call SDL_GetError() for more information.
|
|
666
|
+
*
|
|
667
|
+
* \since This function is available since SDL 2.0.0.
|
|
399
668
|
*
|
|
400
|
-
*
|
|
401
|
-
*
|
|
402
|
-
*
|
|
403
|
-
* surface.
|
|
669
|
+
* \sa SDL_AllocFormat
|
|
670
|
+
* \sa SDL_ConvertSurfaceFormat
|
|
671
|
+
* \sa SDL_CreateRGBSurface
|
|
404
672
|
*/
|
|
405
673
|
extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface
|
|
406
674
|
(SDL_Surface * src, const SDL_PixelFormat * fmt, Uint32 flags);
|
|
675
|
+
|
|
676
|
+
/**
|
|
677
|
+
* Copy an existing surface to a new surface of the specified format enum.
|
|
678
|
+
*
|
|
679
|
+
* This function operates just like SDL_ConvertSurface(), but accepts an
|
|
680
|
+
* SDL_PixelFormatEnum value instead of an SDL_PixelFormat structure. As such,
|
|
681
|
+
* it might be easier to call but it doesn't have access to palette
|
|
682
|
+
* information for the destination surface, in case that would be important.
|
|
683
|
+
*
|
|
684
|
+
* \param src the existing SDL_Surface structure to convert
|
|
685
|
+
* \param pixel_format the SDL_PixelFormatEnum that the new surface is
|
|
686
|
+
* optimized for
|
|
687
|
+
* \param flags the flags are unused and should be set to 0; this is a
|
|
688
|
+
* leftover from SDL 1.2's API
|
|
689
|
+
* \returns the new SDL_Surface structure that is created or NULL if it fails;
|
|
690
|
+
* call SDL_GetError() for more information.
|
|
691
|
+
*
|
|
692
|
+
* \since This function is available since SDL 2.0.0.
|
|
693
|
+
*
|
|
694
|
+
* \sa SDL_AllocFormat
|
|
695
|
+
* \sa SDL_ConvertSurface
|
|
696
|
+
* \sa SDL_CreateRGBSurface
|
|
697
|
+
*/
|
|
407
698
|
extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormat
|
|
408
699
|
(SDL_Surface * src, Uint32 pixel_format, Uint32 flags);
|
|
409
700
|
|
|
410
701
|
/**
|
|
411
|
-
*
|
|
702
|
+
* Copy a block of pixels of one format to another format.
|
|
703
|
+
*
|
|
704
|
+
* \param width the width of the block to copy, in pixels
|
|
705
|
+
* \param height the height of the block to copy, in pixels
|
|
706
|
+
* \param src_format an SDL_PixelFormatEnum value of the `src` pixels format
|
|
707
|
+
* \param src a pointer to the source pixels
|
|
708
|
+
* \param src_pitch the pitch of the source pixels, in bytes
|
|
709
|
+
* \param dst_format an SDL_PixelFormatEnum value of the `dst` pixels format
|
|
710
|
+
* \param dst a pointer to be filled in with new pixel data
|
|
711
|
+
* \param dst_pitch the pitch of the destination pixels, in bytes
|
|
712
|
+
* \returns 0 on success or a negative error code on failure; call
|
|
713
|
+
* SDL_GetError() for more information.
|
|
412
714
|
*
|
|
413
|
-
*
|
|
715
|
+
* \since This function is available since SDL 2.0.0.
|
|
414
716
|
*/
|
|
415
717
|
extern DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height,
|
|
416
718
|
Uint32 src_format,
|
|
@@ -419,20 +721,84 @@ extern DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height,
|
|
|
419
721
|
void * dst, int dst_pitch);
|
|
420
722
|
|
|
421
723
|
/**
|
|
422
|
-
*
|
|
724
|
+
* Premultiply the alpha on a block of pixels.
|
|
725
|
+
*
|
|
726
|
+
* This is safe to use with src == dst, but not for other overlapping areas.
|
|
727
|
+
*
|
|
728
|
+
* This function is currently only implemented for SDL_PIXELFORMAT_ARGB8888.
|
|
729
|
+
*
|
|
730
|
+
* \param width the width of the block to convert, in pixels
|
|
731
|
+
* \param height the height of the block to convert, in pixels
|
|
732
|
+
* \param src_format an SDL_PixelFormatEnum value of the `src` pixels format
|
|
733
|
+
* \param src a pointer to the source pixels
|
|
734
|
+
* \param src_pitch the pitch of the source pixels, in bytes
|
|
735
|
+
* \param dst_format an SDL_PixelFormatEnum value of the `dst` pixels format
|
|
736
|
+
* \param dst a pointer to be filled in with premultiplied pixel data
|
|
737
|
+
* \param dst_pitch the pitch of the destination pixels, in bytes
|
|
738
|
+
* \returns 0 on success or a negative error code on failure; call
|
|
739
|
+
* SDL_GetError() for more information.
|
|
740
|
+
*
|
|
741
|
+
* \since This function is available since SDL 2.0.18.
|
|
742
|
+
*/
|
|
743
|
+
extern DECLSPEC int SDLCALL SDL_PremultiplyAlpha(int width, int height,
|
|
744
|
+
Uint32 src_format,
|
|
745
|
+
const void * src, int src_pitch,
|
|
746
|
+
Uint32 dst_format,
|
|
747
|
+
void * dst, int dst_pitch);
|
|
748
|
+
|
|
749
|
+
/**
|
|
750
|
+
* Perform a fast fill of a rectangle with a specific color.
|
|
751
|
+
*
|
|
752
|
+
* `color` should be a pixel of the format used by the surface, and can be
|
|
753
|
+
* generated by SDL_MapRGB() or SDL_MapRGBA(). If the color value contains an
|
|
754
|
+
* alpha component then the destination is simply filled with that alpha
|
|
755
|
+
* information, no blending takes place.
|
|
423
756
|
*
|
|
424
|
-
*
|
|
757
|
+
* If there is a clip rectangle set on the destination (set via
|
|
758
|
+
* SDL_SetClipRect()), then this function will fill based on the intersection
|
|
759
|
+
* of the clip rectangle and `rect`.
|
|
425
760
|
*
|
|
426
|
-
*
|
|
427
|
-
*
|
|
761
|
+
* \param dst the SDL_Surface structure that is the drawing target
|
|
762
|
+
* \param rect the SDL_Rect structure representing the rectangle to fill, or
|
|
763
|
+
* NULL to fill the entire surface
|
|
764
|
+
* \param color the color to fill with
|
|
765
|
+
* \returns 0 on success or a negative error code on failure; call
|
|
766
|
+
* SDL_GetError() for more information.
|
|
428
767
|
*
|
|
429
|
-
*
|
|
768
|
+
* \since This function is available since SDL 2.0.0.
|
|
769
|
+
*
|
|
770
|
+
* \sa SDL_FillRects
|
|
430
771
|
*/
|
|
431
772
|
extern DECLSPEC int SDLCALL SDL_FillRect
|
|
432
773
|
(SDL_Surface * dst, const SDL_Rect * rect, Uint32 color);
|
|
774
|
+
|
|
775
|
+
/**
|
|
776
|
+
* Perform a fast fill of a set of rectangles with a specific color.
|
|
777
|
+
*
|
|
778
|
+
* `color` should be a pixel of the format used by the surface, and can be
|
|
779
|
+
* generated by SDL_MapRGB() or SDL_MapRGBA(). If the color value contains an
|
|
780
|
+
* alpha component then the destination is simply filled with that alpha
|
|
781
|
+
* information, no blending takes place.
|
|
782
|
+
*
|
|
783
|
+
* If there is a clip rectangle set on the destination (set via
|
|
784
|
+
* SDL_SetClipRect()), then this function will fill based on the intersection
|
|
785
|
+
* of the clip rectangle and `rect`.
|
|
786
|
+
*
|
|
787
|
+
* \param dst the SDL_Surface structure that is the drawing target
|
|
788
|
+
* \param rects an array of SDL_Rects representing the rectangles to fill.
|
|
789
|
+
* \param count the number of rectangles in the array
|
|
790
|
+
* \param color the color to fill with
|
|
791
|
+
* \returns 0 on success or a negative error code on failure; call
|
|
792
|
+
* SDL_GetError() for more information.
|
|
793
|
+
*
|
|
794
|
+
* \since This function is available since SDL 2.0.0.
|
|
795
|
+
*
|
|
796
|
+
* \sa SDL_FillRect
|
|
797
|
+
*/
|
|
433
798
|
extern DECLSPEC int SDLCALL SDL_FillRects
|
|
434
799
|
(SDL_Surface * dst, const SDL_Rect * rects, int count, Uint32 color);
|
|
435
800
|
|
|
801
|
+
/* !!! FIXME: merge this documentation with the wiki */
|
|
436
802
|
/**
|
|
437
803
|
* Performs a fast blit from the source surface to the destination surface.
|
|
438
804
|
*
|
|
@@ -441,7 +807,7 @@ extern DECLSPEC int SDLCALL SDL_FillRects
|
|
|
441
807
|
* surface (\c src or \c dst) is copied. The final blit rectangles are saved
|
|
442
808
|
* in \c srcrect and \c dstrect after all clipping is performed.
|
|
443
809
|
*
|
|
444
|
-
* \
|
|
810
|
+
* \returns 0 if the blit is successful, otherwise it returns -1.
|
|
445
811
|
*
|
|
446
812
|
* The blit function should not be called on a locked surface.
|
|
447
813
|
*
|
|
@@ -493,62 +859,128 @@ extern DECLSPEC int SDLCALL SDL_FillRects
|
|
|
493
859
|
#define SDL_BlitSurface SDL_UpperBlit
|
|
494
860
|
|
|
495
861
|
/**
|
|
496
|
-
*
|
|
497
|
-
*
|
|
862
|
+
* Perform a fast blit from the source surface to the destination surface.
|
|
863
|
+
*
|
|
864
|
+
* SDL_UpperBlit() has been replaced by SDL_BlitSurface(), which is merely a
|
|
865
|
+
* macro for this function with a less confusing name.
|
|
866
|
+
*
|
|
867
|
+
* \since This function is available since SDL 2.0.0.
|
|
868
|
+
*
|
|
869
|
+
* \sa SDL_BlitSurface
|
|
498
870
|
*/
|
|
499
871
|
extern DECLSPEC int SDLCALL SDL_UpperBlit
|
|
500
872
|
(SDL_Surface * src, const SDL_Rect * srcrect,
|
|
501
873
|
SDL_Surface * dst, SDL_Rect * dstrect);
|
|
502
874
|
|
|
503
875
|
/**
|
|
504
|
-
*
|
|
505
|
-
*
|
|
876
|
+
* Perform low-level surface blitting only.
|
|
877
|
+
*
|
|
878
|
+
* This is a semi-private blit function and it performs low-level surface
|
|
879
|
+
* blitting, assuming the input rectangles have already been clipped.
|
|
880
|
+
*
|
|
881
|
+
* Unless you know what you're doing, you should be using SDL_BlitSurface()
|
|
882
|
+
* instead.
|
|
883
|
+
*
|
|
884
|
+
* \param src the SDL_Surface structure to be copied from
|
|
885
|
+
* \param srcrect the SDL_Rect structure representing the rectangle to be
|
|
886
|
+
* copied, or NULL to copy the entire surface
|
|
887
|
+
* \param dst the SDL_Surface structure that is the blit target
|
|
888
|
+
* \param dstrect the SDL_Rect structure representing the rectangle that is
|
|
889
|
+
* copied into
|
|
890
|
+
* \returns 0 on success or a negative error code on failure; call
|
|
891
|
+
* SDL_GetError() for more information.
|
|
892
|
+
*
|
|
893
|
+
* \since This function is available since SDL 2.0.0.
|
|
894
|
+
*
|
|
895
|
+
* \sa SDL_BlitSurface
|
|
506
896
|
*/
|
|
507
897
|
extern DECLSPEC int SDLCALL SDL_LowerBlit
|
|
508
898
|
(SDL_Surface * src, SDL_Rect * srcrect,
|
|
509
899
|
SDL_Surface * dst, SDL_Rect * dstrect);
|
|
510
900
|
|
|
901
|
+
|
|
511
902
|
/**
|
|
512
|
-
*
|
|
513
|
-
*
|
|
903
|
+
* Perform a fast, low quality, stretch blit between two surfaces of the same
|
|
904
|
+
* format.
|
|
905
|
+
*
|
|
906
|
+
* Please use SDL_BlitScaled() instead.
|
|
514
907
|
*
|
|
515
|
-
*
|
|
908
|
+
* \since This function is available since SDL 2.0.0.
|
|
516
909
|
*/
|
|
517
910
|
extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface * src,
|
|
518
911
|
const SDL_Rect * srcrect,
|
|
519
912
|
SDL_Surface * dst,
|
|
520
913
|
const SDL_Rect * dstrect);
|
|
521
914
|
|
|
915
|
+
/**
|
|
916
|
+
* Perform bilinear scaling between two surfaces of the same format, 32BPP.
|
|
917
|
+
*
|
|
918
|
+
* \since This function is available since SDL 2.0.16.
|
|
919
|
+
*/
|
|
920
|
+
extern DECLSPEC int SDLCALL SDL_SoftStretchLinear(SDL_Surface * src,
|
|
921
|
+
const SDL_Rect * srcrect,
|
|
922
|
+
SDL_Surface * dst,
|
|
923
|
+
const SDL_Rect * dstrect);
|
|
924
|
+
|
|
925
|
+
|
|
522
926
|
#define SDL_BlitScaled SDL_UpperBlitScaled
|
|
523
927
|
|
|
524
928
|
/**
|
|
525
|
-
*
|
|
526
|
-
*
|
|
929
|
+
* Perform a scaled surface copy to a destination surface.
|
|
930
|
+
*
|
|
931
|
+
* SDL_UpperBlitScaled() has been replaced by SDL_BlitScaled(), which is
|
|
932
|
+
* merely a macro for this function with a less confusing name.
|
|
933
|
+
*
|
|
934
|
+
* \since This function is available since SDL 2.0.0.
|
|
935
|
+
*
|
|
936
|
+
* \sa SDL_BlitScaled
|
|
527
937
|
*/
|
|
528
938
|
extern DECLSPEC int SDLCALL SDL_UpperBlitScaled
|
|
529
939
|
(SDL_Surface * src, const SDL_Rect * srcrect,
|
|
530
940
|
SDL_Surface * dst, SDL_Rect * dstrect);
|
|
531
941
|
|
|
532
942
|
/**
|
|
533
|
-
*
|
|
534
|
-
*
|
|
943
|
+
* Perform low-level surface scaled blitting only.
|
|
944
|
+
*
|
|
945
|
+
* This is a semi-private function and it performs low-level surface blitting,
|
|
946
|
+
* assuming the input rectangles have already been clipped.
|
|
947
|
+
*
|
|
948
|
+
* \param src the SDL_Surface structure to be copied from
|
|
949
|
+
* \param srcrect the SDL_Rect structure representing the rectangle to be
|
|
950
|
+
* copied
|
|
951
|
+
* \param dst the SDL_Surface structure that is the blit target
|
|
952
|
+
* \param dstrect the SDL_Rect structure representing the rectangle that is
|
|
953
|
+
* copied into
|
|
954
|
+
* \returns 0 on success or a negative error code on failure; call
|
|
955
|
+
* SDL_GetError() for more information.
|
|
956
|
+
*
|
|
957
|
+
* \since This function is available since SDL 2.0.0.
|
|
958
|
+
*
|
|
959
|
+
* \sa SDL_BlitScaled
|
|
535
960
|
*/
|
|
536
961
|
extern DECLSPEC int SDLCALL SDL_LowerBlitScaled
|
|
537
962
|
(SDL_Surface * src, SDL_Rect * srcrect,
|
|
538
963
|
SDL_Surface * dst, SDL_Rect * dstrect);
|
|
539
964
|
|
|
540
965
|
/**
|
|
541
|
-
*
|
|
966
|
+
* Set the YUV conversion mode
|
|
967
|
+
*
|
|
968
|
+
* \since This function is available since SDL 2.0.8.
|
|
542
969
|
*/
|
|
543
970
|
extern DECLSPEC void SDLCALL SDL_SetYUVConversionMode(SDL_YUV_CONVERSION_MODE mode);
|
|
544
971
|
|
|
545
972
|
/**
|
|
546
|
-
*
|
|
973
|
+
* Get the YUV conversion mode
|
|
974
|
+
*
|
|
975
|
+
* \since This function is available since SDL 2.0.8.
|
|
547
976
|
*/
|
|
548
977
|
extern DECLSPEC SDL_YUV_CONVERSION_MODE SDLCALL SDL_GetYUVConversionMode(void);
|
|
549
978
|
|
|
550
979
|
/**
|
|
551
|
-
*
|
|
980
|
+
* Get the YUV conversion mode, returning the correct mode for the resolution
|
|
981
|
+
* when the current conversion mode is SDL_YUV_CONVERSION_AUTOMATIC
|
|
982
|
+
*
|
|
983
|
+
* \since This function is available since SDL 2.0.8.
|
|
552
984
|
*/
|
|
553
985
|
extern DECLSPEC SDL_YUV_CONVERSION_MODE SDLCALL SDL_GetYUVConversionModeForResolution(int width, int height);
|
|
554
986
|
|