alphatau 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Rakefile +11 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/ext/alphatau/native/alphatau_native.cpp +141 -0
- data/ext/alphatau/native/extconf.rb +18 -0
- data/ext/alphatau/native/sdl/Android.mk +110 -0
- data/ext/alphatau/native/sdl/BUGS.txt +16 -0
- data/ext/alphatau/native/sdl/CMakeLists.txt +1877 -0
- data/ext/alphatau/native/sdl/COPYING.txt +20 -0
- data/ext/alphatau/native/sdl/CREDITS.txt +53 -0
- data/ext/alphatau/native/sdl/INSTALL.txt +40 -0
- data/ext/alphatau/native/sdl/Makefile.in +240 -0
- data/ext/alphatau/native/sdl/Makefile.minimal +44 -0
- data/ext/alphatau/native/sdl/Makefile.pandora +60 -0
- data/ext/alphatau/native/sdl/Makefile.psp +95 -0
- data/ext/alphatau/native/sdl/Makefile.wiz +80 -0
- data/ext/alphatau/native/sdl/README-SDL.txt +13 -0
- data/ext/alphatau/native/sdl/README.txt +21 -0
- data/ext/alphatau/native/sdl/SDL2.spec.in +118 -0
- data/ext/alphatau/native/sdl/SDL2Config.cmake +1 -0
- data/ext/alphatau/native/sdl/TODO.txt +10 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/SDL2-WinRT.nuspec +23 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/SDL2-WinRT.targets +38 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/SDL2main-WinRT-NonXAML.nuspec +22 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/SDL2main-WinRT-NonXAML.targets +10 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/UWP_VS2015/SDL-UWP.sln +34 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj +575 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj.filters +774 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.sln +28 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.vcxproj +466 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.vcxproj.filters +735 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.sln +34 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj +571 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj.filters +771 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/tests/loopwave/Assets/Logo.png +0 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/tests/loopwave/Assets/SmallLogo.png +0 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/tests/loopwave/Assets/SplashScreen.png +0 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/tests/loopwave/Assets/StoreLogo.png +0 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/tests/loopwave/Package.appxmanifest +42 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/tests/loopwave/loopwave_VS2012.vcxproj +170 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/tests/loopwave/loopwave_VS2012_TemporaryKey.pfx +0 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/tests/testthread/Assets/Logo.png +0 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/tests/testthread/Assets/SmallLogo.png +0 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/tests/testthread/Assets/SplashScreen.png +0 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/tests/testthread/Assets/StoreLogo.png +0 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/tests/testthread/Package.appxmanifest +42 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/tests/testthread/testthread_VS2012.vcxproj +160 -0
- data/ext/alphatau/native/sdl/VisualC-WinRT/tests/testthread/testthread_VS2012_TemporaryKey.pfx +0 -0
- data/ext/alphatau/native/sdl/VisualC.html +146 -0
- data/ext/alphatau/native/sdl/VisualC/SDL.sln +291 -0
- data/ext/alphatau/native/sdl/VisualC/SDL/SDL.vcxproj +559 -0
- data/ext/alphatau/native/sdl/VisualC/SDL/SDL.vcxproj.filters +479 -0
- data/ext/alphatau/native/sdl/VisualC/SDLmain/SDLmain.vcxproj +162 -0
- data/ext/alphatau/native/sdl/VisualC/SDLtest/SDLtest.vcxproj +177 -0
- data/ext/alphatau/native/sdl/VisualC/clean.sh +4 -0
- data/ext/alphatau/native/sdl/VisualC/tests/checkkeys/checkkeys.vcxproj +218 -0
- data/ext/alphatau/native/sdl/VisualC/tests/controllermap/controllermap.vcxproj +259 -0
- data/ext/alphatau/native/sdl/VisualC/tests/loopwave/loopwave.vcxproj +229 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testatomic/testatomic.vcxproj +203 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testautomation/testautomation.vcxproj +230 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testdraw2/testdraw2.vcxproj +209 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testfile/testfile.vcxproj +203 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testgamecontroller/testgamecontroller.vcxproj +259 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testgesture/testgesture.vcxproj +203 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testgl2/testgl2.vcxproj +213 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testgles2/testgles2.vcxproj +209 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testjoystick/testjoystick.vcxproj +203 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testoverlay2/testoverlay2.vcxproj +224 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testplatform/testplatform.vcxproj +231 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testpower/testpower.vcxproj +203 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testrendertarget/testrendertarget.vcxproj +247 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testrumble/testrumble.vcxproj +203 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testscale/testscale.vcxproj +247 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testshape/testshape.vcxproj +203 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testsprite2/testsprite2.vcxproj +229 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testvulkan/testvulkan.vcxproj +203 -0
- data/ext/alphatau/native/sdl/VisualC/tests/testyuv/testyuv.vcxproj +233 -0
- data/ext/alphatau/native/sdl/VisualC/visualtest/unittest/testquit/testquit_VS2012.vcxproj +216 -0
- data/ext/alphatau/native/sdl/VisualC/visualtest/visualtest_VS2012.vcxproj +304 -0
- data/ext/alphatau/native/sdl/WhatsNew.txt +401 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/Default.png +0 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj +1299 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/Icon.png +0 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/Info.plist +32 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/README +43 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/bitmapfont/kromasky_16x16.bmp +0 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/bitmapfont/license.txt +258 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/drums/ds_brush_snare.wav +0 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/drums/ds_china.wav +0 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/drums/ds_kick_big_amb.wav +0 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/drums/ds_loose_skin_mute.wav +0 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/icon.bmp +0 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/ship.bmp +0 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/space.bmp +0 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/stroke.bmp +0 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/iOS Launch Screen.storyboard +40 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/accelerometer.c +226 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/common.c +56 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/common.h +10 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/fireworks.c +474 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/happy.c +180 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/keyboard.c +301 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/mixer.c +344 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/rectangles.c +92 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/touch.c +129 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj +2047 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/SDLtest/SDL2test.xcodeproj/project.pbxproj +422 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/Default-568h@2x.png +0 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/Default.png +0 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/Icon.png +0 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/Info.plist +28 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns +0 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist +10 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/project.pbxproj +308 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/main.c +100 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Test/Info.plist +26 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Test/README +11 -0
- data/ext/alphatau/native/sdl/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj +3095 -0
- data/ext/alphatau/native/sdl/Xcode/SDL/Info-Framework.plist +28 -0
- data/ext/alphatau/native/sdl/Xcode/SDL/SDL.xcodeproj/project.pbxproj +3384 -0
- data/ext/alphatau/native/sdl/Xcode/SDL/pkg-support/SDL.info +15 -0
- data/ext/alphatau/native/sdl/Xcode/SDL/pkg-support/resources/License.txt +19 -0
- data/ext/alphatau/native/sdl/Xcode/SDL/pkg-support/resources/ReadMe.txt +32 -0
- data/ext/alphatau/native/sdl/Xcode/SDL/pkg-support/resources/SDL_DS_Store +0 -0
- data/ext/alphatau/native/sdl/Xcode/SDL/pkg-support/sdl_logo.pdf +0 -0
- data/ext/alphatau/native/sdl/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj +4995 -0
- data/ext/alphatau/native/sdl/Xcode/SDLTest/TestDropFile-Info.plist +35 -0
- data/ext/alphatau/native/sdl/Xcode/XcodeDocSet/Doxyfile +1558 -0
- data/ext/alphatau/native/sdl/acinclude/ac_check_define.m4 +14 -0
- data/ext/alphatau/native/sdl/acinclude/alsa.m4 +145 -0
- data/ext/alphatau/native/sdl/acinclude/ax_check_compiler_flags.m4 +76 -0
- data/ext/alphatau/native/sdl/acinclude/ax_gcc_archflag.m4 +215 -0
- data/ext/alphatau/native/sdl/acinclude/ax_gcc_x86_cpuid.m4.htm +79 -0
- data/ext/alphatau/native/sdl/acinclude/esd.m4 +168 -0
- data/ext/alphatau/native/sdl/acinclude/libtool.m4 +7998 -0
- data/ext/alphatau/native/sdl/acinclude/ltoptions.m4 +384 -0
- data/ext/alphatau/native/sdl/acinclude/ltsugar.m4 +123 -0
- data/ext/alphatau/native/sdl/acinclude/ltversion.m4 +23 -0
- data/ext/alphatau/native/sdl/acinclude/lt~obsolete.m4 +98 -0
- data/ext/alphatau/native/sdl/android-project-ant/AndroidManifest.xml +1 -0
- data/ext/alphatau/native/sdl/android-project-ant/ant.properties +17 -0
- data/ext/alphatau/native/sdl/android-project-ant/build.properties +17 -0
- data/ext/alphatau/native/sdl/android-project-ant/build.xml +93 -0
- data/ext/alphatau/native/sdl/android-project-ant/default.properties +11 -0
- data/ext/alphatau/native/sdl/android-project-ant/jni/Android.mk +1 -0
- data/ext/alphatau/native/sdl/android-project-ant/jni/Application.mk +10 -0
- data/ext/alphatau/native/sdl/android-project-ant/jni/src/Android.mk +18 -0
- data/ext/alphatau/native/sdl/android-project-ant/jni/src/Android_static.mk +12 -0
- data/ext/alphatau/native/sdl/android-project-ant/proguard-project.txt +20 -0
- data/ext/alphatau/native/sdl/android-project-ant/project.properties +14 -0
- data/ext/alphatau/native/sdl/android-project-ant/res/drawable-hdpi/ic_launcher.png +0 -0
- data/ext/alphatau/native/sdl/android-project-ant/res/drawable-mdpi/ic_launcher.png +0 -0
- data/ext/alphatau/native/sdl/android-project-ant/res/drawable-xhdpi/ic_launcher.png +0 -0
- data/ext/alphatau/native/sdl/android-project-ant/res/drawable-xxhdpi/ic_launcher.png +0 -0
- data/ext/alphatau/native/sdl/android-project-ant/res/layout/main.xml +13 -0
- data/ext/alphatau/native/sdl/android-project-ant/res/values/strings.xml +4 -0
- data/ext/alphatau/native/sdl/android-project-ant/src +1 -0
- data/ext/alphatau/native/sdl/android-project/app/build.gradle +69 -0
- data/ext/alphatau/native/sdl/android-project/app/jni/Android.mk +1 -0
- data/ext/alphatau/native/sdl/android-project/app/jni/Application.mk +9 -0
- data/ext/alphatau/native/sdl/android-project/app/jni/src/Android.mk +18 -0
- data/ext/alphatau/native/sdl/android-project/app/proguard-rules.pro +17 -0
- data/ext/alphatau/native/sdl/android-project/app/src/main/AndroidManifest.xml +77 -0
- data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/HIDDevice.java +19 -0
- data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/HIDDeviceBLESteamController.java +640 -0
- data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/HIDDeviceManager.java +624 -0
- data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/HIDDeviceUSB.java +298 -0
- data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/SDL.java +37 -0
- data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java +2103 -0
- data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/SDLAudioManager.java +178 -0
- data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/SDLControllerManager.java +812 -0
- data/ext/alphatau/native/sdl/android-project/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- data/ext/alphatau/native/sdl/android-project/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- data/ext/alphatau/native/sdl/android-project/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- data/ext/alphatau/native/sdl/android-project/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- data/ext/alphatau/native/sdl/android-project/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- data/ext/alphatau/native/sdl/android-project/app/src/main/res/values/colors.xml +6 -0
- data/ext/alphatau/native/sdl/android-project/app/src/main/res/values/strings.xml +3 -0
- data/ext/alphatau/native/sdl/android-project/app/src/main/res/values/styles.xml +8 -0
- data/ext/alphatau/native/sdl/android-project/build.gradle +23 -0
- data/ext/alphatau/native/sdl/android-project/gradle.properties +17 -0
- data/ext/alphatau/native/sdl/android-project/gradle/wrapper/gradle-wrapper.jar +0 -0
- data/ext/alphatau/native/sdl/android-project/gradle/wrapper/gradle-wrapper.properties +6 -0
- data/ext/alphatau/native/sdl/android-project/gradlew +160 -0
- data/ext/alphatau/native/sdl/android-project/gradlew.bat +90 -0
- data/ext/alphatau/native/sdl/android-project/settings.gradle +1 -0
- data/ext/alphatau/native/sdl/autogen.sh +23 -0
- data/ext/alphatau/native/sdl/build-scripts/androidbuild.sh +100 -0
- data/ext/alphatau/native/sdl/build-scripts/androidbuildlibs.sh +74 -0
- data/ext/alphatau/native/sdl/build-scripts/checker-buildbot.sh +103 -0
- data/ext/alphatau/native/sdl/build-scripts/config.guess +1476 -0
- data/ext/alphatau/native/sdl/build-scripts/config.sub +1868 -0
- data/ext/alphatau/native/sdl/build-scripts/config.sub.patch +72 -0
- data/ext/alphatau/native/sdl/build-scripts/emscripten-buildbot.sh +77 -0
- data/ext/alphatau/native/sdl/build-scripts/g++-fat.sh +101 -0
- data/ext/alphatau/native/sdl/build-scripts/gcc-fat.sh +102 -0
- data/ext/alphatau/native/sdl/build-scripts/install-sh +323 -0
- data/ext/alphatau/native/sdl/build-scripts/iosbuild.sh +188 -0
- data/ext/alphatau/native/sdl/build-scripts/ltmain.sh +9658 -0
- data/ext/alphatau/native/sdl/build-scripts/mkinstalldirs +99 -0
- data/ext/alphatau/native/sdl/build-scripts/nacl-buildbot.sh +61 -0
- data/ext/alphatau/native/sdl/build-scripts/naclbuild.sh +105 -0
- data/ext/alphatau/native/sdl/build-scripts/raspberrypi-buildbot.sh +60 -0
- data/ext/alphatau/native/sdl/build-scripts/showrev.sh +5 -0
- data/ext/alphatau/native/sdl/build-scripts/strip_fPIC.sh +21 -0
- data/ext/alphatau/native/sdl/build-scripts/update-copyright.sh +8 -0
- data/ext/alphatau/native/sdl/build-scripts/updaterev.sh +20 -0
- data/ext/alphatau/native/sdl/build-scripts/windows-buildbot-zipper.bat +40 -0
- data/ext/alphatau/native/sdl/build-scripts/winrtbuild.bat +8 -0
- data/ext/alphatau/native/sdl/build-scripts/winrtbuild.ps1 +302 -0
- data/ext/alphatau/native/sdl/cmake/macros.cmake +73 -0
- data/ext/alphatau/native/sdl/cmake/sdlchecks.cmake +1184 -0
- data/ext/alphatau/native/sdl/cmake_uninstall.cmake.in +18 -0
- data/ext/alphatau/native/sdl/configure +27540 -0
- data/ext/alphatau/native/sdl/configure.in +4236 -0
- data/ext/alphatau/native/sdl/debian/changelog +114 -0
- data/ext/alphatau/native/sdl/debian/compat +1 -0
- data/ext/alphatau/native/sdl/debian/control +76 -0
- data/ext/alphatau/native/sdl/debian/copyright +351 -0
- data/ext/alphatau/native/sdl/debian/docs +4 -0
- data/ext/alphatau/native/sdl/debian/libsdl2-dev.install +8 -0
- data/ext/alphatau/native/sdl/debian/libsdl2-dev.manpages +1 -0
- data/ext/alphatau/native/sdl/debian/libsdl2.install +1 -0
- data/ext/alphatau/native/sdl/debian/rules +41 -0
- data/ext/alphatau/native/sdl/debian/sdl2-config.1 +86 -0
- data/ext/alphatau/native/sdl/debian/source/format +1 -0
- data/ext/alphatau/native/sdl/debian/watch +2 -0
- data/ext/alphatau/native/sdl/docs/README-android.md +432 -0
- data/ext/alphatau/native/sdl/docs/README-cmake.md +32 -0
- data/ext/alphatau/native/sdl/docs/README-directfb.md +107 -0
- data/ext/alphatau/native/sdl/docs/README-dynapi.md +130 -0
- data/ext/alphatau/native/sdl/docs/README-emscripten.md +35 -0
- data/ext/alphatau/native/sdl/docs/README-gesture.md +71 -0
- data/ext/alphatau/native/sdl/docs/README-hg.md +22 -0
- data/ext/alphatau/native/sdl/docs/README-ios.md +284 -0
- data/ext/alphatau/native/sdl/docs/README-linux.md +90 -0
- data/ext/alphatau/native/sdl/docs/README-macosx.md +240 -0
- data/ext/alphatau/native/sdl/docs/README-nacl.md +103 -0
- data/ext/alphatau/native/sdl/docs/README-pandora.md +17 -0
- data/ext/alphatau/native/sdl/docs/README-platforms.md +8 -0
- data/ext/alphatau/native/sdl/docs/README-porting.md +68 -0
- data/ext/alphatau/native/sdl/docs/README-psp.md +19 -0
- data/ext/alphatau/native/sdl/docs/README-raspberrypi.md +188 -0
- data/ext/alphatau/native/sdl/docs/README-touch.md +86 -0
- data/ext/alphatau/native/sdl/docs/README-wince.md +10 -0
- data/ext/alphatau/native/sdl/docs/README-windows.md +45 -0
- data/ext/alphatau/native/sdl/docs/README-winrt.md +544 -0
- data/ext/alphatau/native/sdl/docs/README.md +63 -0
- data/ext/alphatau/native/sdl/docs/doxyfile +1560 -0
- data/ext/alphatau/native/sdl/include/SDL.h +135 -0
- data/ext/alphatau/native/sdl/include/SDL_assert.h +291 -0
- data/ext/alphatau/native/sdl/include/SDL_atomic.h +277 -0
- data/ext/alphatau/native/sdl/include/SDL_audio.h +825 -0
- data/ext/alphatau/native/sdl/include/SDL_bits.h +112 -0
- data/ext/alphatau/native/sdl/include/SDL_blendmode.h +120 -0
- data/ext/alphatau/native/sdl/include/SDL_clipboard.h +71 -0
- data/ext/alphatau/native/sdl/include/SDL_config.h +53 -0
- data/ext/alphatau/native/sdl/include/SDL_config.h.cmake +471 -0
- data/ext/alphatau/native/sdl/include/SDL_config.h.in +417 -0
- data/ext/alphatau/native/sdl/include/SDL_config_android.h +177 -0
- data/ext/alphatau/native/sdl/include/SDL_config_iphoneos.h +201 -0
- data/ext/alphatau/native/sdl/include/SDL_config_macosx.h +240 -0
- data/ext/alphatau/native/sdl/include/SDL_config_minimal.h +85 -0
- data/ext/alphatau/native/sdl/include/SDL_config_pandora.h +133 -0
- data/ext/alphatau/native/sdl/include/SDL_config_psp.h +164 -0
- data/ext/alphatau/native/sdl/include/SDL_config_windows.h +254 -0
- data/ext/alphatau/native/sdl/include/SDL_config_winrt.h +235 -0
- data/ext/alphatau/native/sdl/include/SDL_config_wiz.h +146 -0
- data/ext/alphatau/native/sdl/include/SDL_copying.h +20 -0
- data/ext/alphatau/native/sdl/include/SDL_cpuinfo.h +188 -0
- data/ext/alphatau/native/sdl/include/SDL_egl.h +1673 -0
- data/ext/alphatau/native/sdl/include/SDL_endian.h +260 -0
- data/ext/alphatau/native/sdl/include/SDL_error.h +76 -0
- data/ext/alphatau/native/sdl/include/SDL_events.h +788 -0
- data/ext/alphatau/native/sdl/include/SDL_filesystem.h +136 -0
- data/ext/alphatau/native/sdl/include/SDL_gamecontroller.h +383 -0
- data/ext/alphatau/native/sdl/include/SDL_gesture.h +87 -0
- data/ext/alphatau/native/sdl/include/SDL_haptic.h +1227 -0
- data/ext/alphatau/native/sdl/include/SDL_hints.h +1106 -0
- data/ext/alphatau/native/sdl/include/SDL_joystick.h +395 -0
- data/ext/alphatau/native/sdl/include/SDL_keyboard.h +217 -0
- data/ext/alphatau/native/sdl/include/SDL_keycode.h +349 -0
- data/ext/alphatau/native/sdl/include/SDL_loadso.h +81 -0
- data/ext/alphatau/native/sdl/include/SDL_log.h +211 -0
- data/ext/alphatau/native/sdl/include/SDL_main.h +168 -0
- data/ext/alphatau/native/sdl/include/SDL_messagebox.h +144 -0
- data/ext/alphatau/native/sdl/include/SDL_mouse.h +302 -0
- data/ext/alphatau/native/sdl/include/SDL_mutex.h +251 -0
- data/ext/alphatau/native/sdl/include/SDL_name.h +33 -0
- data/ext/alphatau/native/sdl/include/SDL_opengl.h +2183 -0
- data/ext/alphatau/native/sdl/include/SDL_opengl_glext.h +11177 -0
- data/ext/alphatau/native/sdl/include/SDL_opengles.h +39 -0
- data/ext/alphatau/native/sdl/include/SDL_opengles2.h +52 -0
- data/ext/alphatau/native/sdl/include/SDL_opengles2_gl2.h +621 -0
- data/ext/alphatau/native/sdl/include/SDL_opengles2_gl2ext.h +2050 -0
- data/ext/alphatau/native/sdl/include/SDL_opengles2_gl2platform.h +30 -0
- data/ext/alphatau/native/sdl/include/SDL_opengles2_khrplatform.h +282 -0
- data/ext/alphatau/native/sdl/include/SDL_pixels.h +470 -0
- data/ext/alphatau/native/sdl/include/SDL_platform.h +198 -0
- data/ext/alphatau/native/sdl/include/SDL_power.h +75 -0
- data/ext/alphatau/native/sdl/include/SDL_quit.h +58 -0
- data/ext/alphatau/native/sdl/include/SDL_rect.h +148 -0
- data/ext/alphatau/native/sdl/include/SDL_render.h +931 -0
- data/ext/alphatau/native/sdl/include/SDL_revision.h +2 -0
- data/ext/alphatau/native/sdl/include/SDL_rwops.h +254 -0
- data/ext/alphatau/native/sdl/include/SDL_scancode.h +413 -0
- data/ext/alphatau/native/sdl/include/SDL_sensor.h +251 -0
- data/ext/alphatau/native/sdl/include/SDL_shape.h +144 -0
- data/ext/alphatau/native/sdl/include/SDL_stdinc.h +607 -0
- data/ext/alphatau/native/sdl/include/SDL_surface.h +546 -0
- data/ext/alphatau/native/sdl/include/SDL_system.h +279 -0
- data/ext/alphatau/native/sdl/include/SDL_syswm.h +324 -0
- data/ext/alphatau/native/sdl/include/SDL_test.h +69 -0
- data/ext/alphatau/native/sdl/include/SDL_test_assert.h +105 -0
- data/ext/alphatau/native/sdl/include/SDL_test_common.h +188 -0
- data/ext/alphatau/native/sdl/include/SDL_test_compare.h +69 -0
- data/ext/alphatau/native/sdl/include/SDL_test_crc32.h +124 -0
- data/ext/alphatau/native/sdl/include/SDL_test_font.h +81 -0
- data/ext/alphatau/native/sdl/include/SDL_test_fuzzer.h +384 -0
- data/ext/alphatau/native/sdl/include/SDL_test_harness.h +134 -0
- data/ext/alphatau/native/sdl/include/SDL_test_images.h +78 -0
- data/ext/alphatau/native/sdl/include/SDL_test_log.h +67 -0
- data/ext/alphatau/native/sdl/include/SDL_test_md5.h +129 -0
- data/ext/alphatau/native/sdl/include/SDL_test_memory.h +63 -0
- data/ext/alphatau/native/sdl/include/SDL_test_random.h +115 -0
- data/ext/alphatau/native/sdl/include/SDL_thread.h +309 -0
- data/ext/alphatau/native/sdl/include/SDL_timer.h +115 -0
- data/ext/alphatau/native/sdl/include/SDL_touch.h +86 -0
- data/ext/alphatau/native/sdl/include/SDL_types.h +29 -0
- data/ext/alphatau/native/sdl/include/SDL_version.h +162 -0
- data/ext/alphatau/native/sdl/include/SDL_video.h +1276 -0
- data/ext/alphatau/native/sdl/include/SDL_vulkan.h +278 -0
- data/ext/alphatau/native/sdl/include/begin_code.h +167 -0
- data/ext/alphatau/native/sdl/include/close_code.h +37 -0
- data/ext/alphatau/native/sdl/sdl2-config.cmake.in +11 -0
- data/ext/alphatau/native/sdl/sdl2-config.in +60 -0
- data/ext/alphatau/native/sdl/sdl2.m4 +234 -0
- data/ext/alphatau/native/sdl/sdl2.pc.in +15 -0
- data/ext/alphatau/native/sdl/src/SDL.c +514 -0
- data/ext/alphatau/native/sdl/src/SDL_assert.c +451 -0
- data/ext/alphatau/native/sdl/src/SDL_assert_c.h +24 -0
- data/ext/alphatau/native/sdl/src/SDL_dataqueue.c +339 -0
- data/ext/alphatau/native/sdl/src/SDL_dataqueue.h +55 -0
- data/ext/alphatau/native/sdl/src/SDL_error.c +319 -0
- data/ext/alphatau/native/sdl/src/SDL_error_c.h +65 -0
- data/ext/alphatau/native/sdl/src/SDL_hints.c +236 -0
- data/ext/alphatau/native/sdl/src/SDL_internal.h +52 -0
- data/ext/alphatau/native/sdl/src/SDL_log.c +450 -0
- data/ext/alphatau/native/sdl/src/atomic/SDL_atomic.c +303 -0
- data/ext/alphatau/native/sdl/src/atomic/SDL_spinlock.c +176 -0
- data/ext/alphatau/native/sdl/src/audio/SDL_audio.c +1647 -0
- data/ext/alphatau/native/sdl/src/audio/SDL_audio_c.h +79 -0
- data/ext/alphatau/native/sdl/src/audio/SDL_audiocvt.c +1673 -0
- data/ext/alphatau/native/sdl/src/audio/SDL_audiodev.c +124 -0
- data/ext/alphatau/native/sdl/src/audio/SDL_audiodev_c.h +38 -0
- data/ext/alphatau/native/sdl/src/audio/SDL_audiotypecvt.c +1430 -0
- data/ext/alphatau/native/sdl/src/audio/SDL_mixer.c +369 -0
- data/ext/alphatau/native/sdl/src/audio/SDL_sysaudio.h +211 -0
- data/ext/alphatau/native/sdl/src/audio/SDL_wave.c +694 -0
- data/ext/alphatau/native/sdl/src/audio/SDL_wave.h +77 -0
- data/ext/alphatau/native/sdl/src/audio/alsa/SDL_alsa_audio.c +990 -0
- data/ext/alphatau/native/sdl/src/audio/alsa/SDL_alsa_audio.h +48 -0
- data/ext/alphatau/native/sdl/src/audio/android/SDL_androidaudio.c +226 -0
- data/ext/alphatau/native/sdl/src/audio/android/SDL_androidaudio.h +42 -0
- data/ext/alphatau/native/sdl/src/audio/arts/SDL_artsaudio.c +365 -0
- data/ext/alphatau/native/sdl/src/audio/arts/SDL_artsaudio.h +53 -0
- data/ext/alphatau/native/sdl/src/audio/coreaudio/SDL_coreaudio.h +66 -0
- data/ext/alphatau/native/sdl/src/audio/coreaudio/SDL_coreaudio.m +861 -0
- data/ext/alphatau/native/sdl/src/audio/directsound/SDL_directsound.c +604 -0
- data/ext/alphatau/native/sdl/src/audio/directsound/SDL_directsound.h +47 -0
- data/ext/alphatau/native/sdl/src/audio/disk/SDL_diskaudio.c +207 -0
- data/ext/alphatau/native/sdl/src/audio/disk/SDL_diskaudio.h +41 -0
- data/ext/alphatau/native/sdl/src/audio/dsp/SDL_dspaudio.c +320 -0
- data/ext/alphatau/native/sdl/src/audio/dsp/SDL_dspaudio.h +43 -0
- data/ext/alphatau/native/sdl/src/audio/dummy/SDL_dummyaudio.c +65 -0
- data/ext/alphatau/native/sdl/src/audio/dummy/SDL_dummyaudio.h +41 -0
- data/ext/alphatau/native/sdl/src/audio/emscripten/SDL_emscriptenaudio.c +379 -0
- data/ext/alphatau/native/sdl/src/audio/emscripten/SDL_emscriptenaudio.h +38 -0
- data/ext/alphatau/native/sdl/src/audio/esd/SDL_esdaudio.c +335 -0
- data/ext/alphatau/native/sdl/src/audio/esd/SDL_esdaudio.h +51 -0
- data/ext/alphatau/native/sdl/src/audio/fusionsound/SDL_fsaudio.c +328 -0
- data/ext/alphatau/native/sdl/src/audio/fusionsound/SDL_fsaudio.h +50 -0
- data/ext/alphatau/native/sdl/src/audio/haiku/SDL_haikuaudio.cc +248 -0
- data/ext/alphatau/native/sdl/src/audio/haiku/SDL_haikuaudio.h +38 -0
- data/ext/alphatau/native/sdl/src/audio/jack/SDL_jackaudio.c +446 -0
- data/ext/alphatau/native/sdl/src/audio/jack/SDL_jackaudio.h +41 -0
- data/ext/alphatau/native/sdl/src/audio/nacl/SDL_naclaudio.c +165 -0
- data/ext/alphatau/native/sdl/src/audio/nacl/SDL_naclaudio.h +43 -0
- data/ext/alphatau/native/sdl/src/audio/nas/SDL_nasaudio.c +463 -0
- data/ext/alphatau/native/sdl/src/audio/nas/SDL_nasaudio.h +56 -0
- data/ext/alphatau/native/sdl/src/audio/netbsd/SDL_netbsdaudio.c +412 -0
- data/ext/alphatau/native/sdl/src/audio/netbsd/SDL_netbsdaudio.h +48 -0
- data/ext/alphatau/native/sdl/src/audio/paudio/SDL_paudio.c +516 -0
- data/ext/alphatau/native/sdl/src/audio/paudio/SDL_paudio.h +48 -0
- data/ext/alphatau/native/sdl/src/audio/psp/SDL_pspaudio.c +181 -0
- data/ext/alphatau/native/sdl/src/audio/psp/SDL_pspaudio.h +45 -0
- data/ext/alphatau/native/sdl/src/audio/pulseaudio/SDL_pulseaudio.c +782 -0
- data/ext/alphatau/native/sdl/src/audio/pulseaudio/SDL_pulseaudio.h +52 -0
- data/ext/alphatau/native/sdl/src/audio/qsa/SDL_qsa_audio.c +666 -0
- data/ext/alphatau/native/sdl/src/audio/qsa/SDL_qsa_audio.h +57 -0
- data/ext/alphatau/native/sdl/src/audio/sndio/SDL_sndioaudio.c +382 -0
- data/ext/alphatau/native/sdl/src/audio/sndio/SDL_sndioaudio.h +49 -0
- data/ext/alphatau/native/sdl/src/audio/sun/SDL_sunaudio.c +419 -0
- data/ext/alphatau/native/sdl/src/audio/sun/SDL_sunaudio.h +47 -0
- data/ext/alphatau/native/sdl/src/audio/wasapi/SDL_wasapi.c +779 -0
- data/ext/alphatau/native/sdl/src/audio/wasapi/SDL_wasapi.h +85 -0
- data/ext/alphatau/native/sdl/src/audio/wasapi/SDL_wasapi_win32.c +417 -0
- data/ext/alphatau/native/sdl/src/audio/wasapi/SDL_wasapi_winrt.cpp +276 -0
- data/ext/alphatau/native/sdl/src/audio/winmm/SDL_winmm.c +457 -0
- data/ext/alphatau/native/sdl/src/audio/winmm/SDL_winmm.h +45 -0
- data/ext/alphatau/native/sdl/src/core/android/SDL_android.c +2285 -0
- data/ext/alphatau/native/sdl/src/core/android/SDL_android.h +122 -0
- data/ext/alphatau/native/sdl/src/core/android/keyinfotable.h +175 -0
- data/ext/alphatau/native/sdl/src/core/linux/SDL_dbus.c +347 -0
- data/ext/alphatau/native/sdl/src/core/linux/SDL_dbus.h +97 -0
- data/ext/alphatau/native/sdl/src/core/linux/SDL_evdev.c +698 -0
- data/ext/alphatau/native/sdl/src/core/linux/SDL_evdev.h +39 -0
- data/ext/alphatau/native/sdl/src/core/linux/SDL_evdev_kbd.c +840 -0
- data/ext/alphatau/native/sdl/src/core/linux/SDL_evdev_kbd.h +29 -0
- data/ext/alphatau/native/sdl/src/core/linux/SDL_evdev_kbd_default_accents.h +284 -0
- data/ext/alphatau/native/sdl/src/core/linux/SDL_evdev_kbd_default_keymap.h +4763 -0
- data/ext/alphatau/native/sdl/src/core/linux/SDL_fcitx.c +373 -0
- data/ext/alphatau/native/sdl/src/core/linux/SDL_fcitx.h +40 -0
- data/ext/alphatau/native/sdl/src/core/linux/SDL_ibus.c +584 -0
- data/ext/alphatau/native/sdl/src/core/linux/SDL_ibus.h +58 -0
- data/ext/alphatau/native/sdl/src/core/linux/SDL_ime.c +152 -0
- data/ext/alphatau/native/sdl/src/core/linux/SDL_ime.h +40 -0
- data/ext/alphatau/native/sdl/src/core/linux/SDL_udev.c +553 -0
- data/ext/alphatau/native/sdl/src/core/linux/SDL_udev.h +121 -0
- data/ext/alphatau/native/sdl/src/core/unix/SDL_poll.c +87 -0
- data/ext/alphatau/native/sdl/src/core/unix/SDL_poll.h +34 -0
- data/ext/alphatau/native/sdl/src/core/windows/SDL_directx.h +111 -0
- data/ext/alphatau/native/sdl/src/core/windows/SDL_windows.c +233 -0
- data/ext/alphatau/native/sdl/src/core/windows/SDL_windows.h +75 -0
- data/ext/alphatau/native/sdl/src/core/windows/SDL_xinput.c +139 -0
- data/ext/alphatau/native/sdl/src/core/windows/SDL_xinput.h +177 -0
- data/ext/alphatau/native/sdl/src/core/winrt/SDL_winrtapp_common.cpp +66 -0
- data/ext/alphatau/native/sdl/src/core/winrt/SDL_winrtapp_common.h +31 -0
- data/ext/alphatau/native/sdl/src/core/winrt/SDL_winrtapp_direct3d.cpp +855 -0
- data/ext/alphatau/native/sdl/src/core/winrt/SDL_winrtapp_direct3d.h +92 -0
- data/ext/alphatau/native/sdl/src/core/winrt/SDL_winrtapp_xaml.cpp +160 -0
- data/ext/alphatau/native/sdl/src/core/winrt/SDL_winrtapp_xaml.h +33 -0
- data/ext/alphatau/native/sdl/src/cpuinfo/SDL_cpuinfo.c +855 -0
- data/ext/alphatau/native/sdl/src/cpuinfo/SDL_simd.h +88 -0
- data/ext/alphatau/native/sdl/src/dynapi/SDL_dynapi.c +331 -0
- data/ext/alphatau/native/sdl/src/dynapi/SDL_dynapi.h +67 -0
- data/ext/alphatau/native/sdl/src/dynapi/SDL_dynapi_overrides.h +698 -0
- data/ext/alphatau/native/sdl/src/dynapi/SDL_dynapi_procs.h +740 -0
- data/ext/alphatau/native/sdl/src/dynapi/gendynapi.pl +141 -0
- data/ext/alphatau/native/sdl/src/events/SDL_clipboardevents.c +46 -0
- data/ext/alphatau/native/sdl/src/events/SDL_clipboardevents_c.h +30 -0
- data/ext/alphatau/native/sdl/src/events/SDL_displayevents.c +60 -0
- data/ext/alphatau/native/sdl/src/events/SDL_displayevents_c.h +30 -0
- data/ext/alphatau/native/sdl/src/events/SDL_dropevents.c +98 -0
- data/ext/alphatau/native/sdl/src/events/SDL_dropevents_c.h +32 -0
- data/ext/alphatau/native/sdl/src/events/SDL_events.c +976 -0
- data/ext/alphatau/native/sdl/src/events/SDL_events_c.h +52 -0
- data/ext/alphatau/native/sdl/src/events/SDL_gesture.c +700 -0
- data/ext/alphatau/native/sdl/src/events/SDL_gesture_c.h +35 -0
- data/ext/alphatau/native/sdl/src/events/SDL_keyboard.c +1033 -0
- data/ext/alphatau/native/sdl/src/events/SDL_keyboard_c.h +70 -0
- data/ext/alphatau/native/sdl/src/events/SDL_mouse.c +1031 -0
- data/ext/alphatau/native/sdl/src/events/SDL_mouse_c.h +141 -0
- data/ext/alphatau/native/sdl/src/events/SDL_quit.c +152 -0
- data/ext/alphatau/native/sdl/src/events/SDL_sysevents.h +36 -0
- data/ext/alphatau/native/sdl/src/events/SDL_touch.c +375 -0
- data/ext/alphatau/native/sdl/src/events/SDL_touch_c.h +61 -0
- data/ext/alphatau/native/sdl/src/events/SDL_windowevents.c +227 -0
- data/ext/alphatau/native/sdl/src/events/SDL_windowevents_c.h +31 -0
- data/ext/alphatau/native/sdl/src/events/blank_cursor.h +33 -0
- data/ext/alphatau/native/sdl/src/events/default_cursor.h +114 -0
- data/ext/alphatau/native/sdl/src/events/scancodes_darwin.h +159 -0
- data/ext/alphatau/native/sdl/src/events/scancodes_linux.h +263 -0
- data/ext/alphatau/native/sdl/src/events/scancodes_windows.h +55 -0
- data/ext/alphatau/native/sdl/src/events/scancodes_xfree86.h +506 -0
- data/ext/alphatau/native/sdl/src/file/SDL_rwops.c +867 -0
- data/ext/alphatau/native/sdl/src/file/cocoa/SDL_rwopsbundlesupport.h +30 -0
- data/ext/alphatau/native/sdl/src/file/cocoa/SDL_rwopsbundlesupport.m +62 -0
- data/ext/alphatau/native/sdl/src/filesystem/android/SDL_sysfilesystem.c +62 -0
- data/ext/alphatau/native/sdl/src/filesystem/cocoa/SDL_sysfilesystem.m +117 -0
- data/ext/alphatau/native/sdl/src/filesystem/dummy/SDL_sysfilesystem.c +47 -0
- data/ext/alphatau/native/sdl/src/filesystem/emscripten/SDL_sysfilesystem.c +81 -0
- data/ext/alphatau/native/sdl/src/filesystem/haiku/SDL_sysfilesystem.cc +110 -0
- data/ext/alphatau/native/sdl/src/filesystem/nacl/SDL_sysfilesystem.c +43 -0
- data/ext/alphatau/native/sdl/src/filesystem/unix/SDL_sysfilesystem.c +250 -0
- data/ext/alphatau/native/sdl/src/filesystem/windows/SDL_sysfilesystem.c +192 -0
- data/ext/alphatau/native/sdl/src/filesystem/winrt/SDL_sysfilesystem.cpp +233 -0
- data/ext/alphatau/native/sdl/src/haptic/SDL_haptic.c +850 -0
- data/ext/alphatau/native/sdl/src/haptic/SDL_haptic_c.h +25 -0
- data/ext/alphatau/native/sdl/src/haptic/SDL_syshaptic.h +208 -0
- data/ext/alphatau/native/sdl/src/haptic/android/SDL_syshaptic.c +358 -0
- data/ext/alphatau/native/sdl/src/haptic/android/SDL_syshaptic_c.h +12 -0
- data/ext/alphatau/native/sdl/src/haptic/darwin/SDL_syshaptic.c +1417 -0
- data/ext/alphatau/native/sdl/src/haptic/darwin/SDL_syshaptic_c.h +26 -0
- data/ext/alphatau/native/sdl/src/haptic/dummy/SDL_syshaptic.c +186 -0
- data/ext/alphatau/native/sdl/src/haptic/linux/SDL_syshaptic.c +1165 -0
- data/ext/alphatau/native/sdl/src/haptic/windows/SDL_dinputhaptic.c +1305 -0
- data/ext/alphatau/native/sdl/src/haptic/windows/SDL_dinputhaptic_c.h +47 -0
- data/ext/alphatau/native/sdl/src/haptic/windows/SDL_windowshaptic.c +456 -0
- data/ext/alphatau/native/sdl/src/haptic/windows/SDL_windowshaptic_c.h +88 -0
- data/ext/alphatau/native/sdl/src/haptic/windows/SDL_xinputhaptic.c +487 -0
- data/ext/alphatau/native/sdl/src/haptic/windows/SDL_xinputhaptic_c.h +47 -0
- data/ext/alphatau/native/sdl/src/hidapi/AUTHORS.txt +16 -0
- data/ext/alphatau/native/sdl/src/hidapi/HACKING.txt +15 -0
- data/ext/alphatau/native/sdl/src/hidapi/LICENSE-bsd.txt +26 -0
- data/ext/alphatau/native/sdl/src/hidapi/LICENSE-gpl3.txt +674 -0
- data/ext/alphatau/native/sdl/src/hidapi/LICENSE-orig.txt +9 -0
- data/ext/alphatau/native/sdl/src/hidapi/LICENSE.txt +13 -0
- data/ext/alphatau/native/sdl/src/hidapi/Makefile.am +85 -0
- data/ext/alphatau/native/sdl/src/hidapi/README.txt +339 -0
- data/ext/alphatau/native/sdl/src/hidapi/android/hid.cpp +1079 -0
- data/ext/alphatau/native/sdl/src/hidapi/android/jni/Android.mk +16 -0
- data/ext/alphatau/native/sdl/src/hidapi/android/jni/Application.mk +2 -0
- data/ext/alphatau/native/sdl/src/hidapi/android/project.properties +14 -0
- data/ext/alphatau/native/sdl/src/hidapi/bootstrap +2 -0
- data/ext/alphatau/native/sdl/src/hidapi/configure.ac +236 -0
- data/ext/alphatau/native/sdl/src/hidapi/doxygen/Doxyfile +1630 -0
- data/ext/alphatau/native/sdl/src/hidapi/hidapi/hidapi.h +398 -0
- data/ext/alphatau/native/sdl/src/hidapi/hidtest/Makefile.am +20 -0
- data/ext/alphatau/native/sdl/src/hidapi/hidtest/hidtest.cpp +194 -0
- data/ext/alphatau/native/sdl/src/hidapi/ios/Makefile-manual +32 -0
- data/ext/alphatau/native/sdl/src/hidapi/ios/Makefile.am +9 -0
- data/ext/alphatau/native/sdl/src/hidapi/ios/hid.m +909 -0
- data/ext/alphatau/native/sdl/src/hidapi/libusb/Makefile-manual +18 -0
- data/ext/alphatau/native/sdl/src/hidapi/libusb/Makefile.am +27 -0
- data/ext/alphatau/native/sdl/src/hidapi/libusb/Makefile.freebsd +46 -0
- data/ext/alphatau/native/sdl/src/hidapi/libusb/Makefile.linux +49 -0
- data/ext/alphatau/native/sdl/src/hidapi/libusb/hid.c +1615 -0
- data/ext/alphatau/native/sdl/src/hidapi/libusb/hidusb.cpp +3 -0
- data/ext/alphatau/native/sdl/src/hidapi/linux/Makefile-manual +49 -0
- data/ext/alphatau/native/sdl/src/hidapi/linux/Makefile.am +10 -0
- data/ext/alphatau/native/sdl/src/hidapi/linux/README.txt +59 -0
- data/ext/alphatau/native/sdl/src/hidapi/linux/hid.c +893 -0
- data/ext/alphatau/native/sdl/src/hidapi/linux/hid.cpp +333 -0
- data/ext/alphatau/native/sdl/src/hidapi/linux/hidraw.cpp +3 -0
- data/ext/alphatau/native/sdl/src/hidapi/m4/ax_pthread.m4 +309 -0
- data/ext/alphatau/native/sdl/src/hidapi/m4/pkg.m4 +157 -0
- data/ext/alphatau/native/sdl/src/hidapi/mac/Makefile-manual +32 -0
- data/ext/alphatau/native/sdl/src/hidapi/mac/Makefile.am +9 -0
- data/ext/alphatau/native/sdl/src/hidapi/mac/hid.c +1186 -0
- data/ext/alphatau/native/sdl/src/hidapi/pc/hidapi-hidraw.pc.in +10 -0
- data/ext/alphatau/native/sdl/src/hidapi/pc/hidapi-libusb.pc.in +10 -0
- data/ext/alphatau/native/sdl/src/hidapi/pc/hidapi.pc.in +10 -0
- data/ext/alphatau/native/sdl/src/hidapi/testgui/Makefile-manual +26 -0
- data/ext/alphatau/native/sdl/src/hidapi/testgui/Makefile.am +43 -0
- data/ext/alphatau/native/sdl/src/hidapi/testgui/Makefile.freebsd +33 -0
- data/ext/alphatau/native/sdl/src/hidapi/testgui/Makefile.linux +32 -0
- data/ext/alphatau/native/sdl/src/hidapi/testgui/Makefile.mac +46 -0
- data/ext/alphatau/native/sdl/src/hidapi/testgui/Makefile.mingw +32 -0
- data/ext/alphatau/native/sdl/src/hidapi/testgui/TestGUI.app.in/Contents/Info.plist +28 -0
- data/ext/alphatau/native/sdl/src/hidapi/testgui/TestGUI.app.in/Contents/PkgInfo +1 -0
- data/ext/alphatau/native/sdl/src/hidapi/testgui/TestGUI.app.in/Contents/Resources/English.lproj/InfoPlist.strings +0 -0
- data/ext/alphatau/native/sdl/src/hidapi/testgui/TestGUI.app.in/Contents/Resources/Signal11.icns +0 -0
- data/ext/alphatau/native/sdl/src/hidapi/testgui/copy_to_bundle.sh +97 -0
- data/ext/alphatau/native/sdl/src/hidapi/testgui/mac_support.cpp +134 -0
- data/ext/alphatau/native/sdl/src/hidapi/testgui/mac_support.h +17 -0
- data/ext/alphatau/native/sdl/src/hidapi/testgui/mac_support_cocoa.m +94 -0
- data/ext/alphatau/native/sdl/src/hidapi/testgui/start.sh +2 -0
- data/ext/alphatau/native/sdl/src/hidapi/testgui/test.cpp +532 -0
- data/ext/alphatau/native/sdl/src/hidapi/testgui/testgui.sln +20 -0
- data/ext/alphatau/native/sdl/src/hidapi/testgui/testgui.vcproj +217 -0
- data/ext/alphatau/native/sdl/src/hidapi/udev/99-hid.rules +33 -0
- data/ext/alphatau/native/sdl/src/hidapi/windows/Makefile-manual +14 -0
- data/ext/alphatau/native/sdl/src/hidapi/windows/Makefile.am +16 -0
- data/ext/alphatau/native/sdl/src/hidapi/windows/Makefile.mingw +35 -0
- data/ext/alphatau/native/sdl/src/hidapi/windows/ddk_build/hidapi.def +17 -0
- data/ext/alphatau/native/sdl/src/hidapi/windows/ddk_build/makefile +49 -0
- data/ext/alphatau/native/sdl/src/hidapi/windows/ddk_build/sources +23 -0
- data/ext/alphatau/native/sdl/src/hidapi/windows/hid.c +983 -0
- data/ext/alphatau/native/sdl/src/hidapi/windows/hidapi.sln +29 -0
- data/ext/alphatau/native/sdl/src/hidapi/windows/hidapi.vcproj +201 -0
- data/ext/alphatau/native/sdl/src/hidapi/windows/hidtest.vcproj +196 -0
- data/ext/alphatau/native/sdl/src/joystick/SDL_gamecontroller.c +2066 -0
- data/ext/alphatau/native/sdl/src/joystick/SDL_gamecontrollerdb.h +583 -0
- data/ext/alphatau/native/sdl/src/joystick/SDL_joystick.c +1547 -0
- data/ext/alphatau/native/sdl/src/joystick/SDL_joystick_c.h +94 -0
- data/ext/alphatau/native/sdl/src/joystick/SDL_sysjoystick.h +153 -0
- data/ext/alphatau/native/sdl/src/joystick/android/SDL_sysjoystick.c +703 -0
- data/ext/alphatau/native/sdl/src/joystick/android/SDL_sysjoystick_c.h +59 -0
- data/ext/alphatau/native/sdl/src/joystick/bsd/SDL_sysjoystick.c +701 -0
- data/ext/alphatau/native/sdl/src/joystick/controller_type.h +457 -0
- data/ext/alphatau/native/sdl/src/joystick/darwin/SDL_sysjoystick.c +1012 -0
- data/ext/alphatau/native/sdl/src/joystick/darwin/SDL_sysjoystick_c.h +79 -0
- data/ext/alphatau/native/sdl/src/joystick/dummy/SDL_sysjoystick.c +113 -0
- data/ext/alphatau/native/sdl/src/joystick/emscripten/SDL_sysjoystick.c +406 -0
- data/ext/alphatau/native/sdl/src/joystick/emscripten/SDL_sysjoystick_c.h +52 -0
- data/ext/alphatau/native/sdl/src/joystick/haiku/SDL_haikujoystick.cc +272 -0
- data/ext/alphatau/native/sdl/src/joystick/hidapi/SDL_hidapi_ps4.c +545 -0
- data/ext/alphatau/native/sdl/src/joystick/hidapi/SDL_hidapi_switch.c +905 -0
- data/ext/alphatau/native/sdl/src/joystick/hidapi/SDL_hidapi_xbox360.c +461 -0
- data/ext/alphatau/native/sdl/src/joystick/hidapi/SDL_hidapi_xboxone.c +318 -0
- data/ext/alphatau/native/sdl/src/joystick/hidapi/SDL_hidapijoystick.c +1021 -0
- data/ext/alphatau/native/sdl/src/joystick/hidapi/SDL_hidapijoystick_c.h +72 -0
- data/ext/alphatau/native/sdl/src/joystick/iphoneos/SDL_sysjoystick.m +727 -0
- data/ext/alphatau/native/sdl/src/joystick/iphoneos/SDL_sysjoystick_c.h +57 -0
- data/ext/alphatau/native/sdl/src/joystick/linux/SDL_sysjoystick.c +1116 -0
- data/ext/alphatau/native/sdl/src/joystick/linux/SDL_sysjoystick_c.h +64 -0
- data/ext/alphatau/native/sdl/src/joystick/psp/SDL_sysjoystick.c +264 -0
- data/ext/alphatau/native/sdl/src/joystick/sort_controllers.py +78 -0
- data/ext/alphatau/native/sdl/src/joystick/steam/SDL_steamcontroller.c +52 -0
- data/ext/alphatau/native/sdl/src/joystick/steam/SDL_steamcontroller.h +33 -0
- data/ext/alphatau/native/sdl/src/joystick/windows/SDL_dinputjoystick.c +1155 -0
- data/ext/alphatau/native/sdl/src/joystick/windows/SDL_dinputjoystick_c.h +31 -0
- data/ext/alphatau/native/sdl/src/joystick/windows/SDL_mmjoystick.c +452 -0
- data/ext/alphatau/native/sdl/src/joystick/windows/SDL_windowsjoystick.c +558 -0
- data/ext/alphatau/native/sdl/src/joystick/windows/SDL_windowsjoystick_c.h +95 -0
- data/ext/alphatau/native/sdl/src/joystick/windows/SDL_xinputjoystick.c +558 -0
- data/ext/alphatau/native/sdl/src/joystick/windows/SDL_xinputjoystick_c.h +34 -0
- data/ext/alphatau/native/sdl/src/libm/e_atan2.c +134 -0
- data/ext/alphatau/native/sdl/src/libm/e_exp.c +187 -0
- data/ext/alphatau/native/sdl/src/libm/e_fmod.c +144 -0
- data/ext/alphatau/native/sdl/src/libm/e_log.c +152 -0
- data/ext/alphatau/native/sdl/src/libm/e_log10.c +106 -0
- data/ext/alphatau/native/sdl/src/libm/e_pow.c +343 -0
- data/ext/alphatau/native/sdl/src/libm/e_rem_pio2.c +161 -0
- data/ext/alphatau/native/sdl/src/libm/e_sqrt.c +457 -0
- data/ext/alphatau/native/sdl/src/libm/k_cos.c +82 -0
- data/ext/alphatau/native/sdl/src/libm/k_rem_pio2.c +317 -0
- data/ext/alphatau/native/sdl/src/libm/k_sin.c +65 -0
- data/ext/alphatau/native/sdl/src/libm/k_tan.c +118 -0
- data/ext/alphatau/native/sdl/src/libm/math_libm.h +41 -0
- data/ext/alphatau/native/sdl/src/libm/math_private.h +227 -0
- data/ext/alphatau/native/sdl/src/libm/s_atan.c +114 -0
- data/ext/alphatau/native/sdl/src/libm/s_copysign.c +29 -0
- data/ext/alphatau/native/sdl/src/libm/s_cos.c +73 -0
- data/ext/alphatau/native/sdl/src/libm/s_fabs.c +29 -0
- data/ext/alphatau/native/sdl/src/libm/s_floor.c +71 -0
- data/ext/alphatau/native/sdl/src/libm/s_scalbn.c +69 -0
- data/ext/alphatau/native/sdl/src/libm/s_sin.c +73 -0
- data/ext/alphatau/native/sdl/src/libm/s_tan.c +67 -0
- data/ext/alphatau/native/sdl/src/loadso/dlopen/SDL_sysloadso.c +88 -0
- data/ext/alphatau/native/sdl/src/loadso/dummy/SDL_sysloadso.c +54 -0
- data/ext/alphatau/native/sdl/src/loadso/windows/SDL_sysloadso.c +80 -0
- data/ext/alphatau/native/sdl/src/main/android/SDL_android_main.c +7 -0
- data/ext/alphatau/native/sdl/src/main/dummy/SDL_dummy_main.c +28 -0
- data/ext/alphatau/native/sdl/src/main/haiku/SDL_BApp.h +399 -0
- data/ext/alphatau/native/sdl/src/main/haiku/SDL_BeApp.cc +157 -0
- data/ext/alphatau/native/sdl/src/main/haiku/SDL_BeApp.h +38 -0
- data/ext/alphatau/native/sdl/src/main/nacl/SDL_nacl_main.c +93 -0
- data/ext/alphatau/native/sdl/src/main/psp/SDL_psp_main.c +70 -0
- data/ext/alphatau/native/sdl/src/main/windows/SDL_windows_main.c +207 -0
- data/ext/alphatau/native/sdl/src/main/windows/version.rc +38 -0
- data/ext/alphatau/native/sdl/src/main/winrt/SDL2-WinRTResource_BlankCursor.cur +0 -0
- data/ext/alphatau/native/sdl/src/main/winrt/SDL2-WinRTResources.rc +3 -0
- data/ext/alphatau/native/sdl/src/main/winrt/SDL_winrt_main_NonXAML.cpp +54 -0
- data/ext/alphatau/native/sdl/src/power/SDL_power.c +116 -0
- data/ext/alphatau/native/sdl/src/power/SDL_syspower.h +47 -0
- data/ext/alphatau/native/sdl/src/power/android/SDL_syspower.c +64 -0
- data/ext/alphatau/native/sdl/src/power/emscripten/SDL_syspower.c +62 -0
- data/ext/alphatau/native/sdl/src/power/haiku/SDL_syspower.c +128 -0
- data/ext/alphatau/native/sdl/src/power/linux/SDL_syspower.c +642 -0
- data/ext/alphatau/native/sdl/src/power/macosx/SDL_syspower.c +192 -0
- data/ext/alphatau/native/sdl/src/power/psp/SDL_syspower.c +68 -0
- data/ext/alphatau/native/sdl/src/power/uikit/SDL_syspower.h +32 -0
- data/ext/alphatau/native/sdl/src/power/uikit/SDL_syspower.m +113 -0
- data/ext/alphatau/native/sdl/src/power/windows/SDL_syspower.c +76 -0
- data/ext/alphatau/native/sdl/src/power/winrt/SDL_syspower.cpp +44 -0
- data/ext/alphatau/native/sdl/src/render/SDL_d3dmath.c +136 -0
- data/ext/alphatau/native/sdl/src/render/SDL_d3dmath.h +72 -0
- data/ext/alphatau/native/sdl/src/render/SDL_render.c +2292 -0
- data/ext/alphatau/native/sdl/src/render/SDL_sysrender.h +214 -0
- data/ext/alphatau/native/sdl/src/render/SDL_yuv_sw.c +414 -0
- data/ext/alphatau/native/sdl/src/render/SDL_yuv_sw_c.h +67 -0
- data/ext/alphatau/native/sdl/src/render/direct3d/SDL_render_d3d.c +1813 -0
- data/ext/alphatau/native/sdl/src/render/direct3d/SDL_shaders_d3d.c +274 -0
- data/ext/alphatau/native/sdl/src/render/direct3d/SDL_shaders_d3d.h +34 -0
- data/ext/alphatau/native/sdl/src/render/direct3d11/SDL_render_d3d11.c +2559 -0
- data/ext/alphatau/native/sdl/src/render/direct3d11/SDL_render_winrt.cpp +116 -0
- data/ext/alphatau/native/sdl/src/render/direct3d11/SDL_render_winrt.h +40 -0
- data/ext/alphatau/native/sdl/src/render/direct3d11/SDL_shaders_d3d11.c +1957 -0
- data/ext/alphatau/native/sdl/src/render/direct3d11/SDL_shaders_d3d11.h +43 -0
- data/ext/alphatau/native/sdl/src/render/metal/SDL_render_metal.m +1428 -0
- data/ext/alphatau/native/sdl/src/render/metal/SDL_shaders_metal.metal +109 -0
- data/ext/alphatau/native/sdl/src/render/metal/SDL_shaders_metal_ios.h +1899 -0
- data/ext/alphatau/native/sdl/src/render/metal/SDL_shaders_metal_osx.h +1903 -0
- data/ext/alphatau/native/sdl/src/render/metal/build-metal-shaders.sh +18 -0
- data/ext/alphatau/native/sdl/src/render/opengl/SDL_glfuncs.h +478 -0
- data/ext/alphatau/native/sdl/src/render/opengl/SDL_render_gl.c +1678 -0
- data/ext/alphatau/native/sdl/src/render/opengl/SDL_shaders_gl.c +524 -0
- data/ext/alphatau/native/sdl/src/render/opengl/SDL_shaders_gl.h +47 -0
- data/ext/alphatau/native/sdl/src/render/opengles/SDL_glesfuncs.h +65 -0
- data/ext/alphatau/native/sdl/src/render/opengles/SDL_render_gles.c +1278 -0
- data/ext/alphatau/native/sdl/src/render/opengles2/SDL_gles2funcs.h +80 -0
- data/ext/alphatau/native/sdl/src/render/opengles2/SDL_render_gles2.c +2256 -0
- data/ext/alphatau/native/sdl/src/render/opengles2/SDL_shaders_gles2.c +569 -0
- data/ext/alphatau/native/sdl/src/render/opengles2/SDL_shaders_gles2.h +70 -0
- data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/Makefile +41 -0
- data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/convert_gl2_h_into_gles2_stubcall_overs_c.sno +181 -0
- data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/convert_gl2_h_into_gles2_stubcall_overs_h.sno +116 -0
- data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/convert_gl2_h_into_gles2funcs_h.sno +82 -0
- data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/convert_gles2funcs_into_gles2_define_overs_h.sno +42 -0
- data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/gl2.h +686 -0
- data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/readme.txt +70 -0
- data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/testgles2.c +725 -0
- data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/triangle.c +147 -0
- data/ext/alphatau/native/sdl/src/render/psp/SDL_render_psp.c +1016 -0
- data/ext/alphatau/native/sdl/src/render/software/SDL_blendfillrect.c +336 -0
- data/ext/alphatau/native/sdl/src/render/software/SDL_blendfillrect.h +27 -0
- data/ext/alphatau/native/sdl/src/render/software/SDL_blendline.c +777 -0
- data/ext/alphatau/native/sdl/src/render/software/SDL_blendline.h +27 -0
- data/ext/alphatau/native/sdl/src/render/software/SDL_blendpoint.c +341 -0
- data/ext/alphatau/native/sdl/src/render/software/SDL_blendpoint.h +27 -0
- data/ext/alphatau/native/sdl/src/render/software/SDL_draw.h +576 -0
- data/ext/alphatau/native/sdl/src/render/software/SDL_drawline.c +209 -0
- data/ext/alphatau/native/sdl/src/render/software/SDL_drawline.h +27 -0
- data/ext/alphatau/native/sdl/src/render/software/SDL_drawpoint.c +114 -0
- data/ext/alphatau/native/sdl/src/render/software/SDL_drawpoint.h +27 -0
- data/ext/alphatau/native/sdl/src/render/software/SDL_render_sw.c +882 -0
- data/ext/alphatau/native/sdl/src/render/software/SDL_render_sw_c.h +24 -0
- data/ext/alphatau/native/sdl/src/render/software/SDL_rotate.c +530 -0
- data/ext/alphatau/native/sdl/src/render/software/SDL_rotate.h +28 -0
- data/ext/alphatau/native/sdl/src/sensor/SDL_sensor.c +546 -0
- data/ext/alphatau/native/sdl/src/sensor/SDL_sensor_c.h +38 -0
- data/ext/alphatau/native/sdl/src/sensor/SDL_syssensor.h +99 -0
- data/ext/alphatau/native/sdl/src/sensor/android/SDL_androidsensor.c +211 -0
- data/ext/alphatau/native/sdl/src/sensor/android/SDL_androidsensor.h +31 -0
- data/ext/alphatau/native/sdl/src/sensor/coremotion/SDL_coremotionsensor.h +30 -0
- data/ext/alphatau/native/sdl/src/sensor/coremotion/SDL_coremotionsensor.m +234 -0
- data/ext/alphatau/native/sdl/src/sensor/dummy/SDL_dummysensor.c +110 -0
- data/ext/alphatau/native/sdl/src/sensor/dummy/SDL_dummysensor.h +23 -0
- data/ext/alphatau/native/sdl/src/stdlib/SDL_getenv.c +315 -0
- data/ext/alphatau/native/sdl/src/stdlib/SDL_iconv.c +934 -0
- data/ext/alphatau/native/sdl/src/stdlib/SDL_malloc.c +5376 -0
- data/ext/alphatau/native/sdl/src/stdlib/SDL_qsort.c +534 -0
- data/ext/alphatau/native/sdl/src/stdlib/SDL_stdlib.c +1155 -0
- data/ext/alphatau/native/sdl/src/stdlib/SDL_string.c +1737 -0
- data/ext/alphatau/native/sdl/src/test/SDL_test_assert.c +152 -0
- data/ext/alphatau/native/sdl/src/test/SDL_test_common.c +1826 -0
- data/ext/alphatau/native/sdl/src/test/SDL_test_compare.c +117 -0
- data/ext/alphatau/native/sdl/src/test/SDL_test_crc32.c +166 -0
- data/ext/alphatau/native/sdl/src/test/SDL_test_font.c +3250 -0
- data/ext/alphatau/native/sdl/src/test/SDL_test_fuzzer.c +534 -0
- data/ext/alphatau/native/sdl/src/test/SDL_test_harness.c +683 -0
- data/ext/alphatau/native/sdl/src/test/SDL_test_imageBlit.c +1559 -0
- data/ext/alphatau/native/sdl/src/test/SDL_test_imageBlitBlend.c +2845 -0
- data/ext/alphatau/native/sdl/src/test/SDL_test_imageFace.c +247 -0
- data/ext/alphatau/native/sdl/src/test/SDL_test_imagePrimitives.c +514 -0
- data/ext/alphatau/native/sdl/src/test/SDL_test_imagePrimitivesBlend.c +696 -0
- data/ext/alphatau/native/sdl/src/test/SDL_test_log.c +118 -0
- data/ext/alphatau/native/sdl/src/test/SDL_test_md5.c +338 -0
- data/ext/alphatau/native/sdl/src/test/SDL_test_memory.c +274 -0
- data/ext/alphatau/native/sdl/src/test/SDL_test_random.c +96 -0
- data/ext/alphatau/native/sdl/src/thread/SDL_systhread.h +70 -0
- data/ext/alphatau/native/sdl/src/thread/SDL_thread.c +503 -0
- data/ext/alphatau/native/sdl/src/thread/SDL_thread_c.h +95 -0
- data/ext/alphatau/native/sdl/src/thread/generic/SDL_syscond.c +220 -0
- data/ext/alphatau/native/sdl/src/thread/generic/SDL_sysmutex.c +165 -0
- data/ext/alphatau/native/sdl/src/thread/generic/SDL_sysmutex_c.h +22 -0
- data/ext/alphatau/native/sdl/src/thread/generic/SDL_syssem.c +217 -0
- data/ext/alphatau/native/sdl/src/thread/generic/SDL_systhread.c +71 -0
- data/ext/alphatau/native/sdl/src/thread/generic/SDL_systhread_c.h +26 -0
- data/ext/alphatau/native/sdl/src/thread/generic/SDL_systls.c +38 -0
- data/ext/alphatau/native/sdl/src/thread/psp/SDL_syscond.c +224 -0
- data/ext/alphatau/native/sdl/src/thread/psp/SDL_sysmutex.c +136 -0
- data/ext/alphatau/native/sdl/src/thread/psp/SDL_sysmutex_c.h +22 -0
- data/ext/alphatau/native/sdl/src/thread/psp/SDL_syssem.c +161 -0
- data/ext/alphatau/native/sdl/src/thread/psp/SDL_systhread.c +114 -0
- data/ext/alphatau/native/sdl/src/thread/psp/SDL_systhread_c.h +24 -0
- data/ext/alphatau/native/sdl/src/thread/pthread/SDL_syscond.c +158 -0
- data/ext/alphatau/native/sdl/src/thread/pthread/SDL_sysmutex.c +195 -0
- data/ext/alphatau/native/sdl/src/thread/pthread/SDL_sysmutex_c.h +32 -0
- data/ext/alphatau/native/sdl/src/thread/pthread/SDL_syssem.c +209 -0
- data/ext/alphatau/native/sdl/src/thread/pthread/SDL_systhread.c +324 -0
- data/ext/alphatau/native/sdl/src/thread/pthread/SDL_systhread_c.h +27 -0
- data/ext/alphatau/native/sdl/src/thread/pthread/SDL_systls.c +70 -0
- data/ext/alphatau/native/sdl/src/thread/stdcpp/SDL_syscond.cpp +164 -0
- data/ext/alphatau/native/sdl/src/thread/stdcpp/SDL_sysmutex.cpp +111 -0
- data/ext/alphatau/native/sdl/src/thread/stdcpp/SDL_sysmutex_c.h +30 -0
- data/ext/alphatau/native/sdl/src/thread/stdcpp/SDL_systhread.cpp +168 -0
- data/ext/alphatau/native/sdl/src/thread/stdcpp/SDL_systhread_c.h +26 -0
- data/ext/alphatau/native/sdl/src/thread/windows/SDL_sysmutex.c +110 -0
- data/ext/alphatau/native/sdl/src/thread/windows/SDL_syssem.c +152 -0
- data/ext/alphatau/native/sdl/src/thread/windows/SDL_systhread.c +260 -0
- data/ext/alphatau/native/sdl/src/thread/windows/SDL_systhread_c.h +32 -0
- data/ext/alphatau/native/sdl/src/thread/windows/SDL_systls.c +72 -0
- data/ext/alphatau/native/sdl/src/timer/SDL_timer.c +373 -0
- data/ext/alphatau/native/sdl/src/timer/SDL_timer_c.h +34 -0
- data/ext/alphatau/native/sdl/src/timer/dummy/SDL_systimer.c +75 -0
- data/ext/alphatau/native/sdl/src/timer/haiku/SDL_systimer.c +80 -0
- data/ext/alphatau/native/sdl/src/timer/psp/SDL_systimer.c +91 -0
- data/ext/alphatau/native/sdl/src/timer/unix/SDL_systimer.c +232 -0
- data/ext/alphatau/native/sdl/src/timer/windows/SDL_systimer.c +200 -0
- data/ext/alphatau/native/sdl/src/video/SDL_RLEaccel.c +1581 -0
- data/ext/alphatau/native/sdl/src/video/SDL_RLEaccel_c.h +31 -0
- data/ext/alphatau/native/sdl/src/video/SDL_blit.c +296 -0
- data/ext/alphatau/native/sdl/src/video/SDL_blit.h +553 -0
- data/ext/alphatau/native/sdl/src/video/SDL_blit_0.c +483 -0
- data/ext/alphatau/native/sdl/src/video/SDL_blit_1.c +552 -0
- data/ext/alphatau/native/sdl/src/video/SDL_blit_A.c +1388 -0
- data/ext/alphatau/native/sdl/src/video/SDL_blit_N.c +2647 -0
- data/ext/alphatau/native/sdl/src/video/SDL_blit_auto.c +7419 -0
- data/ext/alphatau/native/sdl/src/video/SDL_blit_auto.h +30 -0
- data/ext/alphatau/native/sdl/src/video/SDL_blit_copy.c +162 -0
- data/ext/alphatau/native/sdl/src/video/SDL_blit_copy.h +24 -0
- data/ext/alphatau/native/sdl/src/video/SDL_blit_slow.c +164 -0
- data/ext/alphatau/native/sdl/src/video/SDL_blit_slow.h +25 -0
- data/ext/alphatau/native/sdl/src/video/SDL_bmp.c +702 -0
- data/ext/alphatau/native/sdl/src/video/SDL_clipboard.c +90 -0
- data/ext/alphatau/native/sdl/src/video/SDL_egl.c +899 -0
- data/ext/alphatau/native/sdl/src/video/SDL_egl_c.h +149 -0
- data/ext/alphatau/native/sdl/src/video/SDL_fillrect.c +343 -0
- data/ext/alphatau/native/sdl/src/video/SDL_pixels.c +1125 -0
- data/ext/alphatau/native/sdl/src/video/SDL_pixels_c.h +40 -0
- data/ext/alphatau/native/sdl/src/video/SDL_rect.c +531 -0
- data/ext/alphatau/native/sdl/src/video/SDL_rect_c.h +25 -0
- data/ext/alphatau/native/sdl/src/video/SDL_shape.c +309 -0
- data/ext/alphatau/native/sdl/src/video/SDL_shape_internals.h +69 -0
- data/ext/alphatau/native/sdl/src/video/SDL_stretch.c +353 -0
- data/ext/alphatau/native/sdl/src/video/SDL_surface.c +1232 -0
- data/ext/alphatau/native/sdl/src/video/SDL_sysvideo.h +467 -0
- data/ext/alphatau/native/sdl/src/video/SDL_video.c +4160 -0
- data/ext/alphatau/native/sdl/src/video/SDL_vulkan_internal.h +91 -0
- data/ext/alphatau/native/sdl/src/video/SDL_vulkan_utils.c +172 -0
- data/ext/alphatau/native/sdl/src/video/SDL_yuv.c +1834 -0
- data/ext/alphatau/native/sdl/src/video/SDL_yuv_c.h +30 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidclipboard.c +48 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidclipboard.h +32 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidevents.c +123 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidevents.h +27 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidgl.c +62 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidgl.h +34 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidkeyboard.c +391 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidkeyboard.h +36 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidmessagebox.c +37 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidmessagebox.h +29 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidmouse.c +266 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidmouse.h +33 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidtouch.c +151 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidtouch.h +29 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidvideo.c +259 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidvideo.h +51 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidvulkan.c +175 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidvulkan.h +52 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidwindow.c +175 -0
- data/ext/alphatau/native/sdl/src/video/android/SDL_androidwindow.h +45 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaclipboard.h +36 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaclipboard.m +103 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaevents.h +32 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaevents.m +483 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoakeyboard.h +36 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoakeyboard.m +720 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamessagebox.h +29 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamessagebox.m +145 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoametalview.h +63 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoametalview.m +134 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamodes.h +46 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamodes.m +490 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamouse.h +52 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamouse.m +477 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamousetap.h +34 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamousetap.m +279 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaopengl.h +68 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaopengl.m +428 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaopengles.h +49 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaopengles.m +132 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoashape.h +45 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoashape.m +113 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoavideo.h +118 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoavideo.m +254 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoavulkan.h +55 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoavulkan.m +231 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoawindow.h +155 -0
- data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoawindow.m +1885 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_WM.c +413 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_WM.h +56 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_dyn.c +117 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_dyn.h +41 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_events.c +748 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_events.h +34 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_modes.c +414 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_modes.h +59 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_mouse.c +389 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_mouse.h +44 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_opengl.c +332 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_opengl.h +64 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_render.c +1335 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_render.h +25 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_shape.c +131 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_shape.h +38 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_video.c +418 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_video.h +170 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_window.c +565 -0
- data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_window.h +82 -0
- data/ext/alphatau/native/sdl/src/video/dummy/SDL_nullevents.c +41 -0
- data/ext/alphatau/native/sdl/src/video/dummy/SDL_nullevents_c.h +27 -0
- data/ext/alphatau/native/sdl/src/video/dummy/SDL_nullframebuffer.c +89 -0
- data/ext/alphatau/native/sdl/src/video/dummy/SDL_nullframebuffer_c.h +27 -0
- data/ext/alphatau/native/sdl/src/video/dummy/SDL_nullvideo.c +144 -0
- data/ext/alphatau/native/sdl/src/video/dummy/SDL_nullvideo.h +30 -0
- data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenevents.c +716 -0
- data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenevents.h +40 -0
- data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenframebuffer.c +178 -0
- data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenframebuffer.h +32 -0
- data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenmouse.c +275 -0
- data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenmouse.h +42 -0
- data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenopengles.c +119 -0
- data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenopengles.h +49 -0
- data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenvideo.c +354 -0
- data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenvideo.h +58 -0
- data/ext/alphatau/native/sdl/src/video/haiku/SDL_BWin.h +679 -0
- data/ext/alphatau/native/sdl/src/video/haiku/SDL_bclipboard.cc +95 -0
- data/ext/alphatau/native/sdl/src/video/haiku/SDL_bclipboard.h +33 -0
- data/ext/alphatau/native/sdl/src/video/haiku/SDL_bevents.cc +41 -0
- data/ext/alphatau/native/sdl/src/video/haiku/SDL_bevents.h +39 -0
- data/ext/alphatau/native/sdl/src/video/haiku/SDL_bframebuffer.cc +259 -0
- data/ext/alphatau/native/sdl/src/video/haiku/SDL_bframebuffer.h +47 -0
- data/ext/alphatau/native/sdl/src/video/haiku/SDL_bkeyboard.cc +190 -0
- data/ext/alphatau/native/sdl/src/video/haiku/SDL_bkeyboard.h +44 -0
- data/ext/alphatau/native/sdl/src/video/haiku/SDL_bmodes.cc +333 -0
- data/ext/alphatau/native/sdl/src/video/haiku/SDL_bmodes.h +48 -0
- data/ext/alphatau/native/sdl/src/video/haiku/SDL_bopengl.cc +176 -0
- data/ext/alphatau/native/sdl/src/video/haiku/SDL_bopengl.h +55 -0
- data/ext/alphatau/native/sdl/src/video/haiku/SDL_bvideo.cc +178 -0
- data/ext/alphatau/native/sdl/src/video/haiku/SDL_bvideo.h +44 -0
- data/ext/alphatau/native/sdl/src/video/haiku/SDL_bwindow.cc +233 -0
- data/ext/alphatau/native/sdl/src/video/haiku/SDL_bwindow.h +55 -0
- data/ext/alphatau/native/sdl/src/video/khronos/EGL/egl.h +303 -0
- data/ext/alphatau/native/sdl/src/video/khronos/EGL/eglext.h +1241 -0
- data/ext/alphatau/native/sdl/src/video/khronos/EGL/eglplatform.h +132 -0
- data/ext/alphatau/native/sdl/src/video/khronos/GLES2/gl2.h +675 -0
- data/ext/alphatau/native/sdl/src/video/khronos/GLES2/gl2ext.h +3505 -0
- data/ext/alphatau/native/sdl/src/video/khronos/GLES2/gl2platform.h +38 -0
- data/ext/alphatau/native/sdl/src/video/khronos/KHR/khrplatform.h +284 -0
- data/ext/alphatau/native/sdl/src/video/khronos/vulkan/vk_platform.h +120 -0
- data/ext/alphatau/native/sdl/src/video/khronos/vulkan/vulkan.h +6458 -0
- data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmdyn.c +171 -0
- data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmdyn.h +53 -0
- data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmevents.c +42 -0
- data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmevents.h +31 -0
- data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmmouse.c +501 -0
- data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmmouse.h +45 -0
- data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmopengles.c +189 -0
- data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmopengles.h +48 -0
- data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmsym.h +99 -0
- data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmvideo.c +664 -0
- data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmvideo.h +124 -0
- data/ext/alphatau/native/sdl/src/video/mir/SDL_mirdyn.c +170 -0
- data/ext/alphatau/native/sdl/src/video/mir/SDL_mirdyn.h +53 -0
- data/ext/alphatau/native/sdl/src/video/mir/SDL_mirevents.c +321 -0
- data/ext/alphatau/native/sdl/src/video/mir/SDL_mirevents.h +37 -0
- data/ext/alphatau/native/sdl/src/video/mir/SDL_mirframebuffer.c +134 -0
- data/ext/alphatau/native/sdl/src/video/mir/SDL_mirframebuffer.h +47 -0
- data/ext/alphatau/native/sdl/src/video/mir/SDL_mirmouse.c +292 -0
- data/ext/alphatau/native/sdl/src/video/mir/SDL_mirmouse.h +37 -0
- data/ext/alphatau/native/sdl/src/video/mir/SDL_miropengl.c +78 -0
- data/ext/alphatau/native/sdl/src/video/mir/SDL_miropengl.h +53 -0
- data/ext/alphatau/native/sdl/src/video/mir/SDL_mirsym.h +143 -0
- data/ext/alphatau/native/sdl/src/video/mir/SDL_mirvideo.c +423 -0
- data/ext/alphatau/native/sdl/src/video/mir/SDL_mirvideo.h +49 -0
- data/ext/alphatau/native/sdl/src/video/mir/SDL_mirvulkan.c +176 -0
- data/ext/alphatau/native/sdl/src/video/mir/SDL_mirvulkan.h +52 -0
- data/ext/alphatau/native/sdl/src/video/mir/SDL_mirwindow.c +374 -0
- data/ext/alphatau/native/sdl/src/video/mir/SDL_mirwindow.h +93 -0
- data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclevents.c +438 -0
- data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclevents_c.h +30 -0
- data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclglue.c +24 -0
- data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclopengles.c +174 -0
- data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclopengles.h +38 -0
- data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclvideo.c +183 -0
- data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclvideo.h +67 -0
- data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclwindow.c +79 -0
- data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclwindow.h +32 -0
- data/ext/alphatau/native/sdl/src/video/pandora/SDL_pandora.c +838 -0
- data/ext/alphatau/native/sdl/src/video/pandora/SDL_pandora.h +101 -0
- data/ext/alphatau/native/sdl/src/video/pandora/SDL_pandora_events.c +38 -0
- data/ext/alphatau/native/sdl/src/video/pandora/SDL_pandora_events.h +25 -0
- data/ext/alphatau/native/sdl/src/video/psp/SDL_pspevents.c +290 -0
- data/ext/alphatau/native/sdl/src/video/psp/SDL_pspevents_c.h +31 -0
- data/ext/alphatau/native/sdl/src/video/psp/SDL_pspgl.c +210 -0
- data/ext/alphatau/native/sdl/src/video/psp/SDL_pspgl_c.h +54 -0
- data/ext/alphatau/native/sdl/src/video/psp/SDL_pspmouse.c +41 -0
- data/ext/alphatau/native/sdl/src/video/psp/SDL_pspmouse_c.h +24 -0
- data/ext/alphatau/native/sdl/src/video/psp/SDL_pspvideo.c +333 -0
- data/ext/alphatau/native/sdl/src/video/psp/SDL_pspvideo.h +102 -0
- data/ext/alphatau/native/sdl/src/video/qnx/gl.c +285 -0
- data/ext/alphatau/native/sdl/src/video/qnx/keyboard.c +133 -0
- data/ext/alphatau/native/sdl/src/video/qnx/sdl_qnx.h +48 -0
- data/ext/alphatau/native/sdl/src/video/qnx/video.c +364 -0
- data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpievents.c +45 -0
- data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpievents_c.h +31 -0
- data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpimouse.c +386 -0
- data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpimouse.h +43 -0
- data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpiopengles.c +71 -0
- data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpiopengles.h +49 -0
- data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpivideo.c +442 -0
- data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpivideo.h +104 -0
- data/ext/alphatau/native/sdl/src/video/sdlgenblit.pl +535 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitappdelegate.h +47 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitappdelegate.m +516 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitclipboard.h +35 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitclipboard.m +111 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitevents.h +30 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitevents.m +73 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitmessagebox.h +31 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitmessagebox.m +208 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitmetalview.h +58 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitmetalview.m +131 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitmodes.h +54 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitmodes.m +378 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitopengles.h +40 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitopengles.m +250 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitopenglview.h +60 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitopenglview.m +384 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitvideo.h +46 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitvideo.m +249 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitview.h +41 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitview.m +328 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitviewcontroller.h +91 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitviewcontroller.m +532 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitvulkan.h +54 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitvulkan.m +222 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitwindow.h +56 -0
- data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitwindow.m +465 -0
- data/ext/alphatau/native/sdl/src/video/uikit/keyinfotable.h +174 -0
- data/ext/alphatau/native/sdl/src/video/vivante/SDL_vivanteopengles.c +47 -0
- data/ext/alphatau/native/sdl/src/video/vivante/SDL_vivanteopengles.h +48 -0
- data/ext/alphatau/native/sdl/src/video/vivante/SDL_vivanteplatform.c +54 -0
- data/ext/alphatau/native/sdl/src/video/vivante/SDL_vivanteplatform.h +47 -0
- data/ext/alphatau/native/sdl/src/video/vivante/SDL_vivantevideo.c +409 -0
- data/ext/alphatau/native/sdl/src/video/vivante/SDL_vivantevideo.h +91 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandclipboard.c +123 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandclipboard.h +32 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylanddatamanager.c +468 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylanddatamanager.h +103 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylanddyn.c +178 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylanddyn.h +107 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandevents.c +1134 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandevents_c.h +51 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandmouse.c +396 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandmouse.h +31 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandopengles.c +93 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandopengles.h +49 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandsym.h +127 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandtouch.c +265 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandtouch.h +352 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandvideo.c +517 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandvideo.h +85 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandvulkan.c +176 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandvulkan.h +52 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandwindow.c +684 -0
- data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandwindow.h +88 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_msctf.h +242 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_vkeys.h +76 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsclipboard.c +160 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsclipboard.h +36 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsevents.c +1229 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsevents.h +36 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsframebuffer.c +127 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsframebuffer.h +27 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowskeyboard.c +1579 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowskeyboard.h +40 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsmessagebox.c +905 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsmessagebox.h +29 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsmodes.c +407 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsmodes.h +47 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsmouse.c +322 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsmouse.h +33 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsopengl.c +895 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsopengl.h +142 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsopengles.c +131 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsopengles.h +49 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsshape.c +110 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsshape.h +40 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowstaskdialog.h +156 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsvideo.c +442 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsvideo.h +199 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsvulkan.c +176 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsvulkan.h +52 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowswindow.c +992 -0
- data/ext/alphatau/native/sdl/src/video/windows/SDL_windowswindow.h +86 -0
- data/ext/alphatau/native/sdl/src/video/windows/wmmsg.h +1052 -0
- data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtevents.cpp +154 -0
- data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtevents_c.h +82 -0
- data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtgamebar.cpp +196 -0
- data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtgamebar_cpp.h +35 -0
- data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtkeyboard.cpp +430 -0
- data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtmessagebox.cpp +112 -0
- data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtmessagebox.h +29 -0
- data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtmouse.cpp +224 -0
- data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtmouse_c.h +40 -0
- data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtopengles.cpp +203 -0
- data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtopengles.h +70 -0
- data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtpointerinput.cpp +415 -0
- data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtvideo.cpp +842 -0
- data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtvideo_cpp.h +106 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11clipboard.c +199 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11clipboard.h +33 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11dyn.c +212 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11dyn.h +111 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11events.c +1500 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11events.h +31 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11framebuffer.c +257 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11framebuffer.h +31 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11keyboard.c +543 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11keyboard.h +36 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11messagebox.c +853 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11messagebox.h +28 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11modes.c +1112 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11modes.h +85 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11mouse.c +448 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11mouse.h +31 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11opengl.c +946 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11opengl.h +84 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11opengles.c +109 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11opengles.h +56 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11shape.c +115 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11shape.h +39 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11sym.h +337 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11touch.c +54 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11touch.h +32 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11video.c +497 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11video.h +156 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11vulkan.c +243 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11vulkan.h +48 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11window.c +1619 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11window.h +111 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11xinput2.c +313 -0
- data/ext/alphatau/native/sdl/src/video/x11/SDL_x11xinput2.h +42 -0
- data/ext/alphatau/native/sdl/src/video/x11/edid-parse.c +754 -0
- data/ext/alphatau/native/sdl/src/video/x11/edid.h +167 -0
- data/ext/alphatau/native/sdl/src/video/x11/imKStoUCS.c +350 -0
- data/ext/alphatau/native/sdl/src/video/x11/imKStoUCS.h +32 -0
- data/ext/alphatau/native/sdl/src/video/yuv2rgb/LICENSE +27 -0
- data/ext/alphatau/native/sdl/src/video/yuv2rgb/README.md +63 -0
- data/ext/alphatau/native/sdl/src/video/yuv2rgb/yuv_rgb.c +687 -0
- data/ext/alphatau/native/sdl/src/video/yuv2rgb/yuv_rgb.h +381 -0
- data/ext/alphatau/native/sdl/src/video/yuv2rgb/yuv_rgb_sse_func.h +498 -0
- data/ext/alphatau/native/sdl/src/video/yuv2rgb/yuv_rgb_std_func.h +228 -0
- data/ext/alphatau/native/sdl/test/CMakeLists.txt +122 -0
- data/ext/alphatau/native/sdl/test/COPYING +8 -0
- data/ext/alphatau/native/sdl/test/Makefile.in +328 -0
- data/ext/alphatau/native/sdl/test/README +47 -0
- data/ext/alphatau/native/sdl/test/acinclude.m4 +359 -0
- data/ext/alphatau/native/sdl/test/aclocal.m4 +359 -0
- data/ext/alphatau/native/sdl/test/autogen.sh +12 -0
- data/ext/alphatau/native/sdl/test/axis.bmp +0 -0
- data/ext/alphatau/native/sdl/test/button.bmp +0 -0
- data/ext/alphatau/native/sdl/test/checkkeys.c +248 -0
- data/ext/alphatau/native/sdl/test/configure +5124 -0
- data/ext/alphatau/native/sdl/test/configure.in +191 -0
- data/ext/alphatau/native/sdl/test/controllermap.bmp +0 -0
- data/ext/alphatau/native/sdl/test/controllermap.c +781 -0
- data/ext/alphatau/native/sdl/test/emscripten/joystick-pre.js +25 -0
- data/ext/alphatau/native/sdl/test/gcc-fat.sh +110 -0
- data/ext/alphatau/native/sdl/test/icon.bmp +0 -0
- data/ext/alphatau/native/sdl/test/loopwave.c +179 -0
- data/ext/alphatau/native/sdl/test/loopwavequeue.c +149 -0
- data/ext/alphatau/native/sdl/test/moose.dat +0 -0
- data/ext/alphatau/native/sdl/test/nacl/Makefile +63 -0
- data/ext/alphatau/native/sdl/test/nacl/background.js +40 -0
- data/ext/alphatau/native/sdl/test/nacl/common.js +474 -0
- data/ext/alphatau/native/sdl/test/nacl/index.html +21 -0
- data/ext/alphatau/native/sdl/test/nacl/manifest.json +22 -0
- data/ext/alphatau/native/sdl/test/picture.xbm +14 -0
- data/ext/alphatau/native/sdl/test/relative_mode.markdown +58 -0
- data/ext/alphatau/native/sdl/test/sample.bmp +0 -0
- data/ext/alphatau/native/sdl/test/sample.wav +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p01_shape24.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p01_shape32alpha.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p01_shape8.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p02_shape24.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p02_shape32alpha.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p02_shape8.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p03_shape24.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p03_shape8.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p04_shape1.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p04_shape24.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p04_shape32alpha.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p04_shape8.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p05_shape8.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p06_shape1alpha.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p06_shape24.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p06_shape32alpha.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p06_shape8.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p07_shape24.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p07_shape32alpha.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p07_shape8.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p08_shape24.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p08_shape32alpha.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p08_shape8.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p09_shape24.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p09_shape32alpha.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p09_shape8.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p10_shape1.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p10_shape24.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p10_shape32alpha.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p10_shape8.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p11_shape24.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p11_shape32alpha.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p11_shape8.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p12_shape24.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p12_shape8.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p13_shape24.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p13_shape32alpha.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p13_shape8.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p14_shape24.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p14_shape8.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p15_shape24.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p15_shape32alpha.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p15_shape8.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p16_shape1.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p16_shape24.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/p16_shape8.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/trollface_24.bmp +0 -0
- data/ext/alphatau/native/sdl/test/shapes/trollface_32alpha.bmp +0 -0
- data/ext/alphatau/native/sdl/test/testatomic.c +727 -0
- data/ext/alphatau/native/sdl/test/testaudiocapture.c +165 -0
- data/ext/alphatau/native/sdl/test/testaudiohotplug.c +203 -0
- data/ext/alphatau/native/sdl/test/testaudioinfo.c +74 -0
- data/ext/alphatau/native/sdl/test/testautomation.c +124 -0
- data/ext/alphatau/native/sdl/test/testautomation_audio.c +1038 -0
- data/ext/alphatau/native/sdl/test/testautomation_clipboard.c +184 -0
- data/ext/alphatau/native/sdl/test/testautomation_events.c +201 -0
- data/ext/alphatau/native/sdl/test/testautomation_hints.c +168 -0
- data/ext/alphatau/native/sdl/test/testautomation_keyboard.c +713 -0
- data/ext/alphatau/native/sdl/test/testautomation_main.c +157 -0
- data/ext/alphatau/native/sdl/test/testautomation_mouse.c +606 -0
- data/ext/alphatau/native/sdl/test/testautomation_pixels.c +529 -0
- data/ext/alphatau/native/sdl/test/testautomation_platform.c +584 -0
- data/ext/alphatau/native/sdl/test/testautomation_rect.c +1696 -0
- data/ext/alphatau/native/sdl/test/testautomation_render.c +1099 -0
- data/ext/alphatau/native/sdl/test/testautomation_rwops.c +748 -0
- data/ext/alphatau/native/sdl/test/testautomation_sdltest.c +1319 -0
- data/ext/alphatau/native/sdl/test/testautomation_stdlib.c +319 -0
- data/ext/alphatau/native/sdl/test/testautomation_suites.h +54 -0
- data/ext/alphatau/native/sdl/test/testautomation_surface.c +647 -0
- data/ext/alphatau/native/sdl/test/testautomation_syswm.c +61 -0
- data/ext/alphatau/native/sdl/test/testautomation_timer.c +201 -0
- data/ext/alphatau/native/sdl/test/testautomation_video.c +1811 -0
- data/ext/alphatau/native/sdl/test/testbounds.c +40 -0
- data/ext/alphatau/native/sdl/test/testcustomcursor.c +259 -0
- data/ext/alphatau/native/sdl/test/testdisplayinfo.c +96 -0
- data/ext/alphatau/native/sdl/test/testdraw2.c +305 -0
- data/ext/alphatau/native/sdl/test/testdrawchessboard.c +147 -0
- data/ext/alphatau/native/sdl/test/testdropfile.c +98 -0
- data/ext/alphatau/native/sdl/test/testerror.c +76 -0
- data/ext/alphatau/native/sdl/test/testfile.c +283 -0
- data/ext/alphatau/native/sdl/test/testfilesystem.c +60 -0
- data/ext/alphatau/native/sdl/test/testgamecontroller.c +375 -0
- data/ext/alphatau/native/sdl/test/testgesture.c +309 -0
- data/ext/alphatau/native/sdl/test/testgl2.c +416 -0
- data/ext/alphatau/native/sdl/test/testgles.c +355 -0
- data/ext/alphatau/native/sdl/test/testgles2.c +732 -0
- data/ext/alphatau/native/sdl/test/testhaptic.c +369 -0
- data/ext/alphatau/native/sdl/test/testhittesting.c +134 -0
- data/ext/alphatau/native/sdl/test/testhotplug.c +162 -0
- data/ext/alphatau/native/sdl/test/testiconv.c +88 -0
- data/ext/alphatau/native/sdl/test/testime.c +801 -0
- data/ext/alphatau/native/sdl/test/testintersections.c +363 -0
- data/ext/alphatau/native/sdl/test/testjoystick.c +387 -0
- data/ext/alphatau/native/sdl/test/testkeys.c +40 -0
- data/ext/alphatau/native/sdl/test/testloadso.c +82 -0
- data/ext/alphatau/native/sdl/test/testlock.c +128 -0
- data/ext/alphatau/native/sdl/test/testmessage.c +193 -0
- data/ext/alphatau/native/sdl/test/testmultiaudio.c +199 -0
- data/ext/alphatau/native/sdl/test/testnative.c +237 -0
- data/ext/alphatau/native/sdl/test/testnative.h +46 -0
- data/ext/alphatau/native/sdl/test/testnativecocoa.m +51 -0
- data/ext/alphatau/native/sdl/test/testnativew32.c +86 -0
- data/ext/alphatau/native/sdl/test/testnativex11.c +53 -0
- data/ext/alphatau/native/sdl/test/testoverlay2.c +408 -0
- data/ext/alphatau/native/sdl/test/testplatform.c +442 -0
- data/ext/alphatau/native/sdl/test/testpower.c +80 -0
- data/ext/alphatau/native/sdl/test/testqsort.c +108 -0
- data/ext/alphatau/native/sdl/test/testrelative.c +126 -0
- data/ext/alphatau/native/sdl/test/testrendercopyex.c +233 -0
- data/ext/alphatau/native/sdl/test/testrendertarget.c +335 -0
- data/ext/alphatau/native/sdl/test/testresample.c +120 -0
- data/ext/alphatau/native/sdl/test/testrumble.c +153 -0
- data/ext/alphatau/native/sdl/test/testscale.c +224 -0
- data/ext/alphatau/native/sdl/test/testsem.c +130 -0
- data/ext/alphatau/native/sdl/test/testsensor.c +117 -0
- data/ext/alphatau/native/sdl/test/testshader.c +500 -0
- data/ext/alphatau/native/sdl/test/testshape.c +200 -0
- data/ext/alphatau/native/sdl/test/testsprite2.c +409 -0
- data/ext/alphatau/native/sdl/test/testspriteminimal.c +194 -0
- data/ext/alphatau/native/sdl/test/teststreaming.c +190 -0
- data/ext/alphatau/native/sdl/test/testthread.c +130 -0
- data/ext/alphatau/native/sdl/test/testtimer.c +122 -0
- data/ext/alphatau/native/sdl/test/testver.c +47 -0
- data/ext/alphatau/native/sdl/test/testviewport.c +217 -0
- data/ext/alphatau/native/sdl/test/testvulkan.c +1201 -0
- data/ext/alphatau/native/sdl/test/testwm2.c +174 -0
- data/ext/alphatau/native/sdl/test/testyuv.bmp +0 -0
- data/ext/alphatau/native/sdl/test/testyuv.c +455 -0
- data/ext/alphatau/native/sdl/test/testyuv_cvt.c +300 -0
- data/ext/alphatau/native/sdl/test/testyuv_cvt.h +16 -0
- data/ext/alphatau/native/sdl/test/torturethread.c +113 -0
- data/ext/alphatau/native/sdl/test/utf8.txt +287 -0
- data/ext/alphatau/native/sdl/visualtest/COPYING.txt +18 -0
- data/ext/alphatau/native/sdl/visualtest/Makefile.in +37 -0
- data/ext/alphatau/native/sdl/visualtest/README.txt +214 -0
- data/ext/alphatau/native/sdl/visualtest/acinclude.m4 +359 -0
- data/ext/alphatau/native/sdl/visualtest/autogen.sh +12 -0
- data/ext/alphatau/native/sdl/visualtest/compile +1 -0
- data/ext/alphatau/native/sdl/visualtest/config.h +23 -0
- data/ext/alphatau/native/sdl/visualtest/config.h.in +22 -0
- data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_blendmodes/testsprite2_blendmodes.actions +3 -0
- data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_blendmodes/testsprite2_blendmodes.config +5 -0
- data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_blendmodes/testsprite2_blendmodes.parameters +5 -0
- data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_crashtest/testsprite2_crashtest.actions +1 -0
- data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_crashtest/testsprite2_crashtest.config +5 -0
- data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_crashtest/testsprite2_crashtest.parameters +24 -0
- data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_fullscreen/testsprite2_fullscreen.actions +3 -0
- data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_fullscreen/testsprite2_fullscreen.config +5 -0
- data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_fullscreen/testsprite2_fullscreen.parameters +5 -0
- data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_geometry/testsprite2_geometry.actions +3 -0
- data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_geometry/testsprite2_geometry.config +5 -0
- data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_geometry/testsprite2_geometry.parameters +5 -0
- data/ext/alphatau/native/sdl/visualtest/configure +5203 -0
- data/ext/alphatau/native/sdl/visualtest/configure.in +166 -0
- data/ext/alphatau/native/sdl/visualtest/depcomp +1 -0
- data/ext/alphatau/native/sdl/visualtest/docs/Doxyfile +1936 -0
- data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_action_configparser.h +149 -0
- data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_exhaustive_variator.h +64 -0
- data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_harness_argparser.h +75 -0
- data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_mischelper.h +28 -0
- data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_parsehelper.h +46 -0
- data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_process.h +112 -0
- data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_random_variator.h +61 -0
- data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_rwhelper.h +87 -0
- data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_screenshot.h +52 -0
- data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_sut_configparser.h +105 -0
- data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_variator_common.h +122 -0
- data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_variators.h +66 -0
- data/ext/alphatau/native/sdl/visualtest/install-sh +1 -0
- data/ext/alphatau/native/sdl/visualtest/launch_harness.cmd +2 -0
- data/ext/alphatau/native/sdl/visualtest/launch_harness.sh +6 -0
- data/ext/alphatau/native/sdl/visualtest/missing +1 -0
- data/ext/alphatau/native/sdl/visualtest/src/action_configparser.c +396 -0
- data/ext/alphatau/native/sdl/visualtest/src/harness_argparser.c +358 -0
- data/ext/alphatau/native/sdl/visualtest/src/linux/linux_process.c +199 -0
- data/ext/alphatau/native/sdl/visualtest/src/mischelper.c +28 -0
- data/ext/alphatau/native/sdl/visualtest/src/parsehelper.c +231 -0
- data/ext/alphatau/native/sdl/visualtest/src/rwhelper.c +131 -0
- data/ext/alphatau/native/sdl/visualtest/src/screenshot.c +136 -0
- data/ext/alphatau/native/sdl/visualtest/src/sut_configparser.c +232 -0
- data/ext/alphatau/native/sdl/visualtest/src/testharness.c +533 -0
- data/ext/alphatau/native/sdl/visualtest/src/variator_common.c +225 -0
- data/ext/alphatau/native/sdl/visualtest/src/variator_exhaustive.c +132 -0
- data/ext/alphatau/native/sdl/visualtest/src/variator_random.c +111 -0
- data/ext/alphatau/native/sdl/visualtest/src/variators.c +93 -0
- data/ext/alphatau/native/sdl/visualtest/src/windows/windows_process.c +284 -0
- data/ext/alphatau/native/sdl/visualtest/src/windows/windows_screenshot.c +349 -0
- data/ext/alphatau/native/sdl/visualtest/stamp-h1 +1 -0
- data/ext/alphatau/native/sdl/visualtest/testsprite2_sample.actions +3 -0
- data/ext/alphatau/native/sdl/visualtest/testsprite2_sample.config +6 -0
- data/ext/alphatau/native/sdl/visualtest/testsprite2_sample.parameters +29 -0
- data/ext/alphatau/native/sdl/visualtest/unittest/testquit.actions +1 -0
- data/ext/alphatau/native/sdl/visualtest/unittest/testquit.c +101 -0
- data/ext/alphatau/native/sdl/visualtest/unittest/testquit.config +5 -0
- data/ext/alphatau/native/sdl/visualtest/unittest/testquit.parameters +3 -0
- data/ext/alphatau/native/sdl/wayland-protocols/pointer-constraints-unstable-v1.xml +339 -0
- data/ext/alphatau/native/sdl/wayland-protocols/relative-pointer-unstable-v1.xml +136 -0
- data/ext/alphatau/native/sdl/wayland-protocols/wayland.xml +2746 -0
- data/ext/alphatau/native/sdl/wayland-protocols/xdg-shell-unstable-v6.xml +1044 -0
- data/ext/alphatau/native/sdl/wayland-protocols/xdg-shell.xml +1120 -0
- data/lib/alphatau.rb +12 -0
- data/lib/alphatau/version.rb +3 -0
- metadata +1465 -0
@@ -0,0 +1,43 @@
|
|
1
|
+
/*
|
2
|
+
Simple DirectMedia Layer
|
3
|
+
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
|
4
|
+
|
5
|
+
This software is provided 'as-is', without any express or implied
|
6
|
+
warranty. In no event will the authors be held liable for any damages
|
7
|
+
arising from the use of this software.
|
8
|
+
|
9
|
+
Permission is granted to anyone to use this software for any purpose,
|
10
|
+
including commercial applications, and to alter it and redistribute it
|
11
|
+
freely, subject to the following restrictions:
|
12
|
+
|
13
|
+
1. The origin of this software must not be misrepresented; you must not
|
14
|
+
claim that you wrote the original software. If you use this software
|
15
|
+
in a product, an acknowledgment in the product documentation would be
|
16
|
+
appreciated but is not required.
|
17
|
+
2. Altered source versions must be plainly marked as such, and must not be
|
18
|
+
misrepresented as being the original software.
|
19
|
+
3. This notice may not be removed or altered from any source distribution.
|
20
|
+
*/
|
21
|
+
#include "../../SDL_internal.h"
|
22
|
+
|
23
|
+
/* D3D11 shader implementation */
|
24
|
+
|
25
|
+
typedef enum {
|
26
|
+
SHADER_SOLID,
|
27
|
+
SHADER_RGB,
|
28
|
+
SHADER_YUV_JPEG,
|
29
|
+
SHADER_YUV_BT601,
|
30
|
+
SHADER_YUV_BT709,
|
31
|
+
SHADER_NV12_JPEG,
|
32
|
+
SHADER_NV12_BT601,
|
33
|
+
SHADER_NV12_BT709,
|
34
|
+
SHADER_NV21_JPEG,
|
35
|
+
SHADER_NV21_BT601,
|
36
|
+
SHADER_NV21_BT709,
|
37
|
+
NUM_SHADERS
|
38
|
+
} D3D11_Shader;
|
39
|
+
|
40
|
+
extern int D3D11_CreateVertexShader(ID3D11Device1 *d3dDevice, ID3D11VertexShader **vertexShader, ID3D11InputLayout **inputLayout);
|
41
|
+
extern int D3D11_CreatePixelShader(ID3D11Device1 *d3dDevice, D3D11_Shader shader, ID3D11PixelShader **pixelShader);
|
42
|
+
|
43
|
+
/* vi: set ts=4 sw=4 expandtab: */
|
@@ -0,0 +1,1428 @@
|
|
1
|
+
/*
|
2
|
+
Simple DirectMedia Layer
|
3
|
+
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
|
4
|
+
|
5
|
+
This software is provided 'as-is', without any express or implied
|
6
|
+
warranty. In no event will the authors be held liable for any damages
|
7
|
+
arising from the use of this software.
|
8
|
+
|
9
|
+
Permission is granted to anyone to use this software for any purpose,
|
10
|
+
including commercial applications, and to alter it and redistribute it
|
11
|
+
freely, subject to the following restrictions:
|
12
|
+
|
13
|
+
1. The origin of this software must not be misrepresented; you must not
|
14
|
+
claim that you wrote the original software. If you use this software
|
15
|
+
in a product, an acknowledgment in the product documentation would be
|
16
|
+
appreciated but is not required.
|
17
|
+
2. Altered source versions must be plainly marked as such, and must not be
|
18
|
+
misrepresented as being the original software.
|
19
|
+
3. This notice may not be removed or altered from any source distribution.
|
20
|
+
*/
|
21
|
+
#include "../../SDL_internal.h"
|
22
|
+
|
23
|
+
#if SDL_VIDEO_RENDER_METAL && !SDL_RENDER_DISABLED
|
24
|
+
|
25
|
+
#include "SDL_hints.h"
|
26
|
+
#include "SDL_log.h"
|
27
|
+
#include "SDL_assert.h"
|
28
|
+
#include "SDL_syswm.h"
|
29
|
+
#include "../SDL_sysrender.h"
|
30
|
+
|
31
|
+
#ifdef __MACOSX__
|
32
|
+
#include "../../video/cocoa/SDL_cocoametalview.h"
|
33
|
+
#else
|
34
|
+
#include "../../video/uikit/SDL_uikitmetalview.h"
|
35
|
+
#endif
|
36
|
+
#include <Availability.h>
|
37
|
+
#import <Metal/Metal.h>
|
38
|
+
#import <QuartzCore/CAMetalLayer.h>
|
39
|
+
|
40
|
+
/* Regenerate these with build-metal-shaders.sh */
|
41
|
+
#ifdef __MACOSX__
|
42
|
+
#include "SDL_shaders_metal_osx.h"
|
43
|
+
#else
|
44
|
+
#include "SDL_shaders_metal_ios.h"
|
45
|
+
#endif
|
46
|
+
|
47
|
+
/* Apple Metal renderer implementation */
|
48
|
+
|
49
|
+
static SDL_Renderer *METAL_CreateRenderer(SDL_Window * window, Uint32 flags);
|
50
|
+
static void METAL_WindowEvent(SDL_Renderer * renderer,
|
51
|
+
const SDL_WindowEvent *event);
|
52
|
+
static int METAL_GetOutputSize(SDL_Renderer * renderer, int *w, int *h);
|
53
|
+
static SDL_bool METAL_SupportsBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode);
|
54
|
+
static int METAL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture);
|
55
|
+
static int METAL_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
|
56
|
+
const SDL_Rect * rect, const void *pixels,
|
57
|
+
int pitch);
|
58
|
+
static int METAL_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture,
|
59
|
+
const SDL_Rect * rect,
|
60
|
+
const Uint8 *Yplane, int Ypitch,
|
61
|
+
const Uint8 *Uplane, int Upitch,
|
62
|
+
const Uint8 *Vplane, int Vpitch);
|
63
|
+
static int METAL_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
|
64
|
+
const SDL_Rect * rect, void **pixels, int *pitch);
|
65
|
+
static void METAL_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture);
|
66
|
+
static int METAL_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture);
|
67
|
+
static int METAL_UpdateViewport(SDL_Renderer * renderer);
|
68
|
+
static int METAL_UpdateClipRect(SDL_Renderer * renderer);
|
69
|
+
static int METAL_RenderClear(SDL_Renderer * renderer);
|
70
|
+
static int METAL_RenderDrawPoints(SDL_Renderer * renderer,
|
71
|
+
const SDL_FPoint * points, int count);
|
72
|
+
static int METAL_RenderDrawLines(SDL_Renderer * renderer,
|
73
|
+
const SDL_FPoint * points, int count);
|
74
|
+
static int METAL_RenderFillRects(SDL_Renderer * renderer,
|
75
|
+
const SDL_FRect * rects, int count);
|
76
|
+
static int METAL_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
|
77
|
+
const SDL_Rect * srcrect, const SDL_FRect * dstrect);
|
78
|
+
static int METAL_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture,
|
79
|
+
const SDL_Rect * srcrect, const SDL_FRect * dstrect,
|
80
|
+
const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip);
|
81
|
+
static int METAL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
|
82
|
+
Uint32 pixel_format, void * pixels, int pitch);
|
83
|
+
static void METAL_RenderPresent(SDL_Renderer * renderer);
|
84
|
+
static void METAL_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture);
|
85
|
+
static void METAL_DestroyRenderer(SDL_Renderer * renderer);
|
86
|
+
static void *METAL_GetMetalLayer(SDL_Renderer * renderer);
|
87
|
+
static void *METAL_GetMetalCommandEncoder(SDL_Renderer * renderer);
|
88
|
+
|
89
|
+
SDL_RenderDriver METAL_RenderDriver = {
|
90
|
+
METAL_CreateRenderer,
|
91
|
+
{
|
92
|
+
"metal",
|
93
|
+
(SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_TARGETTEXTURE),
|
94
|
+
6,
|
95
|
+
{
|
96
|
+
SDL_PIXELFORMAT_ARGB8888,
|
97
|
+
SDL_PIXELFORMAT_ABGR8888,
|
98
|
+
SDL_PIXELFORMAT_YV12,
|
99
|
+
SDL_PIXELFORMAT_IYUV,
|
100
|
+
SDL_PIXELFORMAT_NV12,
|
101
|
+
SDL_PIXELFORMAT_NV21
|
102
|
+
},
|
103
|
+
0, 0,
|
104
|
+
}
|
105
|
+
};
|
106
|
+
|
107
|
+
/* macOS requires constants in a buffer to have a 256 byte alignment. */
|
108
|
+
#ifdef __MACOSX__
|
109
|
+
#define CONSTANT_ALIGN 256
|
110
|
+
#else
|
111
|
+
#define CONSTANT_ALIGN 4
|
112
|
+
#endif
|
113
|
+
|
114
|
+
#define ALIGN_CONSTANTS(size) ((size + CONSTANT_ALIGN - 1) & (~(CONSTANT_ALIGN - 1)))
|
115
|
+
|
116
|
+
static const size_t CONSTANTS_OFFSET_IDENTITY = 0;
|
117
|
+
static const size_t CONSTANTS_OFFSET_HALF_PIXEL_TRANSFORM = ALIGN_CONSTANTS(CONSTANTS_OFFSET_IDENTITY + sizeof(float) * 16);
|
118
|
+
static const size_t CONSTANTS_OFFSET_DECODE_JPEG = ALIGN_CONSTANTS(CONSTANTS_OFFSET_HALF_PIXEL_TRANSFORM + sizeof(float) * 16);
|
119
|
+
static const size_t CONSTANTS_OFFSET_DECODE_BT601 = ALIGN_CONSTANTS(CONSTANTS_OFFSET_DECODE_JPEG + sizeof(float) * 4 * 4);
|
120
|
+
static const size_t CONSTANTS_OFFSET_DECODE_BT709 = ALIGN_CONSTANTS(CONSTANTS_OFFSET_DECODE_BT601 + sizeof(float) * 4 * 4);
|
121
|
+
static const size_t CONSTANTS_OFFSET_CLEAR_VERTS = ALIGN_CONSTANTS(CONSTANTS_OFFSET_DECODE_BT709 + sizeof(float) * 4 * 4);
|
122
|
+
static const size_t CONSTANTS_LENGTH = CONSTANTS_OFFSET_CLEAR_VERTS + sizeof(float) * 6;
|
123
|
+
|
124
|
+
typedef enum SDL_MetalVertexFunction
|
125
|
+
{
|
126
|
+
SDL_METAL_VERTEX_SOLID,
|
127
|
+
SDL_METAL_VERTEX_COPY,
|
128
|
+
} SDL_MetalVertexFunction;
|
129
|
+
|
130
|
+
typedef enum SDL_MetalFragmentFunction
|
131
|
+
{
|
132
|
+
SDL_METAL_FRAGMENT_SOLID = 0,
|
133
|
+
SDL_METAL_FRAGMENT_COPY,
|
134
|
+
SDL_METAL_FRAGMENT_YUV,
|
135
|
+
SDL_METAL_FRAGMENT_NV12,
|
136
|
+
SDL_METAL_FRAGMENT_NV21,
|
137
|
+
SDL_METAL_FRAGMENT_COUNT,
|
138
|
+
} SDL_MetalFragmentFunction;
|
139
|
+
|
140
|
+
typedef struct METAL_PipelineState
|
141
|
+
{
|
142
|
+
SDL_BlendMode blendMode;
|
143
|
+
void *pipe;
|
144
|
+
} METAL_PipelineState;
|
145
|
+
|
146
|
+
typedef struct METAL_PipelineCache
|
147
|
+
{
|
148
|
+
METAL_PipelineState *states;
|
149
|
+
int count;
|
150
|
+
SDL_MetalVertexFunction vertexFunction;
|
151
|
+
SDL_MetalFragmentFunction fragmentFunction;
|
152
|
+
MTLPixelFormat renderTargetFormat;
|
153
|
+
const char *label;
|
154
|
+
} METAL_PipelineCache;
|
155
|
+
|
156
|
+
/* Each shader combination used by drawing functions has a separate pipeline
|
157
|
+
* cache, and we have a separate list of caches for each render target pixel
|
158
|
+
* format. This is more efficient than iterating over a global cache to find
|
159
|
+
* the pipeline based on the specified shader combination and RT pixel format,
|
160
|
+
* since we know what the RT pixel format is when we set the render target, and
|
161
|
+
* we know what the shader combination is inside each drawing function's code. */
|
162
|
+
typedef struct METAL_ShaderPipelines
|
163
|
+
{
|
164
|
+
MTLPixelFormat renderTargetFormat;
|
165
|
+
METAL_PipelineCache caches[SDL_METAL_FRAGMENT_COUNT];
|
166
|
+
} METAL_ShaderPipelines;
|
167
|
+
|
168
|
+
@interface METAL_RenderData : NSObject
|
169
|
+
@property (nonatomic, retain) id<MTLDevice> mtldevice;
|
170
|
+
@property (nonatomic, retain) id<MTLCommandQueue> mtlcmdqueue;
|
171
|
+
@property (nonatomic, retain) id<MTLCommandBuffer> mtlcmdbuffer;
|
172
|
+
@property (nonatomic, retain) id<MTLRenderCommandEncoder> mtlcmdencoder;
|
173
|
+
@property (nonatomic, retain) id<MTLLibrary> mtllibrary;
|
174
|
+
@property (nonatomic, retain) id<CAMetalDrawable> mtlbackbuffer;
|
175
|
+
@property (nonatomic, retain) id<MTLSamplerState> mtlsamplernearest;
|
176
|
+
@property (nonatomic, retain) id<MTLSamplerState> mtlsamplerlinear;
|
177
|
+
@property (nonatomic, retain) id<MTLBuffer> mtlbufconstants;
|
178
|
+
@property (nonatomic, retain) CAMetalLayer *mtllayer;
|
179
|
+
@property (nonatomic, retain) MTLRenderPassDescriptor *mtlpassdesc;
|
180
|
+
@property (nonatomic, assign) METAL_ShaderPipelines *activepipelines;
|
181
|
+
@property (nonatomic, assign) METAL_ShaderPipelines *allpipelines;
|
182
|
+
@property (nonatomic, assign) int pipelinescount;
|
183
|
+
@end
|
184
|
+
|
185
|
+
@implementation METAL_RenderData
|
186
|
+
#if !__has_feature(objc_arc)
|
187
|
+
- (void)dealloc
|
188
|
+
{
|
189
|
+
[_mtldevice release];
|
190
|
+
[_mtlcmdqueue release];
|
191
|
+
[_mtlcmdbuffer release];
|
192
|
+
[_mtlcmdencoder release];
|
193
|
+
[_mtllibrary release];
|
194
|
+
[_mtlbackbuffer release];
|
195
|
+
[_mtlsamplernearest release];
|
196
|
+
[_mtlsamplerlinear release];
|
197
|
+
[_mtlbufconstants release];
|
198
|
+
[_mtllayer release];
|
199
|
+
[_mtlpassdesc release];
|
200
|
+
[super dealloc];
|
201
|
+
}
|
202
|
+
#endif
|
203
|
+
@end
|
204
|
+
|
205
|
+
@interface METAL_TextureData : NSObject
|
206
|
+
@property (nonatomic, retain) id<MTLTexture> mtltexture;
|
207
|
+
@property (nonatomic, retain) id<MTLTexture> mtltexture_uv;
|
208
|
+
@property (nonatomic, retain) id<MTLSamplerState> mtlsampler;
|
209
|
+
@property (nonatomic, assign) SDL_MetalFragmentFunction fragmentFunction;
|
210
|
+
@property (nonatomic, assign) BOOL yuv;
|
211
|
+
@property (nonatomic, assign) BOOL nv12;
|
212
|
+
@property (nonatomic, assign) size_t conversionBufferOffset;
|
213
|
+
@end
|
214
|
+
|
215
|
+
@implementation METAL_TextureData
|
216
|
+
#if !__has_feature(objc_arc)
|
217
|
+
- (void)dealloc
|
218
|
+
{
|
219
|
+
[_mtltexture release];
|
220
|
+
[_mtltexture_uv release];
|
221
|
+
[_mtlsampler release];
|
222
|
+
[super dealloc];
|
223
|
+
}
|
224
|
+
#endif
|
225
|
+
@end
|
226
|
+
|
227
|
+
static int
|
228
|
+
IsMetalAvailable(const SDL_SysWMinfo *syswm)
|
229
|
+
{
|
230
|
+
if (syswm->subsystem != SDL_SYSWM_COCOA && syswm->subsystem != SDL_SYSWM_UIKIT) {
|
231
|
+
return SDL_SetError("Metal render target only supports Cocoa and UIKit video targets at the moment.");
|
232
|
+
}
|
233
|
+
|
234
|
+
// this checks a weak symbol.
|
235
|
+
#if (defined(__MACOSX__) && (MAC_OS_X_VERSION_MIN_REQUIRED < 101100))
|
236
|
+
if (MTLCreateSystemDefaultDevice == NULL) { // probably on 10.10 or lower.
|
237
|
+
return SDL_SetError("Metal framework not available on this system");
|
238
|
+
}
|
239
|
+
#endif
|
240
|
+
|
241
|
+
return 0;
|
242
|
+
}
|
243
|
+
|
244
|
+
static const MTLBlendOperation invalidBlendOperation = (MTLBlendOperation)0xFFFFFFFF;
|
245
|
+
static const MTLBlendFactor invalidBlendFactor = (MTLBlendFactor)0xFFFFFFFF;
|
246
|
+
|
247
|
+
static MTLBlendOperation
|
248
|
+
GetBlendOperation(SDL_BlendOperation operation)
|
249
|
+
{
|
250
|
+
switch (operation) {
|
251
|
+
case SDL_BLENDOPERATION_ADD: return MTLBlendOperationAdd;
|
252
|
+
case SDL_BLENDOPERATION_SUBTRACT: return MTLBlendOperationSubtract;
|
253
|
+
case SDL_BLENDOPERATION_REV_SUBTRACT: return MTLBlendOperationReverseSubtract;
|
254
|
+
case SDL_BLENDOPERATION_MINIMUM: return MTLBlendOperationMin;
|
255
|
+
case SDL_BLENDOPERATION_MAXIMUM: return MTLBlendOperationMax;
|
256
|
+
default: return invalidBlendOperation;
|
257
|
+
}
|
258
|
+
}
|
259
|
+
|
260
|
+
static MTLBlendFactor
|
261
|
+
GetBlendFactor(SDL_BlendFactor factor)
|
262
|
+
{
|
263
|
+
switch (factor) {
|
264
|
+
case SDL_BLENDFACTOR_ZERO: return MTLBlendFactorZero;
|
265
|
+
case SDL_BLENDFACTOR_ONE: return MTLBlendFactorOne;
|
266
|
+
case SDL_BLENDFACTOR_SRC_COLOR: return MTLBlendFactorSourceColor;
|
267
|
+
case SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR: return MTLBlendFactorOneMinusSourceColor;
|
268
|
+
case SDL_BLENDFACTOR_SRC_ALPHA: return MTLBlendFactorSourceAlpha;
|
269
|
+
case SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA: return MTLBlendFactorOneMinusSourceAlpha;
|
270
|
+
case SDL_BLENDFACTOR_DST_COLOR: return MTLBlendFactorDestinationColor;
|
271
|
+
case SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR: return MTLBlendFactorOneMinusDestinationColor;
|
272
|
+
case SDL_BLENDFACTOR_DST_ALPHA: return MTLBlendFactorDestinationAlpha;
|
273
|
+
case SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA: return MTLBlendFactorOneMinusDestinationAlpha;
|
274
|
+
default: return invalidBlendFactor;
|
275
|
+
}
|
276
|
+
}
|
277
|
+
|
278
|
+
static NSString *
|
279
|
+
GetVertexFunctionName(SDL_MetalVertexFunction function)
|
280
|
+
{
|
281
|
+
switch (function) {
|
282
|
+
case SDL_METAL_VERTEX_SOLID: return @"SDL_Solid_vertex";
|
283
|
+
case SDL_METAL_VERTEX_COPY: return @"SDL_Copy_vertex";
|
284
|
+
default: return nil;
|
285
|
+
}
|
286
|
+
}
|
287
|
+
|
288
|
+
static NSString *
|
289
|
+
GetFragmentFunctionName(SDL_MetalFragmentFunction function)
|
290
|
+
{
|
291
|
+
switch (function) {
|
292
|
+
case SDL_METAL_FRAGMENT_SOLID: return @"SDL_Solid_fragment";
|
293
|
+
case SDL_METAL_FRAGMENT_COPY: return @"SDL_Copy_fragment";
|
294
|
+
case SDL_METAL_FRAGMENT_YUV: return @"SDL_YUV_fragment";
|
295
|
+
case SDL_METAL_FRAGMENT_NV12: return @"SDL_NV12_fragment";
|
296
|
+
case SDL_METAL_FRAGMENT_NV21: return @"SDL_NV21_fragment";
|
297
|
+
default: return nil;
|
298
|
+
}
|
299
|
+
}
|
300
|
+
|
301
|
+
static id<MTLRenderPipelineState>
|
302
|
+
MakePipelineState(METAL_RenderData *data, METAL_PipelineCache *cache,
|
303
|
+
NSString *blendlabel, SDL_BlendMode blendmode)
|
304
|
+
{
|
305
|
+
id<MTLFunction> mtlvertfn = [data.mtllibrary newFunctionWithName:GetVertexFunctionName(cache->vertexFunction)];
|
306
|
+
id<MTLFunction> mtlfragfn = [data.mtllibrary newFunctionWithName:GetFragmentFunctionName(cache->fragmentFunction)];
|
307
|
+
SDL_assert(mtlvertfn != nil);
|
308
|
+
SDL_assert(mtlfragfn != nil);
|
309
|
+
|
310
|
+
MTLRenderPipelineDescriptor *mtlpipedesc = [[MTLRenderPipelineDescriptor alloc] init];
|
311
|
+
mtlpipedesc.vertexFunction = mtlvertfn;
|
312
|
+
mtlpipedesc.fragmentFunction = mtlfragfn;
|
313
|
+
|
314
|
+
MTLRenderPipelineColorAttachmentDescriptor *rtdesc = mtlpipedesc.colorAttachments[0];
|
315
|
+
|
316
|
+
rtdesc.pixelFormat = cache->renderTargetFormat;
|
317
|
+
|
318
|
+
if (blendmode != SDL_BLENDMODE_NONE) {
|
319
|
+
rtdesc.blendingEnabled = YES;
|
320
|
+
rtdesc.sourceRGBBlendFactor = GetBlendFactor(SDL_GetBlendModeSrcColorFactor(blendmode));
|
321
|
+
rtdesc.destinationRGBBlendFactor = GetBlendFactor(SDL_GetBlendModeDstColorFactor(blendmode));
|
322
|
+
rtdesc.rgbBlendOperation = GetBlendOperation(SDL_GetBlendModeColorOperation(blendmode));
|
323
|
+
rtdesc.sourceAlphaBlendFactor = GetBlendFactor(SDL_GetBlendModeSrcAlphaFactor(blendmode));
|
324
|
+
rtdesc.destinationAlphaBlendFactor = GetBlendFactor(SDL_GetBlendModeDstAlphaFactor(blendmode));
|
325
|
+
rtdesc.alphaBlendOperation = GetBlendOperation(SDL_GetBlendModeAlphaOperation(blendmode));
|
326
|
+
} else {
|
327
|
+
rtdesc.blendingEnabled = NO;
|
328
|
+
}
|
329
|
+
|
330
|
+
mtlpipedesc.label = [@(cache->label) stringByAppendingString:blendlabel];
|
331
|
+
|
332
|
+
NSError *err = nil;
|
333
|
+
id<MTLRenderPipelineState> state = [data.mtldevice newRenderPipelineStateWithDescriptor:mtlpipedesc error:&err];
|
334
|
+
SDL_assert(err == nil);
|
335
|
+
|
336
|
+
METAL_PipelineState pipeline;
|
337
|
+
pipeline.blendMode = blendmode;
|
338
|
+
pipeline.pipe = (void *)CFBridgingRetain(state);
|
339
|
+
|
340
|
+
METAL_PipelineState *states = SDL_realloc(cache->states, (cache->count + 1) * sizeof(pipeline));
|
341
|
+
|
342
|
+
#if !__has_feature(objc_arc)
|
343
|
+
[mtlpipedesc release]; // !!! FIXME: can these be reused for each creation, or does the pipeline obtain it?
|
344
|
+
[mtlvertfn release];
|
345
|
+
[mtlfragfn release];
|
346
|
+
[state release];
|
347
|
+
#endif
|
348
|
+
|
349
|
+
if (states) {
|
350
|
+
states[cache->count++] = pipeline;
|
351
|
+
cache->states = states;
|
352
|
+
return (__bridge id<MTLRenderPipelineState>)pipeline.pipe;
|
353
|
+
} else {
|
354
|
+
CFBridgingRelease(pipeline.pipe);
|
355
|
+
SDL_OutOfMemory();
|
356
|
+
return NULL;
|
357
|
+
}
|
358
|
+
}
|
359
|
+
|
360
|
+
static void
|
361
|
+
MakePipelineCache(METAL_RenderData *data, METAL_PipelineCache *cache, const char *label,
|
362
|
+
MTLPixelFormat rtformat, SDL_MetalVertexFunction vertfn, SDL_MetalFragmentFunction fragfn)
|
363
|
+
{
|
364
|
+
SDL_zerop(cache);
|
365
|
+
|
366
|
+
cache->vertexFunction = vertfn;
|
367
|
+
cache->fragmentFunction = fragfn;
|
368
|
+
cache->renderTargetFormat = rtformat;
|
369
|
+
cache->label = label;
|
370
|
+
|
371
|
+
/* Create pipeline states for the default blend modes. Custom blend modes
|
372
|
+
* will be added to the cache on-demand. */
|
373
|
+
MakePipelineState(data, cache, @" (blend=none)", SDL_BLENDMODE_NONE);
|
374
|
+
MakePipelineState(data, cache, @" (blend=blend)", SDL_BLENDMODE_BLEND);
|
375
|
+
MakePipelineState(data, cache, @" (blend=add)", SDL_BLENDMODE_ADD);
|
376
|
+
MakePipelineState(data, cache, @" (blend=mod)", SDL_BLENDMODE_MOD);
|
377
|
+
}
|
378
|
+
|
379
|
+
static void
|
380
|
+
DestroyPipelineCache(METAL_PipelineCache *cache)
|
381
|
+
{
|
382
|
+
if (cache != NULL) {
|
383
|
+
for (int i = 0; i < cache->count; i++) {
|
384
|
+
CFBridgingRelease(cache->states[i].pipe);
|
385
|
+
}
|
386
|
+
|
387
|
+
SDL_free(cache->states);
|
388
|
+
}
|
389
|
+
}
|
390
|
+
|
391
|
+
void
|
392
|
+
MakeShaderPipelines(METAL_RenderData *data, METAL_ShaderPipelines *pipelines, MTLPixelFormat rtformat)
|
393
|
+
{
|
394
|
+
SDL_zerop(pipelines);
|
395
|
+
|
396
|
+
pipelines->renderTargetFormat = rtformat;
|
397
|
+
|
398
|
+
MakePipelineCache(data, &pipelines->caches[SDL_METAL_FRAGMENT_SOLID], "SDL primitives pipeline", rtformat, SDL_METAL_VERTEX_SOLID, SDL_METAL_FRAGMENT_SOLID);
|
399
|
+
MakePipelineCache(data, &pipelines->caches[SDL_METAL_FRAGMENT_COPY], "SDL copy pipeline", rtformat, SDL_METAL_VERTEX_COPY, SDL_METAL_FRAGMENT_COPY);
|
400
|
+
MakePipelineCache(data, &pipelines->caches[SDL_METAL_FRAGMENT_YUV], "SDL YUV pipeline", rtformat, SDL_METAL_VERTEX_COPY, SDL_METAL_FRAGMENT_YUV);
|
401
|
+
MakePipelineCache(data, &pipelines->caches[SDL_METAL_FRAGMENT_NV12], "SDL NV12 pipeline", rtformat, SDL_METAL_VERTEX_COPY, SDL_METAL_FRAGMENT_NV12);
|
402
|
+
MakePipelineCache(data, &pipelines->caches[SDL_METAL_FRAGMENT_NV21], "SDL NV21 pipeline", rtformat, SDL_METAL_VERTEX_COPY, SDL_METAL_FRAGMENT_NV21);
|
403
|
+
}
|
404
|
+
|
405
|
+
static METAL_ShaderPipelines *
|
406
|
+
ChooseShaderPipelines(METAL_RenderData *data, MTLPixelFormat rtformat)
|
407
|
+
{
|
408
|
+
METAL_ShaderPipelines *allpipelines = data.allpipelines;
|
409
|
+
int count = data.pipelinescount;
|
410
|
+
|
411
|
+
for (int i = 0; i < count; i++) {
|
412
|
+
if (allpipelines[i].renderTargetFormat == rtformat) {
|
413
|
+
return &allpipelines[i];
|
414
|
+
}
|
415
|
+
}
|
416
|
+
|
417
|
+
allpipelines = SDL_realloc(allpipelines, (count + 1) * sizeof(METAL_ShaderPipelines));
|
418
|
+
|
419
|
+
if (allpipelines == NULL) {
|
420
|
+
SDL_OutOfMemory();
|
421
|
+
return NULL;
|
422
|
+
}
|
423
|
+
|
424
|
+
MakeShaderPipelines(data, &allpipelines[count], rtformat);
|
425
|
+
|
426
|
+
data.allpipelines = allpipelines;
|
427
|
+
data.pipelinescount = count + 1;
|
428
|
+
|
429
|
+
return &data.allpipelines[count];
|
430
|
+
}
|
431
|
+
|
432
|
+
static void
|
433
|
+
DestroyAllPipelines(METAL_ShaderPipelines *allpipelines, int count)
|
434
|
+
{
|
435
|
+
if (allpipelines != NULL) {
|
436
|
+
for (int i = 0; i < count; i++) {
|
437
|
+
for (int cache = 0; cache < SDL_METAL_FRAGMENT_COUNT; cache++) {
|
438
|
+
DestroyPipelineCache(&allpipelines[i].caches[cache]);
|
439
|
+
}
|
440
|
+
}
|
441
|
+
|
442
|
+
SDL_free(allpipelines);
|
443
|
+
}
|
444
|
+
}
|
445
|
+
|
446
|
+
static inline id<MTLRenderPipelineState>
|
447
|
+
ChoosePipelineState(METAL_RenderData *data, METAL_ShaderPipelines *pipelines, SDL_MetalFragmentFunction fragfn, SDL_BlendMode blendmode)
|
448
|
+
{
|
449
|
+
METAL_PipelineCache *cache = &pipelines->caches[fragfn];
|
450
|
+
|
451
|
+
for (int i = 0; i < cache->count; i++) {
|
452
|
+
if (cache->states[i].blendMode == blendmode) {
|
453
|
+
return (__bridge id<MTLRenderPipelineState>)cache->states[i].pipe;
|
454
|
+
}
|
455
|
+
}
|
456
|
+
|
457
|
+
return MakePipelineState(data, cache, [NSString stringWithFormat:@" (blend=custom 0x%x)", blendmode], blendmode);
|
458
|
+
}
|
459
|
+
|
460
|
+
static SDL_Renderer *
|
461
|
+
METAL_CreateRenderer(SDL_Window * window, Uint32 flags)
|
462
|
+
{ @autoreleasepool {
|
463
|
+
SDL_Renderer *renderer = NULL;
|
464
|
+
METAL_RenderData *data = NULL;
|
465
|
+
id<MTLDevice> mtldevice = nil;
|
466
|
+
SDL_SysWMinfo syswm;
|
467
|
+
|
468
|
+
SDL_VERSION(&syswm.version);
|
469
|
+
if (!SDL_GetWindowWMInfo(window, &syswm)) {
|
470
|
+
return NULL;
|
471
|
+
}
|
472
|
+
|
473
|
+
if (IsMetalAvailable(&syswm) == -1) {
|
474
|
+
return NULL;
|
475
|
+
}
|
476
|
+
|
477
|
+
renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer));
|
478
|
+
if (!renderer) {
|
479
|
+
SDL_OutOfMemory();
|
480
|
+
return NULL;
|
481
|
+
}
|
482
|
+
|
483
|
+
// !!! FIXME: MTLCopyAllDevices() can find other GPUs on macOS...
|
484
|
+
mtldevice = MTLCreateSystemDefaultDevice();
|
485
|
+
|
486
|
+
if (mtldevice == nil) {
|
487
|
+
SDL_free(renderer);
|
488
|
+
SDL_SetError("Failed to obtain Metal device");
|
489
|
+
return NULL;
|
490
|
+
}
|
491
|
+
|
492
|
+
// !!! FIXME: error checking on all of this.
|
493
|
+
data = [[METAL_RenderData alloc] init];
|
494
|
+
|
495
|
+
renderer->driverdata = (void*)CFBridgingRetain(data);
|
496
|
+
renderer->window = window;
|
497
|
+
|
498
|
+
#ifdef __MACOSX__
|
499
|
+
NSView *view = Cocoa_Mtl_AddMetalView(window);
|
500
|
+
CAMetalLayer *layer = (CAMetalLayer *)[view layer];
|
501
|
+
|
502
|
+
layer.device = mtldevice;
|
503
|
+
|
504
|
+
//layer.colorspace = nil;
|
505
|
+
|
506
|
+
#else
|
507
|
+
UIView *view = UIKit_Mtl_AddMetalView(window);
|
508
|
+
CAMetalLayer *layer = (CAMetalLayer *)[view layer];
|
509
|
+
#endif
|
510
|
+
|
511
|
+
// Necessary for RenderReadPixels.
|
512
|
+
layer.framebufferOnly = NO;
|
513
|
+
|
514
|
+
data.mtldevice = layer.device;
|
515
|
+
data.mtllayer = layer;
|
516
|
+
id<MTLCommandQueue> mtlcmdqueue = [data.mtldevice newCommandQueue];
|
517
|
+
data.mtlcmdqueue = mtlcmdqueue;
|
518
|
+
data.mtlcmdqueue.label = @"SDL Metal Renderer";
|
519
|
+
data.mtlpassdesc = [MTLRenderPassDescriptor renderPassDescriptor];
|
520
|
+
|
521
|
+
NSError *err = nil;
|
522
|
+
|
523
|
+
// The compiled .metallib is embedded in a static array in a header file
|
524
|
+
// but the original shader source code is in SDL_shaders_metal.metal.
|
525
|
+
dispatch_data_t mtllibdata = dispatch_data_create(sdl_metallib, sdl_metallib_len, dispatch_get_global_queue(0, 0), ^{});
|
526
|
+
id<MTLLibrary> mtllibrary = [data.mtldevice newLibraryWithData:mtllibdata error:&err];
|
527
|
+
data.mtllibrary = mtllibrary;
|
528
|
+
SDL_assert(err == nil);
|
529
|
+
#if !__has_feature(objc_arc)
|
530
|
+
dispatch_release(mtllibdata);
|
531
|
+
#endif
|
532
|
+
data.mtllibrary.label = @"SDL Metal renderer shader library";
|
533
|
+
|
534
|
+
/* Do some shader pipeline state loading up-front rather than on demand. */
|
535
|
+
data.pipelinescount = 0;
|
536
|
+
data.allpipelines = NULL;
|
537
|
+
ChooseShaderPipelines(data, MTLPixelFormatBGRA8Unorm);
|
538
|
+
|
539
|
+
MTLSamplerDescriptor *samplerdesc = [[MTLSamplerDescriptor alloc] init];
|
540
|
+
|
541
|
+
samplerdesc.minFilter = MTLSamplerMinMagFilterNearest;
|
542
|
+
samplerdesc.magFilter = MTLSamplerMinMagFilterNearest;
|
543
|
+
id<MTLSamplerState> mtlsamplernearest = [data.mtldevice newSamplerStateWithDescriptor:samplerdesc];
|
544
|
+
data.mtlsamplernearest = mtlsamplernearest;
|
545
|
+
|
546
|
+
samplerdesc.minFilter = MTLSamplerMinMagFilterLinear;
|
547
|
+
samplerdesc.magFilter = MTLSamplerMinMagFilterLinear;
|
548
|
+
id<MTLSamplerState> mtlsamplerlinear = [data.mtldevice newSamplerStateWithDescriptor:samplerdesc];
|
549
|
+
data.mtlsamplerlinear = mtlsamplerlinear;
|
550
|
+
|
551
|
+
/* Note: matrices are column major. */
|
552
|
+
float identitytransform[16] = {
|
553
|
+
1.0f, 0.0f, 0.0f, 0.0f,
|
554
|
+
0.0f, 1.0f, 0.0f, 0.0f,
|
555
|
+
0.0f, 0.0f, 1.0f, 0.0f,
|
556
|
+
0.0f, 0.0f, 0.0f, 1.0f,
|
557
|
+
};
|
558
|
+
|
559
|
+
float halfpixeltransform[16] = {
|
560
|
+
1.0f, 0.0f, 0.0f, 0.0f,
|
561
|
+
0.0f, 1.0f, 0.0f, 0.0f,
|
562
|
+
0.0f, 0.0f, 1.0f, 0.0f,
|
563
|
+
0.5f, 0.5f, 0.0f, 1.0f,
|
564
|
+
};
|
565
|
+
|
566
|
+
/* Metal pads float3s to 16 bytes. */
|
567
|
+
float decodetransformJPEG[4*4] = {
|
568
|
+
0.0, -0.501960814, -0.501960814, 0.0, /* offset */
|
569
|
+
1.0000, 0.0000, 1.4020, 0.0, /* Rcoeff */
|
570
|
+
1.0000, -0.3441, -0.7141, 0.0, /* Gcoeff */
|
571
|
+
1.0000, 1.7720, 0.0000, 0.0, /* Bcoeff */
|
572
|
+
};
|
573
|
+
|
574
|
+
float decodetransformBT601[4*4] = {
|
575
|
+
-0.0627451017, -0.501960814, -0.501960814, 0.0, /* offset */
|
576
|
+
1.1644, 0.0000, 1.5960, 0.0, /* Rcoeff */
|
577
|
+
1.1644, -0.3918, -0.8130, 0.0, /* Gcoeff */
|
578
|
+
1.1644, 2.0172, 0.0000, 0.0, /* Bcoeff */
|
579
|
+
};
|
580
|
+
|
581
|
+
float decodetransformBT709[4*4] = {
|
582
|
+
0.0, -0.501960814, -0.501960814, 0.0, /* offset */
|
583
|
+
1.0000, 0.0000, 1.4020, 0.0, /* Rcoeff */
|
584
|
+
1.0000, -0.3441, -0.7141, 0.0, /* Gcoeff */
|
585
|
+
1.0000, 1.7720, 0.0000, 0.0, /* Bcoeff */
|
586
|
+
};
|
587
|
+
|
588
|
+
float clearverts[6] = {0.0f, 0.0f, 0.0f, 2.0f, 2.0f, 0.0f};
|
589
|
+
|
590
|
+
id<MTLBuffer> mtlbufconstantstaging = [data.mtldevice newBufferWithLength:CONSTANTS_LENGTH options:MTLResourceStorageModeShared];
|
591
|
+
mtlbufconstantstaging.label = @"SDL constant staging data";
|
592
|
+
|
593
|
+
id<MTLBuffer> mtlbufconstants = [data.mtldevice newBufferWithLength:CONSTANTS_LENGTH options:MTLResourceStorageModePrivate];
|
594
|
+
data.mtlbufconstants = mtlbufconstants;
|
595
|
+
data.mtlbufconstants.label = @"SDL constant data";
|
596
|
+
|
597
|
+
char *constantdata = [mtlbufconstantstaging contents];
|
598
|
+
SDL_memcpy(constantdata + CONSTANTS_OFFSET_IDENTITY, identitytransform, sizeof(identitytransform));
|
599
|
+
SDL_memcpy(constantdata + CONSTANTS_OFFSET_HALF_PIXEL_TRANSFORM, halfpixeltransform, sizeof(halfpixeltransform));
|
600
|
+
SDL_memcpy(constantdata + CONSTANTS_OFFSET_DECODE_JPEG, decodetransformJPEG, sizeof(decodetransformJPEG));
|
601
|
+
SDL_memcpy(constantdata + CONSTANTS_OFFSET_DECODE_BT601, decodetransformBT601, sizeof(decodetransformBT601));
|
602
|
+
SDL_memcpy(constantdata + CONSTANTS_OFFSET_DECODE_BT709, decodetransformBT709, sizeof(decodetransformBT709));
|
603
|
+
SDL_memcpy(constantdata + CONSTANTS_OFFSET_CLEAR_VERTS, clearverts, sizeof(clearverts));
|
604
|
+
|
605
|
+
id<MTLCommandBuffer> cmdbuffer = [data.mtlcmdqueue commandBuffer];
|
606
|
+
id<MTLBlitCommandEncoder> blitcmd = [cmdbuffer blitCommandEncoder];
|
607
|
+
|
608
|
+
[blitcmd copyFromBuffer:mtlbufconstantstaging sourceOffset:0 toBuffer:data.mtlbufconstants destinationOffset:0 size:CONSTANTS_LENGTH];
|
609
|
+
|
610
|
+
[blitcmd endEncoding];
|
611
|
+
[cmdbuffer commit];
|
612
|
+
|
613
|
+
// !!! FIXME: force more clears here so all the drawables are sane to start, and our static buffers are definitely flushed.
|
614
|
+
|
615
|
+
renderer->WindowEvent = METAL_WindowEvent;
|
616
|
+
renderer->GetOutputSize = METAL_GetOutputSize;
|
617
|
+
renderer->SupportsBlendMode = METAL_SupportsBlendMode;
|
618
|
+
renderer->CreateTexture = METAL_CreateTexture;
|
619
|
+
renderer->UpdateTexture = METAL_UpdateTexture;
|
620
|
+
renderer->UpdateTextureYUV = METAL_UpdateTextureYUV;
|
621
|
+
renderer->LockTexture = METAL_LockTexture;
|
622
|
+
renderer->UnlockTexture = METAL_UnlockTexture;
|
623
|
+
renderer->SetRenderTarget = METAL_SetRenderTarget;
|
624
|
+
renderer->UpdateViewport = METAL_UpdateViewport;
|
625
|
+
renderer->UpdateClipRect = METAL_UpdateClipRect;
|
626
|
+
renderer->RenderClear = METAL_RenderClear;
|
627
|
+
renderer->RenderDrawPoints = METAL_RenderDrawPoints;
|
628
|
+
renderer->RenderDrawLines = METAL_RenderDrawLines;
|
629
|
+
renderer->RenderFillRects = METAL_RenderFillRects;
|
630
|
+
renderer->RenderCopy = METAL_RenderCopy;
|
631
|
+
renderer->RenderCopyEx = METAL_RenderCopyEx;
|
632
|
+
renderer->RenderReadPixels = METAL_RenderReadPixels;
|
633
|
+
renderer->RenderPresent = METAL_RenderPresent;
|
634
|
+
renderer->DestroyTexture = METAL_DestroyTexture;
|
635
|
+
renderer->DestroyRenderer = METAL_DestroyRenderer;
|
636
|
+
renderer->GetMetalLayer = METAL_GetMetalLayer;
|
637
|
+
renderer->GetMetalCommandEncoder = METAL_GetMetalCommandEncoder;
|
638
|
+
|
639
|
+
renderer->info = METAL_RenderDriver.info;
|
640
|
+
renderer->info.flags = (SDL_RENDERER_ACCELERATED | SDL_RENDERER_TARGETTEXTURE);
|
641
|
+
|
642
|
+
#if defined(__MACOSX__) && defined(MAC_OS_X_VERSION_10_13)
|
643
|
+
if (@available(macOS 10.13, *)) {
|
644
|
+
data.mtllayer.displaySyncEnabled = (flags & SDL_RENDERER_PRESENTVSYNC) != 0;
|
645
|
+
} else
|
646
|
+
#endif
|
647
|
+
{
|
648
|
+
renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
|
649
|
+
}
|
650
|
+
|
651
|
+
/* https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf */
|
652
|
+
int maxtexsize = 4096;
|
653
|
+
#if defined(__MACOSX__)
|
654
|
+
maxtexsize = 16384;
|
655
|
+
#elif defined(__TVOS__)
|
656
|
+
maxtexsize = 8192;
|
657
|
+
#ifdef __TVOS_11_0
|
658
|
+
if (@available(tvOS 11.0, *)) {
|
659
|
+
if ([mtldevice supportsFeatureSet:MTLFeatureSet_tvOS_GPUFamily2_v1]) {
|
660
|
+
maxtexsize = 16384;
|
661
|
+
}
|
662
|
+
}
|
663
|
+
#endif
|
664
|
+
#else
|
665
|
+
#ifdef __IPHONE_11_0
|
666
|
+
if ([mtldevice supportsFeatureSet:MTLFeatureSet_iOS_GPUFamily4_v1]) {
|
667
|
+
maxtexsize = 16384;
|
668
|
+
} else
|
669
|
+
#endif
|
670
|
+
#ifdef __IPHONE_10_0
|
671
|
+
if ([mtldevice supportsFeatureSet:MTLFeatureSet_iOS_GPUFamily3_v1]) {
|
672
|
+
maxtexsize = 16384;
|
673
|
+
} else
|
674
|
+
#endif
|
675
|
+
if ([mtldevice supportsFeatureSet:MTLFeatureSet_iOS_GPUFamily2_v2] || [mtldevice supportsFeatureSet:MTLFeatureSet_iOS_GPUFamily1_v2]) {
|
676
|
+
maxtexsize = 8192;
|
677
|
+
} else {
|
678
|
+
maxtexsize = 4096;
|
679
|
+
}
|
680
|
+
#endif
|
681
|
+
|
682
|
+
renderer->info.max_texture_width = maxtexsize;
|
683
|
+
renderer->info.max_texture_height = maxtexsize;
|
684
|
+
|
685
|
+
#if !__has_feature(objc_arc)
|
686
|
+
[mtlcmdqueue release];
|
687
|
+
[mtllibrary release];
|
688
|
+
[samplerdesc release];
|
689
|
+
[mtlsamplernearest release];
|
690
|
+
[mtlsamplerlinear release];
|
691
|
+
[mtlbufconstants release];
|
692
|
+
[view release];
|
693
|
+
[data release];
|
694
|
+
[mtldevice release];
|
695
|
+
#endif
|
696
|
+
|
697
|
+
return renderer;
|
698
|
+
}}
|
699
|
+
|
700
|
+
static void
|
701
|
+
METAL_ActivateRenderCommandEncoder(SDL_Renderer * renderer, MTLLoadAction load)
|
702
|
+
{
|
703
|
+
METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata;
|
704
|
+
|
705
|
+
/* Our SetRenderTarget just signals that the next render operation should
|
706
|
+
* set up a new render pass. This is where that work happens. */
|
707
|
+
if (data.mtlcmdencoder == nil) {
|
708
|
+
id<MTLTexture> mtltexture = nil;
|
709
|
+
|
710
|
+
if (renderer->target != NULL) {
|
711
|
+
METAL_TextureData *texdata = (__bridge METAL_TextureData *)renderer->target->driverdata;
|
712
|
+
mtltexture = texdata.mtltexture;
|
713
|
+
} else {
|
714
|
+
if (data.mtlbackbuffer == nil) {
|
715
|
+
/* The backbuffer's contents aren't guaranteed to persist after
|
716
|
+
* presenting, so we can leave it undefined when loading it. */
|
717
|
+
data.mtlbackbuffer = [data.mtllayer nextDrawable];
|
718
|
+
if (load == MTLLoadActionLoad) {
|
719
|
+
load = MTLLoadActionDontCare;
|
720
|
+
}
|
721
|
+
}
|
722
|
+
mtltexture = data.mtlbackbuffer.texture;
|
723
|
+
}
|
724
|
+
|
725
|
+
SDL_assert(mtltexture);
|
726
|
+
|
727
|
+
if (load == MTLLoadActionClear) {
|
728
|
+
MTLClearColor color = MTLClearColorMake(renderer->r/255.0, renderer->g/255.0, renderer->b/255.0, renderer->a/255.0);
|
729
|
+
data.mtlpassdesc.colorAttachments[0].clearColor = color;
|
730
|
+
}
|
731
|
+
|
732
|
+
data.mtlpassdesc.colorAttachments[0].loadAction = load;
|
733
|
+
data.mtlpassdesc.colorAttachments[0].texture = mtltexture;
|
734
|
+
|
735
|
+
data.mtlcmdbuffer = [data.mtlcmdqueue commandBuffer];
|
736
|
+
data.mtlcmdencoder = [data.mtlcmdbuffer renderCommandEncoderWithDescriptor:data.mtlpassdesc];
|
737
|
+
|
738
|
+
if (data.mtlbackbuffer != nil && mtltexture == data.mtlbackbuffer.texture) {
|
739
|
+
data.mtlcmdencoder.label = @"SDL metal renderer backbuffer";
|
740
|
+
} else {
|
741
|
+
data.mtlcmdencoder.label = @"SDL metal renderer render target";
|
742
|
+
}
|
743
|
+
|
744
|
+
data.activepipelines = ChooseShaderPipelines(data, mtltexture.pixelFormat);
|
745
|
+
|
746
|
+
/* Make sure the viewport and clip rect are set on the new render pass. */
|
747
|
+
METAL_UpdateViewport(renderer);
|
748
|
+
METAL_UpdateClipRect(renderer);
|
749
|
+
}
|
750
|
+
}
|
751
|
+
|
752
|
+
static void
|
753
|
+
METAL_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event)
|
754
|
+
{
|
755
|
+
if (event->event == SDL_WINDOWEVENT_SIZE_CHANGED ||
|
756
|
+
event->event == SDL_WINDOWEVENT_SHOWN ||
|
757
|
+
event->event == SDL_WINDOWEVENT_HIDDEN) {
|
758
|
+
// !!! FIXME: write me
|
759
|
+
}
|
760
|
+
}
|
761
|
+
|
762
|
+
static int
|
763
|
+
METAL_GetOutputSize(SDL_Renderer * renderer, int *w, int *h)
|
764
|
+
{ @autoreleasepool {
|
765
|
+
METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata;
|
766
|
+
if (w) {
|
767
|
+
*w = (int)data.mtllayer.drawableSize.width;
|
768
|
+
}
|
769
|
+
if (h) {
|
770
|
+
*h = (int)data.mtllayer.drawableSize.height;
|
771
|
+
}
|
772
|
+
return 0;
|
773
|
+
}}
|
774
|
+
|
775
|
+
static SDL_bool
|
776
|
+
METAL_SupportsBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode)
|
777
|
+
{
|
778
|
+
SDL_BlendFactor srcColorFactor = SDL_GetBlendModeSrcColorFactor(blendMode);
|
779
|
+
SDL_BlendFactor srcAlphaFactor = SDL_GetBlendModeSrcAlphaFactor(blendMode);
|
780
|
+
SDL_BlendOperation colorOperation = SDL_GetBlendModeColorOperation(blendMode);
|
781
|
+
SDL_BlendFactor dstColorFactor = SDL_GetBlendModeDstColorFactor(blendMode);
|
782
|
+
SDL_BlendFactor dstAlphaFactor = SDL_GetBlendModeDstAlphaFactor(blendMode);
|
783
|
+
SDL_BlendOperation alphaOperation = SDL_GetBlendModeAlphaOperation(blendMode);
|
784
|
+
|
785
|
+
if (GetBlendFactor(srcColorFactor) == invalidBlendFactor ||
|
786
|
+
GetBlendFactor(srcAlphaFactor) == invalidBlendFactor ||
|
787
|
+
GetBlendOperation(colorOperation) == invalidBlendOperation ||
|
788
|
+
GetBlendFactor(dstColorFactor) == invalidBlendFactor ||
|
789
|
+
GetBlendFactor(dstAlphaFactor) == invalidBlendFactor ||
|
790
|
+
GetBlendOperation(alphaOperation) == invalidBlendOperation) {
|
791
|
+
return SDL_FALSE;
|
792
|
+
}
|
793
|
+
return SDL_TRUE;
|
794
|
+
}
|
795
|
+
|
796
|
+
static int
|
797
|
+
METAL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
798
|
+
{ @autoreleasepool {
|
799
|
+
METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata;
|
800
|
+
MTLPixelFormat pixfmt;
|
801
|
+
|
802
|
+
switch (texture->format) {
|
803
|
+
case SDL_PIXELFORMAT_ABGR8888:
|
804
|
+
pixfmt = MTLPixelFormatRGBA8Unorm;
|
805
|
+
break;
|
806
|
+
case SDL_PIXELFORMAT_ARGB8888:
|
807
|
+
pixfmt = MTLPixelFormatBGRA8Unorm;
|
808
|
+
break;
|
809
|
+
case SDL_PIXELFORMAT_IYUV:
|
810
|
+
case SDL_PIXELFORMAT_YV12:
|
811
|
+
case SDL_PIXELFORMAT_NV12:
|
812
|
+
case SDL_PIXELFORMAT_NV21:
|
813
|
+
pixfmt = MTLPixelFormatR8Unorm;
|
814
|
+
break;
|
815
|
+
default:
|
816
|
+
return SDL_SetError("Texture format %s not supported by Metal", SDL_GetPixelFormatName(texture->format));
|
817
|
+
}
|
818
|
+
|
819
|
+
MTLTextureDescriptor *mtltexdesc = [MTLTextureDescriptor texture2DDescriptorWithPixelFormat:pixfmt
|
820
|
+
width:(NSUInteger)texture->w height:(NSUInteger)texture->h mipmapped:NO];
|
821
|
+
|
822
|
+
/* Not available in iOS 8. */
|
823
|
+
if ([mtltexdesc respondsToSelector:@selector(usage)]) {
|
824
|
+
if (texture->access == SDL_TEXTUREACCESS_TARGET) {
|
825
|
+
mtltexdesc.usage = MTLTextureUsageShaderRead | MTLTextureUsageRenderTarget;
|
826
|
+
} else {
|
827
|
+
mtltexdesc.usage = MTLTextureUsageShaderRead;
|
828
|
+
}
|
829
|
+
}
|
830
|
+
|
831
|
+
id<MTLTexture> mtltexture = [data.mtldevice newTextureWithDescriptor:mtltexdesc];
|
832
|
+
if (mtltexture == nil) {
|
833
|
+
return SDL_SetError("Texture allocation failed");
|
834
|
+
}
|
835
|
+
|
836
|
+
id<MTLTexture> mtltexture_uv = nil;
|
837
|
+
|
838
|
+
BOOL yuv = (texture->format == SDL_PIXELFORMAT_IYUV) || (texture->format == SDL_PIXELFORMAT_YV12);
|
839
|
+
BOOL nv12 = (texture->format == SDL_PIXELFORMAT_NV12) || (texture->format == SDL_PIXELFORMAT_NV21);
|
840
|
+
|
841
|
+
if (yuv) {
|
842
|
+
mtltexdesc.pixelFormat = MTLPixelFormatR8Unorm;
|
843
|
+
mtltexdesc.width = (texture->w + 1) / 2;
|
844
|
+
mtltexdesc.height = (texture->h + 1) / 2;
|
845
|
+
mtltexdesc.textureType = MTLTextureType2DArray;
|
846
|
+
mtltexdesc.arrayLength = 2;
|
847
|
+
mtltexture_uv = [data.mtldevice newTextureWithDescriptor:mtltexdesc];
|
848
|
+
} else if (nv12) {
|
849
|
+
mtltexdesc.pixelFormat = MTLPixelFormatRG8Unorm;
|
850
|
+
mtltexdesc.width = (texture->w + 1) / 2;
|
851
|
+
mtltexdesc.height = (texture->h + 1) / 2;
|
852
|
+
mtltexture_uv = [data.mtldevice newTextureWithDescriptor:mtltexdesc];
|
853
|
+
}
|
854
|
+
|
855
|
+
METAL_TextureData *texturedata = [[METAL_TextureData alloc] init];
|
856
|
+
if (texture->scaleMode == SDL_ScaleModeNearest) {
|
857
|
+
texturedata.mtlsampler = data.mtlsamplernearest;
|
858
|
+
} else {
|
859
|
+
texturedata.mtlsampler = data.mtlsamplerlinear;
|
860
|
+
}
|
861
|
+
texturedata.mtltexture = mtltexture;
|
862
|
+
texturedata.mtltexture_uv = mtltexture_uv;
|
863
|
+
|
864
|
+
texturedata.yuv = yuv;
|
865
|
+
texturedata.nv12 = nv12;
|
866
|
+
|
867
|
+
if (yuv) {
|
868
|
+
texturedata.fragmentFunction = SDL_METAL_FRAGMENT_YUV;
|
869
|
+
} else if (texture->format == SDL_PIXELFORMAT_NV12) {
|
870
|
+
texturedata.fragmentFunction = SDL_METAL_FRAGMENT_NV12;
|
871
|
+
} else if (texture->format == SDL_PIXELFORMAT_NV21) {
|
872
|
+
texturedata.fragmentFunction = SDL_METAL_FRAGMENT_NV21;
|
873
|
+
} else {
|
874
|
+
texturedata.fragmentFunction = SDL_METAL_FRAGMENT_COPY;
|
875
|
+
}
|
876
|
+
|
877
|
+
if (yuv || nv12) {
|
878
|
+
size_t offset = 0;
|
879
|
+
SDL_YUV_CONVERSION_MODE mode = SDL_GetYUVConversionModeForResolution(texture->w, texture->h);
|
880
|
+
switch (mode) {
|
881
|
+
case SDL_YUV_CONVERSION_JPEG: offset = CONSTANTS_OFFSET_DECODE_JPEG; break;
|
882
|
+
case SDL_YUV_CONVERSION_BT601: offset = CONSTANTS_OFFSET_DECODE_BT601; break;
|
883
|
+
case SDL_YUV_CONVERSION_BT709: offset = CONSTANTS_OFFSET_DECODE_BT709; break;
|
884
|
+
default: offset = 0; break;
|
885
|
+
}
|
886
|
+
texturedata.conversionBufferOffset = offset;
|
887
|
+
}
|
888
|
+
|
889
|
+
texture->driverdata = (void*)CFBridgingRetain(texturedata);
|
890
|
+
|
891
|
+
#if !__has_feature(objc_arc)
|
892
|
+
[texturedata release];
|
893
|
+
[mtltexture release];
|
894
|
+
[mtltexture_uv release];
|
895
|
+
#endif
|
896
|
+
|
897
|
+
return 0;
|
898
|
+
}}
|
899
|
+
|
900
|
+
static int
|
901
|
+
METAL_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
|
902
|
+
const SDL_Rect * rect, const void *pixels, int pitch)
|
903
|
+
{ @autoreleasepool {
|
904
|
+
METAL_TextureData *texturedata = (__bridge METAL_TextureData *)texture->driverdata;
|
905
|
+
|
906
|
+
/* !!! FIXME: replaceRegion does not do any synchronization, so it might
|
907
|
+
* !!! FIXME: stomp on a previous frame's data that's currently being read
|
908
|
+
* !!! FIXME: by the GPU. */
|
909
|
+
[texturedata.mtltexture replaceRegion:MTLRegionMake2D(rect->x, rect->y, rect->w, rect->h)
|
910
|
+
mipmapLevel:0
|
911
|
+
withBytes:pixels
|
912
|
+
bytesPerRow:pitch];
|
913
|
+
|
914
|
+
if (texturedata.yuv) {
|
915
|
+
int Uslice = texture->format == SDL_PIXELFORMAT_YV12 ? 1 : 0;
|
916
|
+
int Vslice = texture->format == SDL_PIXELFORMAT_YV12 ? 0 : 1;
|
917
|
+
|
918
|
+
/* Skip to the correct offset into the next texture */
|
919
|
+
pixels = (const void*)((const Uint8*)pixels + rect->h * pitch);
|
920
|
+
[texturedata.mtltexture_uv replaceRegion:MTLRegionMake2D(rect->x / 2, rect->y / 2, (rect->w + 1) / 2, (rect->h + 1) / 2)
|
921
|
+
mipmapLevel:0
|
922
|
+
slice:Uslice
|
923
|
+
withBytes:pixels
|
924
|
+
bytesPerRow:(pitch + 1) / 2
|
925
|
+
bytesPerImage:0];
|
926
|
+
|
927
|
+
/* Skip to the correct offset into the next texture */
|
928
|
+
pixels = (const void*)((const Uint8*)pixels + ((rect->h + 1) / 2) * ((pitch + 1)/2));
|
929
|
+
[texturedata.mtltexture_uv replaceRegion:MTLRegionMake2D(rect->x / 2, rect->y / 2, (rect->w + 1) / 2, (rect->h + 1) / 2)
|
930
|
+
mipmapLevel:0
|
931
|
+
slice:Vslice
|
932
|
+
withBytes:pixels
|
933
|
+
bytesPerRow:(pitch + 1) / 2
|
934
|
+
bytesPerImage:0];
|
935
|
+
}
|
936
|
+
|
937
|
+
if (texturedata.nv12) {
|
938
|
+
/* Skip to the correct offset into the next texture */
|
939
|
+
pixels = (const void*)((const Uint8*)pixels + rect->h * pitch);
|
940
|
+
[texturedata.mtltexture_uv replaceRegion:MTLRegionMake2D(rect->x / 2, rect->y / 2, (rect->w + 1) / 2, (rect->h + 1) / 2)
|
941
|
+
mipmapLevel:0
|
942
|
+
slice:0
|
943
|
+
withBytes:pixels
|
944
|
+
bytesPerRow:2 * ((pitch + 1) / 2)
|
945
|
+
bytesPerImage:0];
|
946
|
+
}
|
947
|
+
|
948
|
+
return 0;
|
949
|
+
}}
|
950
|
+
|
951
|
+
static int
|
952
|
+
METAL_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture,
|
953
|
+
const SDL_Rect * rect,
|
954
|
+
const Uint8 *Yplane, int Ypitch,
|
955
|
+
const Uint8 *Uplane, int Upitch,
|
956
|
+
const Uint8 *Vplane, int Vpitch)
|
957
|
+
{ @autoreleasepool {
|
958
|
+
METAL_TextureData *texturedata = (__bridge METAL_TextureData *)texture->driverdata;
|
959
|
+
int Uslice = texture->format == SDL_PIXELFORMAT_YV12 ? 1 : 0;
|
960
|
+
int Vslice = texture->format == SDL_PIXELFORMAT_YV12 ? 0 : 1;
|
961
|
+
|
962
|
+
/* Bail out if we're supposed to update an empty rectangle */
|
963
|
+
if (rect->w <= 0 || rect->h <= 0) {
|
964
|
+
return 0;
|
965
|
+
}
|
966
|
+
|
967
|
+
[texturedata.mtltexture replaceRegion:MTLRegionMake2D(rect->x, rect->y, rect->w, rect->h)
|
968
|
+
mipmapLevel:0
|
969
|
+
withBytes:Yplane
|
970
|
+
bytesPerRow:Ypitch];
|
971
|
+
|
972
|
+
[texturedata.mtltexture_uv replaceRegion:MTLRegionMake2D(rect->x / 2, rect->y / 2, (rect->w + 1) / 2, (rect->h + 1) / 2)
|
973
|
+
mipmapLevel:0
|
974
|
+
slice:Uslice
|
975
|
+
withBytes:Uplane
|
976
|
+
bytesPerRow:Upitch
|
977
|
+
bytesPerImage:0];
|
978
|
+
|
979
|
+
[texturedata.mtltexture_uv replaceRegion:MTLRegionMake2D(rect->x / 2, rect->y / 2, (rect->w + 1) / 2, (rect->h + 1) / 2)
|
980
|
+
mipmapLevel:0
|
981
|
+
slice:Vslice
|
982
|
+
withBytes:Vplane
|
983
|
+
bytesPerRow:Vpitch
|
984
|
+
bytesPerImage:0];
|
985
|
+
|
986
|
+
return 0;
|
987
|
+
}}
|
988
|
+
|
989
|
+
static int
|
990
|
+
METAL_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
|
991
|
+
const SDL_Rect * rect, void **pixels, int *pitch)
|
992
|
+
{
|
993
|
+
return SDL_Unsupported(); // !!! FIXME: write me
|
994
|
+
}
|
995
|
+
|
996
|
+
static void
|
997
|
+
METAL_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
998
|
+
{
|
999
|
+
// !!! FIXME: write me
|
1000
|
+
}
|
1001
|
+
|
1002
|
+
static int
|
1003
|
+
METAL_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture)
|
1004
|
+
{ @autoreleasepool {
|
1005
|
+
METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata;
|
1006
|
+
|
1007
|
+
if (data.mtlcmdencoder) {
|
1008
|
+
/* End encoding for the previous render target so we can set up a new
|
1009
|
+
* render pass for this one. */
|
1010
|
+
[data.mtlcmdencoder endEncoding];
|
1011
|
+
[data.mtlcmdbuffer commit];
|
1012
|
+
|
1013
|
+
data.mtlcmdencoder = nil;
|
1014
|
+
data.mtlcmdbuffer = nil;
|
1015
|
+
}
|
1016
|
+
|
1017
|
+
/* We don't begin a new render pass right away - we delay it until an actual
|
1018
|
+
* draw or clear happens. That way we can use hardware clears when possible,
|
1019
|
+
* which are only available when beginning a new render pass. */
|
1020
|
+
return 0;
|
1021
|
+
}}
|
1022
|
+
|
1023
|
+
static int
|
1024
|
+
METAL_SetOrthographicProjection(SDL_Renderer *renderer, int w, int h)
|
1025
|
+
{ @autoreleasepool {
|
1026
|
+
METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata;
|
1027
|
+
float projection[4][4];
|
1028
|
+
|
1029
|
+
if (!w || !h) {
|
1030
|
+
return 0;
|
1031
|
+
}
|
1032
|
+
|
1033
|
+
/* Prepare an orthographic projection */
|
1034
|
+
projection[0][0] = 2.0f / w;
|
1035
|
+
projection[0][1] = 0.0f;
|
1036
|
+
projection[0][2] = 0.0f;
|
1037
|
+
projection[0][3] = 0.0f;
|
1038
|
+
projection[1][0] = 0.0f;
|
1039
|
+
projection[1][1] = -2.0f / h;
|
1040
|
+
projection[1][2] = 0.0f;
|
1041
|
+
projection[1][3] = 0.0f;
|
1042
|
+
projection[2][0] = 0.0f;
|
1043
|
+
projection[2][1] = 0.0f;
|
1044
|
+
projection[2][2] = 0.0f;
|
1045
|
+
projection[2][3] = 0.0f;
|
1046
|
+
projection[3][0] = -1.0f;
|
1047
|
+
projection[3][1] = 1.0f;
|
1048
|
+
projection[3][2] = 0.0f;
|
1049
|
+
projection[3][3] = 1.0f;
|
1050
|
+
|
1051
|
+
// !!! FIXME: This should be in a buffer...
|
1052
|
+
[data.mtlcmdencoder setVertexBytes:projection length:sizeof(float)*16 atIndex:2];
|
1053
|
+
return 0;
|
1054
|
+
}}
|
1055
|
+
|
1056
|
+
static int
|
1057
|
+
METAL_UpdateViewport(SDL_Renderer * renderer)
|
1058
|
+
{ @autoreleasepool {
|
1059
|
+
METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata;
|
1060
|
+
if (data.mtlcmdencoder) {
|
1061
|
+
MTLViewport viewport;
|
1062
|
+
viewport.originX = renderer->viewport.x;
|
1063
|
+
viewport.originY = renderer->viewport.y;
|
1064
|
+
viewport.width = renderer->viewport.w;
|
1065
|
+
viewport.height = renderer->viewport.h;
|
1066
|
+
viewport.znear = 0.0;
|
1067
|
+
viewport.zfar = 1.0;
|
1068
|
+
[data.mtlcmdencoder setViewport:viewport];
|
1069
|
+
METAL_SetOrthographicProjection(renderer, renderer->viewport.w, renderer->viewport.h);
|
1070
|
+
}
|
1071
|
+
return 0;
|
1072
|
+
}}
|
1073
|
+
|
1074
|
+
static int
|
1075
|
+
METAL_UpdateClipRect(SDL_Renderer * renderer)
|
1076
|
+
{ @autoreleasepool {
|
1077
|
+
METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata;
|
1078
|
+
if (data.mtlcmdencoder) {
|
1079
|
+
MTLScissorRect mtlrect;
|
1080
|
+
// !!! FIXME: should this care about the viewport?
|
1081
|
+
if (renderer->clipping_enabled) {
|
1082
|
+
const SDL_Rect *rect = &renderer->clip_rect;
|
1083
|
+
mtlrect.x = renderer->viewport.x + rect->x;
|
1084
|
+
mtlrect.y = renderer->viewport.x + rect->y;
|
1085
|
+
mtlrect.width = rect->w;
|
1086
|
+
mtlrect.height = rect->h;
|
1087
|
+
} else {
|
1088
|
+
mtlrect.x = renderer->viewport.x;
|
1089
|
+
mtlrect.y = renderer->viewport.y;
|
1090
|
+
mtlrect.width = renderer->viewport.w;
|
1091
|
+
mtlrect.height = renderer->viewport.h;
|
1092
|
+
}
|
1093
|
+
if (mtlrect.width > 0 && mtlrect.height > 0) {
|
1094
|
+
[data.mtlcmdencoder setScissorRect:mtlrect];
|
1095
|
+
}
|
1096
|
+
}
|
1097
|
+
return 0;
|
1098
|
+
}}
|
1099
|
+
|
1100
|
+
static int
|
1101
|
+
METAL_RenderClear(SDL_Renderer * renderer)
|
1102
|
+
{ @autoreleasepool {
|
1103
|
+
METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata;
|
1104
|
+
|
1105
|
+
/* Since we set up the render command encoder lazily when a draw is
|
1106
|
+
* requested, we can do the fast path hardware clear if no draws have
|
1107
|
+
* happened since the last SetRenderTarget. */
|
1108
|
+
if (data.mtlcmdencoder == nil) {
|
1109
|
+
METAL_ActivateRenderCommandEncoder(renderer, MTLLoadActionClear);
|
1110
|
+
} else {
|
1111
|
+
// !!! FIXME: render color should live in a dedicated uniform buffer.
|
1112
|
+
const float color[4] = { ((float)renderer->r) / 255.0f, ((float)renderer->g) / 255.0f, ((float)renderer->b) / 255.0f, ((float)renderer->a) / 255.0f };
|
1113
|
+
|
1114
|
+
MTLViewport viewport; // RenderClear ignores the viewport state, though, so reset that.
|
1115
|
+
viewport.originX = viewport.originY = 0.0;
|
1116
|
+
viewport.width = data.mtlpassdesc.colorAttachments[0].texture.width;
|
1117
|
+
viewport.height = data.mtlpassdesc.colorAttachments[0].texture.height;
|
1118
|
+
viewport.znear = 0.0;
|
1119
|
+
viewport.zfar = 1.0;
|
1120
|
+
|
1121
|
+
// Slow path for clearing: draw a filled fullscreen triangle.
|
1122
|
+
METAL_SetOrthographicProjection(renderer, 1, 1);
|
1123
|
+
[data.mtlcmdencoder setViewport:viewport];
|
1124
|
+
[data.mtlcmdencoder setRenderPipelineState:ChoosePipelineState(data, data.activepipelines, SDL_METAL_FRAGMENT_SOLID, SDL_BLENDMODE_NONE)];
|
1125
|
+
[data.mtlcmdencoder setVertexBuffer:data.mtlbufconstants offset:CONSTANTS_OFFSET_CLEAR_VERTS atIndex:0];
|
1126
|
+
[data.mtlcmdencoder setVertexBuffer:data.mtlbufconstants offset:CONSTANTS_OFFSET_IDENTITY atIndex:3];
|
1127
|
+
[data.mtlcmdencoder setFragmentBytes:color length:sizeof(color) atIndex:0];
|
1128
|
+
[data.mtlcmdencoder drawPrimitives:MTLPrimitiveTypeTriangle vertexStart:0 vertexCount:3];
|
1129
|
+
|
1130
|
+
// reset the viewport for the rest of our usual drawing work...
|
1131
|
+
viewport.originX = renderer->viewport.x;
|
1132
|
+
viewport.originY = renderer->viewport.y;
|
1133
|
+
viewport.width = renderer->viewport.w;
|
1134
|
+
viewport.height = renderer->viewport.h;
|
1135
|
+
viewport.znear = 0.0;
|
1136
|
+
viewport.zfar = 1.0;
|
1137
|
+
[data.mtlcmdencoder setViewport:viewport];
|
1138
|
+
METAL_SetOrthographicProjection(renderer, renderer->viewport.w, renderer->viewport.h);
|
1139
|
+
}
|
1140
|
+
|
1141
|
+
return 0;
|
1142
|
+
}}
|
1143
|
+
|
1144
|
+
// normalize a value from 0.0f to len into 0.0f to 1.0f.
|
1145
|
+
static inline float
|
1146
|
+
normtex(const float _val, const float len)
|
1147
|
+
{
|
1148
|
+
return _val / len;
|
1149
|
+
}
|
1150
|
+
|
1151
|
+
static int
|
1152
|
+
DrawVerts(SDL_Renderer * renderer, const SDL_FPoint * points, int count,
|
1153
|
+
const MTLPrimitiveType primtype)
|
1154
|
+
{ @autoreleasepool {
|
1155
|
+
METAL_ActivateRenderCommandEncoder(renderer, MTLLoadActionLoad);
|
1156
|
+
|
1157
|
+
const size_t vertlen = (sizeof (float) * 2) * count;
|
1158
|
+
METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata;
|
1159
|
+
|
1160
|
+
// !!! FIXME: render color should live in a dedicated uniform buffer.
|
1161
|
+
const float color[4] = { ((float)renderer->r) / 255.0f, ((float)renderer->g) / 255.0f, ((float)renderer->b) / 255.0f, ((float)renderer->a) / 255.0f };
|
1162
|
+
|
1163
|
+
[data.mtlcmdencoder setRenderPipelineState:ChoosePipelineState(data, data.activepipelines, SDL_METAL_FRAGMENT_SOLID, renderer->blendMode)];
|
1164
|
+
[data.mtlcmdencoder setFragmentBytes:color length:sizeof(color) atIndex:0];
|
1165
|
+
|
1166
|
+
[data.mtlcmdencoder setVertexBytes:points length:vertlen atIndex:0];
|
1167
|
+
[data.mtlcmdencoder setVertexBuffer:data.mtlbufconstants offset:CONSTANTS_OFFSET_HALF_PIXEL_TRANSFORM atIndex:3];
|
1168
|
+
[data.mtlcmdencoder drawPrimitives:primtype vertexStart:0 vertexCount:count];
|
1169
|
+
|
1170
|
+
return 0;
|
1171
|
+
}}
|
1172
|
+
|
1173
|
+
static int
|
1174
|
+
METAL_RenderDrawPoints(SDL_Renderer * renderer, const SDL_FPoint * points, int count)
|
1175
|
+
{
|
1176
|
+
return DrawVerts(renderer, points, count, MTLPrimitiveTypePoint);
|
1177
|
+
}
|
1178
|
+
|
1179
|
+
static int
|
1180
|
+
METAL_RenderDrawLines(SDL_Renderer * renderer, const SDL_FPoint * points, int count)
|
1181
|
+
{
|
1182
|
+
return DrawVerts(renderer, points, count, MTLPrimitiveTypeLineStrip);
|
1183
|
+
}
|
1184
|
+
|
1185
|
+
static int
|
1186
|
+
METAL_RenderFillRects(SDL_Renderer * renderer, const SDL_FRect * rects, int count)
|
1187
|
+
{ @autoreleasepool {
|
1188
|
+
METAL_ActivateRenderCommandEncoder(renderer, MTLLoadActionLoad);
|
1189
|
+
METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata;
|
1190
|
+
|
1191
|
+
// !!! FIXME: render color should live in a dedicated uniform buffer.
|
1192
|
+
const float color[4] = { ((float)renderer->r) / 255.0f, ((float)renderer->g) / 255.0f, ((float)renderer->b) / 255.0f, ((float)renderer->a) / 255.0f };
|
1193
|
+
|
1194
|
+
[data.mtlcmdencoder setRenderPipelineState:ChoosePipelineState(data, data.activepipelines, SDL_METAL_FRAGMENT_SOLID, renderer->blendMode)];
|
1195
|
+
[data.mtlcmdencoder setFragmentBytes:color length:sizeof(color) atIndex:0];
|
1196
|
+
[data.mtlcmdencoder setVertexBuffer:data.mtlbufconstants offset:CONSTANTS_OFFSET_IDENTITY atIndex:3];
|
1197
|
+
|
1198
|
+
for (int i = 0; i < count; i++, rects++) {
|
1199
|
+
if ((rects->w <= 0.0f) || (rects->h <= 0.0f)) continue;
|
1200
|
+
|
1201
|
+
const float verts[] = {
|
1202
|
+
rects->x, rects->y + rects->h,
|
1203
|
+
rects->x, rects->y,
|
1204
|
+
rects->x + rects->w, rects->y + rects->h,
|
1205
|
+
rects->x + rects->w, rects->y
|
1206
|
+
};
|
1207
|
+
|
1208
|
+
[data.mtlcmdencoder setVertexBytes:verts length:sizeof(verts) atIndex:0];
|
1209
|
+
[data.mtlcmdencoder drawPrimitives:MTLPrimitiveTypeTriangleStrip vertexStart:0 vertexCount:4];
|
1210
|
+
}
|
1211
|
+
|
1212
|
+
return 0;
|
1213
|
+
}}
|
1214
|
+
|
1215
|
+
static void
|
1216
|
+
METAL_SetupRenderCopy(METAL_RenderData *data, SDL_Texture *texture, METAL_TextureData *texturedata)
|
1217
|
+
{
|
1218
|
+
float color[4] = { 1.0f, 1.0f, 1.0f, 1.0f };
|
1219
|
+
if (texture->modMode) {
|
1220
|
+
color[0] = ((float)texture->r) / 255.0f;
|
1221
|
+
color[1] = ((float)texture->g) / 255.0f;
|
1222
|
+
color[2] = ((float)texture->b) / 255.0f;
|
1223
|
+
color[3] = ((float)texture->a) / 255.0f;
|
1224
|
+
}
|
1225
|
+
|
1226
|
+
[data.mtlcmdencoder setRenderPipelineState:ChoosePipelineState(data, data.activepipelines, texturedata.fragmentFunction, texture->blendMode)];
|
1227
|
+
[data.mtlcmdencoder setFragmentBytes:color length:sizeof(color) atIndex:0];
|
1228
|
+
[data.mtlcmdencoder setFragmentSamplerState:texturedata.mtlsampler atIndex:0];
|
1229
|
+
|
1230
|
+
[data.mtlcmdencoder setFragmentTexture:texturedata.mtltexture atIndex:0];
|
1231
|
+
|
1232
|
+
if (texturedata.yuv || texturedata.nv12) {
|
1233
|
+
[data.mtlcmdencoder setFragmentTexture:texturedata.mtltexture_uv atIndex:1];
|
1234
|
+
[data.mtlcmdencoder setFragmentBuffer:data.mtlbufconstants offset:texturedata.conversionBufferOffset atIndex:1];
|
1235
|
+
}
|
1236
|
+
}
|
1237
|
+
|
1238
|
+
static int
|
1239
|
+
METAL_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
|
1240
|
+
const SDL_Rect * srcrect, const SDL_FRect * dstrect)
|
1241
|
+
{ @autoreleasepool {
|
1242
|
+
METAL_ActivateRenderCommandEncoder(renderer, MTLLoadActionLoad);
|
1243
|
+
METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata;
|
1244
|
+
METAL_TextureData *texturedata = (__bridge METAL_TextureData *)texture->driverdata;
|
1245
|
+
const float texw = (float) texturedata.mtltexture.width;
|
1246
|
+
const float texh = (float) texturedata.mtltexture.height;
|
1247
|
+
|
1248
|
+
METAL_SetupRenderCopy(data, texture, texturedata);
|
1249
|
+
|
1250
|
+
const float xy[] = {
|
1251
|
+
dstrect->x, dstrect->y + dstrect->h,
|
1252
|
+
dstrect->x, dstrect->y,
|
1253
|
+
dstrect->x + dstrect->w, dstrect->y + dstrect->h,
|
1254
|
+
dstrect->x + dstrect->w, dstrect->y
|
1255
|
+
};
|
1256
|
+
|
1257
|
+
const float uv[] = {
|
1258
|
+
normtex(srcrect->x, texw), normtex(srcrect->y + srcrect->h, texh),
|
1259
|
+
normtex(srcrect->x, texw), normtex(srcrect->y, texh),
|
1260
|
+
normtex(srcrect->x + srcrect->w, texw), normtex(srcrect->y + srcrect->h, texh),
|
1261
|
+
normtex(srcrect->x + srcrect->w, texw), normtex(srcrect->y, texh)
|
1262
|
+
};
|
1263
|
+
|
1264
|
+
[data.mtlcmdencoder setVertexBytes:xy length:sizeof(xy) atIndex:0];
|
1265
|
+
[data.mtlcmdencoder setVertexBytes:uv length:sizeof(uv) atIndex:1];
|
1266
|
+
[data.mtlcmdencoder setVertexBuffer:data.mtlbufconstants offset:CONSTANTS_OFFSET_IDENTITY atIndex:3];
|
1267
|
+
[data.mtlcmdencoder drawPrimitives:MTLPrimitiveTypeTriangleStrip vertexStart:0 vertexCount:4];
|
1268
|
+
|
1269
|
+
return 0;
|
1270
|
+
}}
|
1271
|
+
|
1272
|
+
static int
|
1273
|
+
METAL_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture,
|
1274
|
+
const SDL_Rect * srcrect, const SDL_FRect * dstrect,
|
1275
|
+
const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip)
|
1276
|
+
{ @autoreleasepool {
|
1277
|
+
METAL_ActivateRenderCommandEncoder(renderer, MTLLoadActionLoad);
|
1278
|
+
METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata;
|
1279
|
+
METAL_TextureData *texturedata = (__bridge METAL_TextureData *)texture->driverdata;
|
1280
|
+
const float texw = (float) texturedata.mtltexture.width;
|
1281
|
+
const float texh = (float) texturedata.mtltexture.height;
|
1282
|
+
float transform[16];
|
1283
|
+
float minu, maxu, minv, maxv;
|
1284
|
+
|
1285
|
+
METAL_SetupRenderCopy(data, texture, texturedata);
|
1286
|
+
|
1287
|
+
minu = normtex(srcrect->x, texw);
|
1288
|
+
maxu = normtex(srcrect->x + srcrect->w, texw);
|
1289
|
+
minv = normtex(srcrect->y, texh);
|
1290
|
+
maxv = normtex(srcrect->y + srcrect->h, texh);
|
1291
|
+
|
1292
|
+
if (flip & SDL_FLIP_HORIZONTAL) {
|
1293
|
+
float tmp = maxu;
|
1294
|
+
maxu = minu;
|
1295
|
+
minu = tmp;
|
1296
|
+
}
|
1297
|
+
if (flip & SDL_FLIP_VERTICAL) {
|
1298
|
+
float tmp = maxv;
|
1299
|
+
maxv = minv;
|
1300
|
+
minv = tmp;
|
1301
|
+
}
|
1302
|
+
|
1303
|
+
const float uv[] = {
|
1304
|
+
minu, maxv,
|
1305
|
+
minu, minv,
|
1306
|
+
maxu, maxv,
|
1307
|
+
maxu, minv
|
1308
|
+
};
|
1309
|
+
|
1310
|
+
const float xy[] = {
|
1311
|
+
-center->x, dstrect->h - center->y,
|
1312
|
+
-center->x, -center->y,
|
1313
|
+
dstrect->w - center->x, dstrect->h - center->y,
|
1314
|
+
dstrect->w - center->x, -center->y
|
1315
|
+
};
|
1316
|
+
|
1317
|
+
{
|
1318
|
+
float rads = (float)(M_PI * (float) angle / 180.0f);
|
1319
|
+
float c = cosf(rads), s = sinf(rads);
|
1320
|
+
SDL_memset(transform, 0, sizeof(transform));
|
1321
|
+
|
1322
|
+
transform[10] = transform[15] = 1.0f;
|
1323
|
+
|
1324
|
+
/* Rotation */
|
1325
|
+
transform[0] = c;
|
1326
|
+
transform[1] = s;
|
1327
|
+
transform[4] = -s;
|
1328
|
+
transform[5] = c;
|
1329
|
+
|
1330
|
+
/* Translation */
|
1331
|
+
transform[12] = dstrect->x + center->x;
|
1332
|
+
transform[13] = dstrect->y + center->y;
|
1333
|
+
}
|
1334
|
+
|
1335
|
+
[data.mtlcmdencoder setVertexBytes:xy length:sizeof(xy) atIndex:0];
|
1336
|
+
[data.mtlcmdencoder setVertexBytes:uv length:sizeof(uv) atIndex:1];
|
1337
|
+
[data.mtlcmdencoder setVertexBytes:transform length:sizeof(transform) atIndex:3];
|
1338
|
+
[data.mtlcmdencoder drawPrimitives:MTLPrimitiveTypeTriangleStrip vertexStart:0 vertexCount:4];
|
1339
|
+
|
1340
|
+
return 0;
|
1341
|
+
}}
|
1342
|
+
|
1343
|
+
static int
|
1344
|
+
METAL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
|
1345
|
+
Uint32 pixel_format, void * pixels, int pitch)
|
1346
|
+
{ @autoreleasepool {
|
1347
|
+
METAL_ActivateRenderCommandEncoder(renderer, MTLLoadActionLoad);
|
1348
|
+
|
1349
|
+
// !!! FIXME: this probably needs to commit the current command buffer, and probably waitUntilCompleted
|
1350
|
+
METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata;
|
1351
|
+
id<MTLTexture> mtltexture = data.mtlpassdesc.colorAttachments[0].texture;
|
1352
|
+
MTLRegion mtlregion = MTLRegionMake2D(rect->x, rect->y, rect->w, rect->h);
|
1353
|
+
|
1354
|
+
// we only do BGRA8 or RGBA8 at the moment, so 4 will do.
|
1355
|
+
const int temp_pitch = rect->w * 4;
|
1356
|
+
void *temp_pixels = SDL_malloc(temp_pitch * rect->h);
|
1357
|
+
if (!temp_pixels) {
|
1358
|
+
return SDL_OutOfMemory();
|
1359
|
+
}
|
1360
|
+
|
1361
|
+
[mtltexture getBytes:temp_pixels bytesPerRow:temp_pitch fromRegion:mtlregion mipmapLevel:0];
|
1362
|
+
|
1363
|
+
const Uint32 temp_format = (mtltexture.pixelFormat == MTLPixelFormatBGRA8Unorm) ? SDL_PIXELFORMAT_ARGB8888 : SDL_PIXELFORMAT_ABGR8888;
|
1364
|
+
const int status = SDL_ConvertPixels(rect->w, rect->h, temp_format, temp_pixels, temp_pitch, pixel_format, pixels, pitch);
|
1365
|
+
SDL_free(temp_pixels);
|
1366
|
+
return status;
|
1367
|
+
}}
|
1368
|
+
|
1369
|
+
static void
|
1370
|
+
METAL_RenderPresent(SDL_Renderer * renderer)
|
1371
|
+
{ @autoreleasepool {
|
1372
|
+
METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata;
|
1373
|
+
|
1374
|
+
if (data.mtlcmdencoder != nil) {
|
1375
|
+
[data.mtlcmdencoder endEncoding];
|
1376
|
+
}
|
1377
|
+
if (data.mtlbackbuffer != nil) {
|
1378
|
+
[data.mtlcmdbuffer presentDrawable:data.mtlbackbuffer];
|
1379
|
+
}
|
1380
|
+
if (data.mtlcmdbuffer != nil) {
|
1381
|
+
[data.mtlcmdbuffer commit];
|
1382
|
+
}
|
1383
|
+
data.mtlcmdencoder = nil;
|
1384
|
+
data.mtlcmdbuffer = nil;
|
1385
|
+
data.mtlbackbuffer = nil;
|
1386
|
+
}}
|
1387
|
+
|
1388
|
+
static void
|
1389
|
+
METAL_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
1390
|
+
{ @autoreleasepool {
|
1391
|
+
CFBridgingRelease(texture->driverdata);
|
1392
|
+
texture->driverdata = NULL;
|
1393
|
+
}}
|
1394
|
+
|
1395
|
+
static void
|
1396
|
+
METAL_DestroyRenderer(SDL_Renderer * renderer)
|
1397
|
+
{ @autoreleasepool {
|
1398
|
+
if (renderer->driverdata) {
|
1399
|
+
METAL_RenderData *data = CFBridgingRelease(renderer->driverdata);
|
1400
|
+
|
1401
|
+
if (data.mtlcmdencoder != nil) {
|
1402
|
+
[data.mtlcmdencoder endEncoding];
|
1403
|
+
}
|
1404
|
+
|
1405
|
+
DestroyAllPipelines(data.allpipelines, data.pipelinescount);
|
1406
|
+
}
|
1407
|
+
|
1408
|
+
SDL_free(renderer);
|
1409
|
+
}}
|
1410
|
+
|
1411
|
+
static void *
|
1412
|
+
METAL_GetMetalLayer(SDL_Renderer * renderer)
|
1413
|
+
{ @autoreleasepool {
|
1414
|
+
METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata;
|
1415
|
+
return (__bridge void*)data.mtllayer;
|
1416
|
+
}}
|
1417
|
+
|
1418
|
+
static void *
|
1419
|
+
METAL_GetMetalCommandEncoder(SDL_Renderer * renderer)
|
1420
|
+
{ @autoreleasepool {
|
1421
|
+
METAL_ActivateRenderCommandEncoder(renderer, MTLLoadActionLoad);
|
1422
|
+
METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata;
|
1423
|
+
return (__bridge void*)data.mtlcmdencoder;
|
1424
|
+
}}
|
1425
|
+
|
1426
|
+
#endif /* SDL_VIDEO_RENDER_METAL && !SDL_RENDER_DISABLED */
|
1427
|
+
|
1428
|
+
/* vi: set ts=4 sw=4 expandtab: */
|