alphatau 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1362) hide show
  1. checksums.yaml +7 -0
  2. data/Rakefile +11 -0
  3. data/bin/console +14 -0
  4. data/bin/setup +8 -0
  5. data/ext/alphatau/native/alphatau_native.cpp +141 -0
  6. data/ext/alphatau/native/extconf.rb +18 -0
  7. data/ext/alphatau/native/sdl/Android.mk +110 -0
  8. data/ext/alphatau/native/sdl/BUGS.txt +16 -0
  9. data/ext/alphatau/native/sdl/CMakeLists.txt +1877 -0
  10. data/ext/alphatau/native/sdl/COPYING.txt +20 -0
  11. data/ext/alphatau/native/sdl/CREDITS.txt +53 -0
  12. data/ext/alphatau/native/sdl/INSTALL.txt +40 -0
  13. data/ext/alphatau/native/sdl/Makefile.in +240 -0
  14. data/ext/alphatau/native/sdl/Makefile.minimal +44 -0
  15. data/ext/alphatau/native/sdl/Makefile.pandora +60 -0
  16. data/ext/alphatau/native/sdl/Makefile.psp +95 -0
  17. data/ext/alphatau/native/sdl/Makefile.wiz +80 -0
  18. data/ext/alphatau/native/sdl/README-SDL.txt +13 -0
  19. data/ext/alphatau/native/sdl/README.txt +21 -0
  20. data/ext/alphatau/native/sdl/SDL2.spec.in +118 -0
  21. data/ext/alphatau/native/sdl/SDL2Config.cmake +1 -0
  22. data/ext/alphatau/native/sdl/TODO.txt +10 -0
  23. data/ext/alphatau/native/sdl/VisualC-WinRT/SDL2-WinRT.nuspec +23 -0
  24. data/ext/alphatau/native/sdl/VisualC-WinRT/SDL2-WinRT.targets +38 -0
  25. data/ext/alphatau/native/sdl/VisualC-WinRT/SDL2main-WinRT-NonXAML.nuspec +22 -0
  26. data/ext/alphatau/native/sdl/VisualC-WinRT/SDL2main-WinRT-NonXAML.targets +10 -0
  27. data/ext/alphatau/native/sdl/VisualC-WinRT/UWP_VS2015/SDL-UWP.sln +34 -0
  28. data/ext/alphatau/native/sdl/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj +575 -0
  29. data/ext/alphatau/native/sdl/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj.filters +774 -0
  30. data/ext/alphatau/native/sdl/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.sln +28 -0
  31. data/ext/alphatau/native/sdl/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.vcxproj +466 -0
  32. data/ext/alphatau/native/sdl/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.vcxproj.filters +735 -0
  33. data/ext/alphatau/native/sdl/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.sln +34 -0
  34. data/ext/alphatau/native/sdl/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj +571 -0
  35. data/ext/alphatau/native/sdl/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj.filters +771 -0
  36. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/loopwave/Assets/Logo.png +0 -0
  37. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/loopwave/Assets/SmallLogo.png +0 -0
  38. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/loopwave/Assets/SplashScreen.png +0 -0
  39. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/loopwave/Assets/StoreLogo.png +0 -0
  40. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/loopwave/Package.appxmanifest +42 -0
  41. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/loopwave/loopwave_VS2012.vcxproj +170 -0
  42. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/loopwave/loopwave_VS2012_TemporaryKey.pfx +0 -0
  43. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/testthread/Assets/Logo.png +0 -0
  44. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/testthread/Assets/SmallLogo.png +0 -0
  45. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/testthread/Assets/SplashScreen.png +0 -0
  46. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/testthread/Assets/StoreLogo.png +0 -0
  47. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/testthread/Package.appxmanifest +42 -0
  48. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/testthread/testthread_VS2012.vcxproj +160 -0
  49. data/ext/alphatau/native/sdl/VisualC-WinRT/tests/testthread/testthread_VS2012_TemporaryKey.pfx +0 -0
  50. data/ext/alphatau/native/sdl/VisualC.html +146 -0
  51. data/ext/alphatau/native/sdl/VisualC/SDL.sln +291 -0
  52. data/ext/alphatau/native/sdl/VisualC/SDL/SDL.vcxproj +559 -0
  53. data/ext/alphatau/native/sdl/VisualC/SDL/SDL.vcxproj.filters +479 -0
  54. data/ext/alphatau/native/sdl/VisualC/SDLmain/SDLmain.vcxproj +162 -0
  55. data/ext/alphatau/native/sdl/VisualC/SDLtest/SDLtest.vcxproj +177 -0
  56. data/ext/alphatau/native/sdl/VisualC/clean.sh +4 -0
  57. data/ext/alphatau/native/sdl/VisualC/tests/checkkeys/checkkeys.vcxproj +218 -0
  58. data/ext/alphatau/native/sdl/VisualC/tests/controllermap/controllermap.vcxproj +259 -0
  59. data/ext/alphatau/native/sdl/VisualC/tests/loopwave/loopwave.vcxproj +229 -0
  60. data/ext/alphatau/native/sdl/VisualC/tests/testatomic/testatomic.vcxproj +203 -0
  61. data/ext/alphatau/native/sdl/VisualC/tests/testautomation/testautomation.vcxproj +230 -0
  62. data/ext/alphatau/native/sdl/VisualC/tests/testdraw2/testdraw2.vcxproj +209 -0
  63. data/ext/alphatau/native/sdl/VisualC/tests/testfile/testfile.vcxproj +203 -0
  64. data/ext/alphatau/native/sdl/VisualC/tests/testgamecontroller/testgamecontroller.vcxproj +259 -0
  65. data/ext/alphatau/native/sdl/VisualC/tests/testgesture/testgesture.vcxproj +203 -0
  66. data/ext/alphatau/native/sdl/VisualC/tests/testgl2/testgl2.vcxproj +213 -0
  67. data/ext/alphatau/native/sdl/VisualC/tests/testgles2/testgles2.vcxproj +209 -0
  68. data/ext/alphatau/native/sdl/VisualC/tests/testjoystick/testjoystick.vcxproj +203 -0
  69. data/ext/alphatau/native/sdl/VisualC/tests/testoverlay2/testoverlay2.vcxproj +224 -0
  70. data/ext/alphatau/native/sdl/VisualC/tests/testplatform/testplatform.vcxproj +231 -0
  71. data/ext/alphatau/native/sdl/VisualC/tests/testpower/testpower.vcxproj +203 -0
  72. data/ext/alphatau/native/sdl/VisualC/tests/testrendertarget/testrendertarget.vcxproj +247 -0
  73. data/ext/alphatau/native/sdl/VisualC/tests/testrumble/testrumble.vcxproj +203 -0
  74. data/ext/alphatau/native/sdl/VisualC/tests/testscale/testscale.vcxproj +247 -0
  75. data/ext/alphatau/native/sdl/VisualC/tests/testshape/testshape.vcxproj +203 -0
  76. data/ext/alphatau/native/sdl/VisualC/tests/testsprite2/testsprite2.vcxproj +229 -0
  77. data/ext/alphatau/native/sdl/VisualC/tests/testvulkan/testvulkan.vcxproj +203 -0
  78. data/ext/alphatau/native/sdl/VisualC/tests/testyuv/testyuv.vcxproj +233 -0
  79. data/ext/alphatau/native/sdl/VisualC/visualtest/unittest/testquit/testquit_VS2012.vcxproj +216 -0
  80. data/ext/alphatau/native/sdl/VisualC/visualtest/visualtest_VS2012.vcxproj +304 -0
  81. data/ext/alphatau/native/sdl/WhatsNew.txt +401 -0
  82. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/Default.png +0 -0
  83. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj +1299 -0
  84. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/Icon.png +0 -0
  85. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/Info.plist +32 -0
  86. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/README +43 -0
  87. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/bitmapfont/kromasky_16x16.bmp +0 -0
  88. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/bitmapfont/license.txt +258 -0
  89. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/drums/ds_brush_snare.wav +0 -0
  90. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/drums/ds_china.wav +0 -0
  91. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/drums/ds_kick_big_amb.wav +0 -0
  92. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/drums/ds_loose_skin_mute.wav +0 -0
  93. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/icon.bmp +0 -0
  94. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/ship.bmp +0 -0
  95. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/space.bmp +0 -0
  96. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/data/stroke.bmp +0 -0
  97. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/iOS Launch Screen.storyboard +40 -0
  98. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/accelerometer.c +226 -0
  99. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/common.c +56 -0
  100. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/common.h +10 -0
  101. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/fireworks.c +474 -0
  102. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/happy.c +180 -0
  103. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/keyboard.c +301 -0
  104. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/mixer.c +344 -0
  105. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/rectangles.c +92 -0
  106. data/ext/alphatau/native/sdl/Xcode-iOS/Demos/src/touch.c +129 -0
  107. data/ext/alphatau/native/sdl/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj +2047 -0
  108. data/ext/alphatau/native/sdl/Xcode-iOS/SDLtest/SDL2test.xcodeproj/project.pbxproj +422 -0
  109. data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/Default-568h@2x.png +0 -0
  110. data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/Default.png +0 -0
  111. data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/Icon.png +0 -0
  112. data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/Info.plist +28 -0
  113. data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns +0 -0
  114. data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist +10 -0
  115. data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/project.pbxproj +308 -0
  116. data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  117. data/ext/alphatau/native/sdl/Xcode-iOS/Template/SDL iOS Application/main.c +100 -0
  118. data/ext/alphatau/native/sdl/Xcode-iOS/Test/Info.plist +26 -0
  119. data/ext/alphatau/native/sdl/Xcode-iOS/Test/README +11 -0
  120. data/ext/alphatau/native/sdl/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj +3095 -0
  121. data/ext/alphatau/native/sdl/Xcode/SDL/Info-Framework.plist +28 -0
  122. data/ext/alphatau/native/sdl/Xcode/SDL/SDL.xcodeproj/project.pbxproj +3384 -0
  123. data/ext/alphatau/native/sdl/Xcode/SDL/pkg-support/SDL.info +15 -0
  124. data/ext/alphatau/native/sdl/Xcode/SDL/pkg-support/resources/License.txt +19 -0
  125. data/ext/alphatau/native/sdl/Xcode/SDL/pkg-support/resources/ReadMe.txt +32 -0
  126. data/ext/alphatau/native/sdl/Xcode/SDL/pkg-support/resources/SDL_DS_Store +0 -0
  127. data/ext/alphatau/native/sdl/Xcode/SDL/pkg-support/sdl_logo.pdf +0 -0
  128. data/ext/alphatau/native/sdl/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj +4995 -0
  129. data/ext/alphatau/native/sdl/Xcode/SDLTest/TestDropFile-Info.plist +35 -0
  130. data/ext/alphatau/native/sdl/Xcode/XcodeDocSet/Doxyfile +1558 -0
  131. data/ext/alphatau/native/sdl/acinclude/ac_check_define.m4 +14 -0
  132. data/ext/alphatau/native/sdl/acinclude/alsa.m4 +145 -0
  133. data/ext/alphatau/native/sdl/acinclude/ax_check_compiler_flags.m4 +76 -0
  134. data/ext/alphatau/native/sdl/acinclude/ax_gcc_archflag.m4 +215 -0
  135. data/ext/alphatau/native/sdl/acinclude/ax_gcc_x86_cpuid.m4.htm +79 -0
  136. data/ext/alphatau/native/sdl/acinclude/esd.m4 +168 -0
  137. data/ext/alphatau/native/sdl/acinclude/libtool.m4 +7998 -0
  138. data/ext/alphatau/native/sdl/acinclude/ltoptions.m4 +384 -0
  139. data/ext/alphatau/native/sdl/acinclude/ltsugar.m4 +123 -0
  140. data/ext/alphatau/native/sdl/acinclude/ltversion.m4 +23 -0
  141. data/ext/alphatau/native/sdl/acinclude/lt~obsolete.m4 +98 -0
  142. data/ext/alphatau/native/sdl/android-project-ant/AndroidManifest.xml +1 -0
  143. data/ext/alphatau/native/sdl/android-project-ant/ant.properties +17 -0
  144. data/ext/alphatau/native/sdl/android-project-ant/build.properties +17 -0
  145. data/ext/alphatau/native/sdl/android-project-ant/build.xml +93 -0
  146. data/ext/alphatau/native/sdl/android-project-ant/default.properties +11 -0
  147. data/ext/alphatau/native/sdl/android-project-ant/jni/Android.mk +1 -0
  148. data/ext/alphatau/native/sdl/android-project-ant/jni/Application.mk +10 -0
  149. data/ext/alphatau/native/sdl/android-project-ant/jni/src/Android.mk +18 -0
  150. data/ext/alphatau/native/sdl/android-project-ant/jni/src/Android_static.mk +12 -0
  151. data/ext/alphatau/native/sdl/android-project-ant/proguard-project.txt +20 -0
  152. data/ext/alphatau/native/sdl/android-project-ant/project.properties +14 -0
  153. data/ext/alphatau/native/sdl/android-project-ant/res/drawable-hdpi/ic_launcher.png +0 -0
  154. data/ext/alphatau/native/sdl/android-project-ant/res/drawable-mdpi/ic_launcher.png +0 -0
  155. data/ext/alphatau/native/sdl/android-project-ant/res/drawable-xhdpi/ic_launcher.png +0 -0
  156. data/ext/alphatau/native/sdl/android-project-ant/res/drawable-xxhdpi/ic_launcher.png +0 -0
  157. data/ext/alphatau/native/sdl/android-project-ant/res/layout/main.xml +13 -0
  158. data/ext/alphatau/native/sdl/android-project-ant/res/values/strings.xml +4 -0
  159. data/ext/alphatau/native/sdl/android-project-ant/src +1 -0
  160. data/ext/alphatau/native/sdl/android-project/app/build.gradle +69 -0
  161. data/ext/alphatau/native/sdl/android-project/app/jni/Android.mk +1 -0
  162. data/ext/alphatau/native/sdl/android-project/app/jni/Application.mk +9 -0
  163. data/ext/alphatau/native/sdl/android-project/app/jni/src/Android.mk +18 -0
  164. data/ext/alphatau/native/sdl/android-project/app/proguard-rules.pro +17 -0
  165. data/ext/alphatau/native/sdl/android-project/app/src/main/AndroidManifest.xml +77 -0
  166. data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/HIDDevice.java +19 -0
  167. data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/HIDDeviceBLESteamController.java +640 -0
  168. data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/HIDDeviceManager.java +624 -0
  169. data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/HIDDeviceUSB.java +298 -0
  170. data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/SDL.java +37 -0
  171. data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java +2103 -0
  172. data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/SDLAudioManager.java +178 -0
  173. data/ext/alphatau/native/sdl/android-project/app/src/main/java/org/libsdl/app/SDLControllerManager.java +812 -0
  174. data/ext/alphatau/native/sdl/android-project/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  175. data/ext/alphatau/native/sdl/android-project/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  176. data/ext/alphatau/native/sdl/android-project/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  177. data/ext/alphatau/native/sdl/android-project/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  178. data/ext/alphatau/native/sdl/android-project/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  179. data/ext/alphatau/native/sdl/android-project/app/src/main/res/values/colors.xml +6 -0
  180. data/ext/alphatau/native/sdl/android-project/app/src/main/res/values/strings.xml +3 -0
  181. data/ext/alphatau/native/sdl/android-project/app/src/main/res/values/styles.xml +8 -0
  182. data/ext/alphatau/native/sdl/android-project/build.gradle +23 -0
  183. data/ext/alphatau/native/sdl/android-project/gradle.properties +17 -0
  184. data/ext/alphatau/native/sdl/android-project/gradle/wrapper/gradle-wrapper.jar +0 -0
  185. data/ext/alphatau/native/sdl/android-project/gradle/wrapper/gradle-wrapper.properties +6 -0
  186. data/ext/alphatau/native/sdl/android-project/gradlew +160 -0
  187. data/ext/alphatau/native/sdl/android-project/gradlew.bat +90 -0
  188. data/ext/alphatau/native/sdl/android-project/settings.gradle +1 -0
  189. data/ext/alphatau/native/sdl/autogen.sh +23 -0
  190. data/ext/alphatau/native/sdl/build-scripts/androidbuild.sh +100 -0
  191. data/ext/alphatau/native/sdl/build-scripts/androidbuildlibs.sh +74 -0
  192. data/ext/alphatau/native/sdl/build-scripts/checker-buildbot.sh +103 -0
  193. data/ext/alphatau/native/sdl/build-scripts/config.guess +1476 -0
  194. data/ext/alphatau/native/sdl/build-scripts/config.sub +1868 -0
  195. data/ext/alphatau/native/sdl/build-scripts/config.sub.patch +72 -0
  196. data/ext/alphatau/native/sdl/build-scripts/emscripten-buildbot.sh +77 -0
  197. data/ext/alphatau/native/sdl/build-scripts/g++-fat.sh +101 -0
  198. data/ext/alphatau/native/sdl/build-scripts/gcc-fat.sh +102 -0
  199. data/ext/alphatau/native/sdl/build-scripts/install-sh +323 -0
  200. data/ext/alphatau/native/sdl/build-scripts/iosbuild.sh +188 -0
  201. data/ext/alphatau/native/sdl/build-scripts/ltmain.sh +9658 -0
  202. data/ext/alphatau/native/sdl/build-scripts/mkinstalldirs +99 -0
  203. data/ext/alphatau/native/sdl/build-scripts/nacl-buildbot.sh +61 -0
  204. data/ext/alphatau/native/sdl/build-scripts/naclbuild.sh +105 -0
  205. data/ext/alphatau/native/sdl/build-scripts/raspberrypi-buildbot.sh +60 -0
  206. data/ext/alphatau/native/sdl/build-scripts/showrev.sh +5 -0
  207. data/ext/alphatau/native/sdl/build-scripts/strip_fPIC.sh +21 -0
  208. data/ext/alphatau/native/sdl/build-scripts/update-copyright.sh +8 -0
  209. data/ext/alphatau/native/sdl/build-scripts/updaterev.sh +20 -0
  210. data/ext/alphatau/native/sdl/build-scripts/windows-buildbot-zipper.bat +40 -0
  211. data/ext/alphatau/native/sdl/build-scripts/winrtbuild.bat +8 -0
  212. data/ext/alphatau/native/sdl/build-scripts/winrtbuild.ps1 +302 -0
  213. data/ext/alphatau/native/sdl/cmake/macros.cmake +73 -0
  214. data/ext/alphatau/native/sdl/cmake/sdlchecks.cmake +1184 -0
  215. data/ext/alphatau/native/sdl/cmake_uninstall.cmake.in +18 -0
  216. data/ext/alphatau/native/sdl/configure +27540 -0
  217. data/ext/alphatau/native/sdl/configure.in +4236 -0
  218. data/ext/alphatau/native/sdl/debian/changelog +114 -0
  219. data/ext/alphatau/native/sdl/debian/compat +1 -0
  220. data/ext/alphatau/native/sdl/debian/control +76 -0
  221. data/ext/alphatau/native/sdl/debian/copyright +351 -0
  222. data/ext/alphatau/native/sdl/debian/docs +4 -0
  223. data/ext/alphatau/native/sdl/debian/libsdl2-dev.install +8 -0
  224. data/ext/alphatau/native/sdl/debian/libsdl2-dev.manpages +1 -0
  225. data/ext/alphatau/native/sdl/debian/libsdl2.install +1 -0
  226. data/ext/alphatau/native/sdl/debian/rules +41 -0
  227. data/ext/alphatau/native/sdl/debian/sdl2-config.1 +86 -0
  228. data/ext/alphatau/native/sdl/debian/source/format +1 -0
  229. data/ext/alphatau/native/sdl/debian/watch +2 -0
  230. data/ext/alphatau/native/sdl/docs/README-android.md +432 -0
  231. data/ext/alphatau/native/sdl/docs/README-cmake.md +32 -0
  232. data/ext/alphatau/native/sdl/docs/README-directfb.md +107 -0
  233. data/ext/alphatau/native/sdl/docs/README-dynapi.md +130 -0
  234. data/ext/alphatau/native/sdl/docs/README-emscripten.md +35 -0
  235. data/ext/alphatau/native/sdl/docs/README-gesture.md +71 -0
  236. data/ext/alphatau/native/sdl/docs/README-hg.md +22 -0
  237. data/ext/alphatau/native/sdl/docs/README-ios.md +284 -0
  238. data/ext/alphatau/native/sdl/docs/README-linux.md +90 -0
  239. data/ext/alphatau/native/sdl/docs/README-macosx.md +240 -0
  240. data/ext/alphatau/native/sdl/docs/README-nacl.md +103 -0
  241. data/ext/alphatau/native/sdl/docs/README-pandora.md +17 -0
  242. data/ext/alphatau/native/sdl/docs/README-platforms.md +8 -0
  243. data/ext/alphatau/native/sdl/docs/README-porting.md +68 -0
  244. data/ext/alphatau/native/sdl/docs/README-psp.md +19 -0
  245. data/ext/alphatau/native/sdl/docs/README-raspberrypi.md +188 -0
  246. data/ext/alphatau/native/sdl/docs/README-touch.md +86 -0
  247. data/ext/alphatau/native/sdl/docs/README-wince.md +10 -0
  248. data/ext/alphatau/native/sdl/docs/README-windows.md +45 -0
  249. data/ext/alphatau/native/sdl/docs/README-winrt.md +544 -0
  250. data/ext/alphatau/native/sdl/docs/README.md +63 -0
  251. data/ext/alphatau/native/sdl/docs/doxyfile +1560 -0
  252. data/ext/alphatau/native/sdl/include/SDL.h +135 -0
  253. data/ext/alphatau/native/sdl/include/SDL_assert.h +291 -0
  254. data/ext/alphatau/native/sdl/include/SDL_atomic.h +277 -0
  255. data/ext/alphatau/native/sdl/include/SDL_audio.h +825 -0
  256. data/ext/alphatau/native/sdl/include/SDL_bits.h +112 -0
  257. data/ext/alphatau/native/sdl/include/SDL_blendmode.h +120 -0
  258. data/ext/alphatau/native/sdl/include/SDL_clipboard.h +71 -0
  259. data/ext/alphatau/native/sdl/include/SDL_config.h +53 -0
  260. data/ext/alphatau/native/sdl/include/SDL_config.h.cmake +471 -0
  261. data/ext/alphatau/native/sdl/include/SDL_config.h.in +417 -0
  262. data/ext/alphatau/native/sdl/include/SDL_config_android.h +177 -0
  263. data/ext/alphatau/native/sdl/include/SDL_config_iphoneos.h +201 -0
  264. data/ext/alphatau/native/sdl/include/SDL_config_macosx.h +240 -0
  265. data/ext/alphatau/native/sdl/include/SDL_config_minimal.h +85 -0
  266. data/ext/alphatau/native/sdl/include/SDL_config_pandora.h +133 -0
  267. data/ext/alphatau/native/sdl/include/SDL_config_psp.h +164 -0
  268. data/ext/alphatau/native/sdl/include/SDL_config_windows.h +254 -0
  269. data/ext/alphatau/native/sdl/include/SDL_config_winrt.h +235 -0
  270. data/ext/alphatau/native/sdl/include/SDL_config_wiz.h +146 -0
  271. data/ext/alphatau/native/sdl/include/SDL_copying.h +20 -0
  272. data/ext/alphatau/native/sdl/include/SDL_cpuinfo.h +188 -0
  273. data/ext/alphatau/native/sdl/include/SDL_egl.h +1673 -0
  274. data/ext/alphatau/native/sdl/include/SDL_endian.h +260 -0
  275. data/ext/alphatau/native/sdl/include/SDL_error.h +76 -0
  276. data/ext/alphatau/native/sdl/include/SDL_events.h +788 -0
  277. data/ext/alphatau/native/sdl/include/SDL_filesystem.h +136 -0
  278. data/ext/alphatau/native/sdl/include/SDL_gamecontroller.h +383 -0
  279. data/ext/alphatau/native/sdl/include/SDL_gesture.h +87 -0
  280. data/ext/alphatau/native/sdl/include/SDL_haptic.h +1227 -0
  281. data/ext/alphatau/native/sdl/include/SDL_hints.h +1106 -0
  282. data/ext/alphatau/native/sdl/include/SDL_joystick.h +395 -0
  283. data/ext/alphatau/native/sdl/include/SDL_keyboard.h +217 -0
  284. data/ext/alphatau/native/sdl/include/SDL_keycode.h +349 -0
  285. data/ext/alphatau/native/sdl/include/SDL_loadso.h +81 -0
  286. data/ext/alphatau/native/sdl/include/SDL_log.h +211 -0
  287. data/ext/alphatau/native/sdl/include/SDL_main.h +168 -0
  288. data/ext/alphatau/native/sdl/include/SDL_messagebox.h +144 -0
  289. data/ext/alphatau/native/sdl/include/SDL_mouse.h +302 -0
  290. data/ext/alphatau/native/sdl/include/SDL_mutex.h +251 -0
  291. data/ext/alphatau/native/sdl/include/SDL_name.h +33 -0
  292. data/ext/alphatau/native/sdl/include/SDL_opengl.h +2183 -0
  293. data/ext/alphatau/native/sdl/include/SDL_opengl_glext.h +11177 -0
  294. data/ext/alphatau/native/sdl/include/SDL_opengles.h +39 -0
  295. data/ext/alphatau/native/sdl/include/SDL_opengles2.h +52 -0
  296. data/ext/alphatau/native/sdl/include/SDL_opengles2_gl2.h +621 -0
  297. data/ext/alphatau/native/sdl/include/SDL_opengles2_gl2ext.h +2050 -0
  298. data/ext/alphatau/native/sdl/include/SDL_opengles2_gl2platform.h +30 -0
  299. data/ext/alphatau/native/sdl/include/SDL_opengles2_khrplatform.h +282 -0
  300. data/ext/alphatau/native/sdl/include/SDL_pixels.h +470 -0
  301. data/ext/alphatau/native/sdl/include/SDL_platform.h +198 -0
  302. data/ext/alphatau/native/sdl/include/SDL_power.h +75 -0
  303. data/ext/alphatau/native/sdl/include/SDL_quit.h +58 -0
  304. data/ext/alphatau/native/sdl/include/SDL_rect.h +148 -0
  305. data/ext/alphatau/native/sdl/include/SDL_render.h +931 -0
  306. data/ext/alphatau/native/sdl/include/SDL_revision.h +2 -0
  307. data/ext/alphatau/native/sdl/include/SDL_rwops.h +254 -0
  308. data/ext/alphatau/native/sdl/include/SDL_scancode.h +413 -0
  309. data/ext/alphatau/native/sdl/include/SDL_sensor.h +251 -0
  310. data/ext/alphatau/native/sdl/include/SDL_shape.h +144 -0
  311. data/ext/alphatau/native/sdl/include/SDL_stdinc.h +607 -0
  312. data/ext/alphatau/native/sdl/include/SDL_surface.h +546 -0
  313. data/ext/alphatau/native/sdl/include/SDL_system.h +279 -0
  314. data/ext/alphatau/native/sdl/include/SDL_syswm.h +324 -0
  315. data/ext/alphatau/native/sdl/include/SDL_test.h +69 -0
  316. data/ext/alphatau/native/sdl/include/SDL_test_assert.h +105 -0
  317. data/ext/alphatau/native/sdl/include/SDL_test_common.h +188 -0
  318. data/ext/alphatau/native/sdl/include/SDL_test_compare.h +69 -0
  319. data/ext/alphatau/native/sdl/include/SDL_test_crc32.h +124 -0
  320. data/ext/alphatau/native/sdl/include/SDL_test_font.h +81 -0
  321. data/ext/alphatau/native/sdl/include/SDL_test_fuzzer.h +384 -0
  322. data/ext/alphatau/native/sdl/include/SDL_test_harness.h +134 -0
  323. data/ext/alphatau/native/sdl/include/SDL_test_images.h +78 -0
  324. data/ext/alphatau/native/sdl/include/SDL_test_log.h +67 -0
  325. data/ext/alphatau/native/sdl/include/SDL_test_md5.h +129 -0
  326. data/ext/alphatau/native/sdl/include/SDL_test_memory.h +63 -0
  327. data/ext/alphatau/native/sdl/include/SDL_test_random.h +115 -0
  328. data/ext/alphatau/native/sdl/include/SDL_thread.h +309 -0
  329. data/ext/alphatau/native/sdl/include/SDL_timer.h +115 -0
  330. data/ext/alphatau/native/sdl/include/SDL_touch.h +86 -0
  331. data/ext/alphatau/native/sdl/include/SDL_types.h +29 -0
  332. data/ext/alphatau/native/sdl/include/SDL_version.h +162 -0
  333. data/ext/alphatau/native/sdl/include/SDL_video.h +1276 -0
  334. data/ext/alphatau/native/sdl/include/SDL_vulkan.h +278 -0
  335. data/ext/alphatau/native/sdl/include/begin_code.h +167 -0
  336. data/ext/alphatau/native/sdl/include/close_code.h +37 -0
  337. data/ext/alphatau/native/sdl/sdl2-config.cmake.in +11 -0
  338. data/ext/alphatau/native/sdl/sdl2-config.in +60 -0
  339. data/ext/alphatau/native/sdl/sdl2.m4 +234 -0
  340. data/ext/alphatau/native/sdl/sdl2.pc.in +15 -0
  341. data/ext/alphatau/native/sdl/src/SDL.c +514 -0
  342. data/ext/alphatau/native/sdl/src/SDL_assert.c +451 -0
  343. data/ext/alphatau/native/sdl/src/SDL_assert_c.h +24 -0
  344. data/ext/alphatau/native/sdl/src/SDL_dataqueue.c +339 -0
  345. data/ext/alphatau/native/sdl/src/SDL_dataqueue.h +55 -0
  346. data/ext/alphatau/native/sdl/src/SDL_error.c +319 -0
  347. data/ext/alphatau/native/sdl/src/SDL_error_c.h +65 -0
  348. data/ext/alphatau/native/sdl/src/SDL_hints.c +236 -0
  349. data/ext/alphatau/native/sdl/src/SDL_internal.h +52 -0
  350. data/ext/alphatau/native/sdl/src/SDL_log.c +450 -0
  351. data/ext/alphatau/native/sdl/src/atomic/SDL_atomic.c +303 -0
  352. data/ext/alphatau/native/sdl/src/atomic/SDL_spinlock.c +176 -0
  353. data/ext/alphatau/native/sdl/src/audio/SDL_audio.c +1647 -0
  354. data/ext/alphatau/native/sdl/src/audio/SDL_audio_c.h +79 -0
  355. data/ext/alphatau/native/sdl/src/audio/SDL_audiocvt.c +1673 -0
  356. data/ext/alphatau/native/sdl/src/audio/SDL_audiodev.c +124 -0
  357. data/ext/alphatau/native/sdl/src/audio/SDL_audiodev_c.h +38 -0
  358. data/ext/alphatau/native/sdl/src/audio/SDL_audiotypecvt.c +1430 -0
  359. data/ext/alphatau/native/sdl/src/audio/SDL_mixer.c +369 -0
  360. data/ext/alphatau/native/sdl/src/audio/SDL_sysaudio.h +211 -0
  361. data/ext/alphatau/native/sdl/src/audio/SDL_wave.c +694 -0
  362. data/ext/alphatau/native/sdl/src/audio/SDL_wave.h +77 -0
  363. data/ext/alphatau/native/sdl/src/audio/alsa/SDL_alsa_audio.c +990 -0
  364. data/ext/alphatau/native/sdl/src/audio/alsa/SDL_alsa_audio.h +48 -0
  365. data/ext/alphatau/native/sdl/src/audio/android/SDL_androidaudio.c +226 -0
  366. data/ext/alphatau/native/sdl/src/audio/android/SDL_androidaudio.h +42 -0
  367. data/ext/alphatau/native/sdl/src/audio/arts/SDL_artsaudio.c +365 -0
  368. data/ext/alphatau/native/sdl/src/audio/arts/SDL_artsaudio.h +53 -0
  369. data/ext/alphatau/native/sdl/src/audio/coreaudio/SDL_coreaudio.h +66 -0
  370. data/ext/alphatau/native/sdl/src/audio/coreaudio/SDL_coreaudio.m +861 -0
  371. data/ext/alphatau/native/sdl/src/audio/directsound/SDL_directsound.c +604 -0
  372. data/ext/alphatau/native/sdl/src/audio/directsound/SDL_directsound.h +47 -0
  373. data/ext/alphatau/native/sdl/src/audio/disk/SDL_diskaudio.c +207 -0
  374. data/ext/alphatau/native/sdl/src/audio/disk/SDL_diskaudio.h +41 -0
  375. data/ext/alphatau/native/sdl/src/audio/dsp/SDL_dspaudio.c +320 -0
  376. data/ext/alphatau/native/sdl/src/audio/dsp/SDL_dspaudio.h +43 -0
  377. data/ext/alphatau/native/sdl/src/audio/dummy/SDL_dummyaudio.c +65 -0
  378. data/ext/alphatau/native/sdl/src/audio/dummy/SDL_dummyaudio.h +41 -0
  379. data/ext/alphatau/native/sdl/src/audio/emscripten/SDL_emscriptenaudio.c +379 -0
  380. data/ext/alphatau/native/sdl/src/audio/emscripten/SDL_emscriptenaudio.h +38 -0
  381. data/ext/alphatau/native/sdl/src/audio/esd/SDL_esdaudio.c +335 -0
  382. data/ext/alphatau/native/sdl/src/audio/esd/SDL_esdaudio.h +51 -0
  383. data/ext/alphatau/native/sdl/src/audio/fusionsound/SDL_fsaudio.c +328 -0
  384. data/ext/alphatau/native/sdl/src/audio/fusionsound/SDL_fsaudio.h +50 -0
  385. data/ext/alphatau/native/sdl/src/audio/haiku/SDL_haikuaudio.cc +248 -0
  386. data/ext/alphatau/native/sdl/src/audio/haiku/SDL_haikuaudio.h +38 -0
  387. data/ext/alphatau/native/sdl/src/audio/jack/SDL_jackaudio.c +446 -0
  388. data/ext/alphatau/native/sdl/src/audio/jack/SDL_jackaudio.h +41 -0
  389. data/ext/alphatau/native/sdl/src/audio/nacl/SDL_naclaudio.c +165 -0
  390. data/ext/alphatau/native/sdl/src/audio/nacl/SDL_naclaudio.h +43 -0
  391. data/ext/alphatau/native/sdl/src/audio/nas/SDL_nasaudio.c +463 -0
  392. data/ext/alphatau/native/sdl/src/audio/nas/SDL_nasaudio.h +56 -0
  393. data/ext/alphatau/native/sdl/src/audio/netbsd/SDL_netbsdaudio.c +412 -0
  394. data/ext/alphatau/native/sdl/src/audio/netbsd/SDL_netbsdaudio.h +48 -0
  395. data/ext/alphatau/native/sdl/src/audio/paudio/SDL_paudio.c +516 -0
  396. data/ext/alphatau/native/sdl/src/audio/paudio/SDL_paudio.h +48 -0
  397. data/ext/alphatau/native/sdl/src/audio/psp/SDL_pspaudio.c +181 -0
  398. data/ext/alphatau/native/sdl/src/audio/psp/SDL_pspaudio.h +45 -0
  399. data/ext/alphatau/native/sdl/src/audio/pulseaudio/SDL_pulseaudio.c +782 -0
  400. data/ext/alphatau/native/sdl/src/audio/pulseaudio/SDL_pulseaudio.h +52 -0
  401. data/ext/alphatau/native/sdl/src/audio/qsa/SDL_qsa_audio.c +666 -0
  402. data/ext/alphatau/native/sdl/src/audio/qsa/SDL_qsa_audio.h +57 -0
  403. data/ext/alphatau/native/sdl/src/audio/sndio/SDL_sndioaudio.c +382 -0
  404. data/ext/alphatau/native/sdl/src/audio/sndio/SDL_sndioaudio.h +49 -0
  405. data/ext/alphatau/native/sdl/src/audio/sun/SDL_sunaudio.c +419 -0
  406. data/ext/alphatau/native/sdl/src/audio/sun/SDL_sunaudio.h +47 -0
  407. data/ext/alphatau/native/sdl/src/audio/wasapi/SDL_wasapi.c +779 -0
  408. data/ext/alphatau/native/sdl/src/audio/wasapi/SDL_wasapi.h +85 -0
  409. data/ext/alphatau/native/sdl/src/audio/wasapi/SDL_wasapi_win32.c +417 -0
  410. data/ext/alphatau/native/sdl/src/audio/wasapi/SDL_wasapi_winrt.cpp +276 -0
  411. data/ext/alphatau/native/sdl/src/audio/winmm/SDL_winmm.c +457 -0
  412. data/ext/alphatau/native/sdl/src/audio/winmm/SDL_winmm.h +45 -0
  413. data/ext/alphatau/native/sdl/src/core/android/SDL_android.c +2285 -0
  414. data/ext/alphatau/native/sdl/src/core/android/SDL_android.h +122 -0
  415. data/ext/alphatau/native/sdl/src/core/android/keyinfotable.h +175 -0
  416. data/ext/alphatau/native/sdl/src/core/linux/SDL_dbus.c +347 -0
  417. data/ext/alphatau/native/sdl/src/core/linux/SDL_dbus.h +97 -0
  418. data/ext/alphatau/native/sdl/src/core/linux/SDL_evdev.c +698 -0
  419. data/ext/alphatau/native/sdl/src/core/linux/SDL_evdev.h +39 -0
  420. data/ext/alphatau/native/sdl/src/core/linux/SDL_evdev_kbd.c +840 -0
  421. data/ext/alphatau/native/sdl/src/core/linux/SDL_evdev_kbd.h +29 -0
  422. data/ext/alphatau/native/sdl/src/core/linux/SDL_evdev_kbd_default_accents.h +284 -0
  423. data/ext/alphatau/native/sdl/src/core/linux/SDL_evdev_kbd_default_keymap.h +4763 -0
  424. data/ext/alphatau/native/sdl/src/core/linux/SDL_fcitx.c +373 -0
  425. data/ext/alphatau/native/sdl/src/core/linux/SDL_fcitx.h +40 -0
  426. data/ext/alphatau/native/sdl/src/core/linux/SDL_ibus.c +584 -0
  427. data/ext/alphatau/native/sdl/src/core/linux/SDL_ibus.h +58 -0
  428. data/ext/alphatau/native/sdl/src/core/linux/SDL_ime.c +152 -0
  429. data/ext/alphatau/native/sdl/src/core/linux/SDL_ime.h +40 -0
  430. data/ext/alphatau/native/sdl/src/core/linux/SDL_udev.c +553 -0
  431. data/ext/alphatau/native/sdl/src/core/linux/SDL_udev.h +121 -0
  432. data/ext/alphatau/native/sdl/src/core/unix/SDL_poll.c +87 -0
  433. data/ext/alphatau/native/sdl/src/core/unix/SDL_poll.h +34 -0
  434. data/ext/alphatau/native/sdl/src/core/windows/SDL_directx.h +111 -0
  435. data/ext/alphatau/native/sdl/src/core/windows/SDL_windows.c +233 -0
  436. data/ext/alphatau/native/sdl/src/core/windows/SDL_windows.h +75 -0
  437. data/ext/alphatau/native/sdl/src/core/windows/SDL_xinput.c +139 -0
  438. data/ext/alphatau/native/sdl/src/core/windows/SDL_xinput.h +177 -0
  439. data/ext/alphatau/native/sdl/src/core/winrt/SDL_winrtapp_common.cpp +66 -0
  440. data/ext/alphatau/native/sdl/src/core/winrt/SDL_winrtapp_common.h +31 -0
  441. data/ext/alphatau/native/sdl/src/core/winrt/SDL_winrtapp_direct3d.cpp +855 -0
  442. data/ext/alphatau/native/sdl/src/core/winrt/SDL_winrtapp_direct3d.h +92 -0
  443. data/ext/alphatau/native/sdl/src/core/winrt/SDL_winrtapp_xaml.cpp +160 -0
  444. data/ext/alphatau/native/sdl/src/core/winrt/SDL_winrtapp_xaml.h +33 -0
  445. data/ext/alphatau/native/sdl/src/cpuinfo/SDL_cpuinfo.c +855 -0
  446. data/ext/alphatau/native/sdl/src/cpuinfo/SDL_simd.h +88 -0
  447. data/ext/alphatau/native/sdl/src/dynapi/SDL_dynapi.c +331 -0
  448. data/ext/alphatau/native/sdl/src/dynapi/SDL_dynapi.h +67 -0
  449. data/ext/alphatau/native/sdl/src/dynapi/SDL_dynapi_overrides.h +698 -0
  450. data/ext/alphatau/native/sdl/src/dynapi/SDL_dynapi_procs.h +740 -0
  451. data/ext/alphatau/native/sdl/src/dynapi/gendynapi.pl +141 -0
  452. data/ext/alphatau/native/sdl/src/events/SDL_clipboardevents.c +46 -0
  453. data/ext/alphatau/native/sdl/src/events/SDL_clipboardevents_c.h +30 -0
  454. data/ext/alphatau/native/sdl/src/events/SDL_displayevents.c +60 -0
  455. data/ext/alphatau/native/sdl/src/events/SDL_displayevents_c.h +30 -0
  456. data/ext/alphatau/native/sdl/src/events/SDL_dropevents.c +98 -0
  457. data/ext/alphatau/native/sdl/src/events/SDL_dropevents_c.h +32 -0
  458. data/ext/alphatau/native/sdl/src/events/SDL_events.c +976 -0
  459. data/ext/alphatau/native/sdl/src/events/SDL_events_c.h +52 -0
  460. data/ext/alphatau/native/sdl/src/events/SDL_gesture.c +700 -0
  461. data/ext/alphatau/native/sdl/src/events/SDL_gesture_c.h +35 -0
  462. data/ext/alphatau/native/sdl/src/events/SDL_keyboard.c +1033 -0
  463. data/ext/alphatau/native/sdl/src/events/SDL_keyboard_c.h +70 -0
  464. data/ext/alphatau/native/sdl/src/events/SDL_mouse.c +1031 -0
  465. data/ext/alphatau/native/sdl/src/events/SDL_mouse_c.h +141 -0
  466. data/ext/alphatau/native/sdl/src/events/SDL_quit.c +152 -0
  467. data/ext/alphatau/native/sdl/src/events/SDL_sysevents.h +36 -0
  468. data/ext/alphatau/native/sdl/src/events/SDL_touch.c +375 -0
  469. data/ext/alphatau/native/sdl/src/events/SDL_touch_c.h +61 -0
  470. data/ext/alphatau/native/sdl/src/events/SDL_windowevents.c +227 -0
  471. data/ext/alphatau/native/sdl/src/events/SDL_windowevents_c.h +31 -0
  472. data/ext/alphatau/native/sdl/src/events/blank_cursor.h +33 -0
  473. data/ext/alphatau/native/sdl/src/events/default_cursor.h +114 -0
  474. data/ext/alphatau/native/sdl/src/events/scancodes_darwin.h +159 -0
  475. data/ext/alphatau/native/sdl/src/events/scancodes_linux.h +263 -0
  476. data/ext/alphatau/native/sdl/src/events/scancodes_windows.h +55 -0
  477. data/ext/alphatau/native/sdl/src/events/scancodes_xfree86.h +506 -0
  478. data/ext/alphatau/native/sdl/src/file/SDL_rwops.c +867 -0
  479. data/ext/alphatau/native/sdl/src/file/cocoa/SDL_rwopsbundlesupport.h +30 -0
  480. data/ext/alphatau/native/sdl/src/file/cocoa/SDL_rwopsbundlesupport.m +62 -0
  481. data/ext/alphatau/native/sdl/src/filesystem/android/SDL_sysfilesystem.c +62 -0
  482. data/ext/alphatau/native/sdl/src/filesystem/cocoa/SDL_sysfilesystem.m +117 -0
  483. data/ext/alphatau/native/sdl/src/filesystem/dummy/SDL_sysfilesystem.c +47 -0
  484. data/ext/alphatau/native/sdl/src/filesystem/emscripten/SDL_sysfilesystem.c +81 -0
  485. data/ext/alphatau/native/sdl/src/filesystem/haiku/SDL_sysfilesystem.cc +110 -0
  486. data/ext/alphatau/native/sdl/src/filesystem/nacl/SDL_sysfilesystem.c +43 -0
  487. data/ext/alphatau/native/sdl/src/filesystem/unix/SDL_sysfilesystem.c +250 -0
  488. data/ext/alphatau/native/sdl/src/filesystem/windows/SDL_sysfilesystem.c +192 -0
  489. data/ext/alphatau/native/sdl/src/filesystem/winrt/SDL_sysfilesystem.cpp +233 -0
  490. data/ext/alphatau/native/sdl/src/haptic/SDL_haptic.c +850 -0
  491. data/ext/alphatau/native/sdl/src/haptic/SDL_haptic_c.h +25 -0
  492. data/ext/alphatau/native/sdl/src/haptic/SDL_syshaptic.h +208 -0
  493. data/ext/alphatau/native/sdl/src/haptic/android/SDL_syshaptic.c +358 -0
  494. data/ext/alphatau/native/sdl/src/haptic/android/SDL_syshaptic_c.h +12 -0
  495. data/ext/alphatau/native/sdl/src/haptic/darwin/SDL_syshaptic.c +1417 -0
  496. data/ext/alphatau/native/sdl/src/haptic/darwin/SDL_syshaptic_c.h +26 -0
  497. data/ext/alphatau/native/sdl/src/haptic/dummy/SDL_syshaptic.c +186 -0
  498. data/ext/alphatau/native/sdl/src/haptic/linux/SDL_syshaptic.c +1165 -0
  499. data/ext/alphatau/native/sdl/src/haptic/windows/SDL_dinputhaptic.c +1305 -0
  500. data/ext/alphatau/native/sdl/src/haptic/windows/SDL_dinputhaptic_c.h +47 -0
  501. data/ext/alphatau/native/sdl/src/haptic/windows/SDL_windowshaptic.c +456 -0
  502. data/ext/alphatau/native/sdl/src/haptic/windows/SDL_windowshaptic_c.h +88 -0
  503. data/ext/alphatau/native/sdl/src/haptic/windows/SDL_xinputhaptic.c +487 -0
  504. data/ext/alphatau/native/sdl/src/haptic/windows/SDL_xinputhaptic_c.h +47 -0
  505. data/ext/alphatau/native/sdl/src/hidapi/AUTHORS.txt +16 -0
  506. data/ext/alphatau/native/sdl/src/hidapi/HACKING.txt +15 -0
  507. data/ext/alphatau/native/sdl/src/hidapi/LICENSE-bsd.txt +26 -0
  508. data/ext/alphatau/native/sdl/src/hidapi/LICENSE-gpl3.txt +674 -0
  509. data/ext/alphatau/native/sdl/src/hidapi/LICENSE-orig.txt +9 -0
  510. data/ext/alphatau/native/sdl/src/hidapi/LICENSE.txt +13 -0
  511. data/ext/alphatau/native/sdl/src/hidapi/Makefile.am +85 -0
  512. data/ext/alphatau/native/sdl/src/hidapi/README.txt +339 -0
  513. data/ext/alphatau/native/sdl/src/hidapi/android/hid.cpp +1079 -0
  514. data/ext/alphatau/native/sdl/src/hidapi/android/jni/Android.mk +16 -0
  515. data/ext/alphatau/native/sdl/src/hidapi/android/jni/Application.mk +2 -0
  516. data/ext/alphatau/native/sdl/src/hidapi/android/project.properties +14 -0
  517. data/ext/alphatau/native/sdl/src/hidapi/bootstrap +2 -0
  518. data/ext/alphatau/native/sdl/src/hidapi/configure.ac +236 -0
  519. data/ext/alphatau/native/sdl/src/hidapi/doxygen/Doxyfile +1630 -0
  520. data/ext/alphatau/native/sdl/src/hidapi/hidapi/hidapi.h +398 -0
  521. data/ext/alphatau/native/sdl/src/hidapi/hidtest/Makefile.am +20 -0
  522. data/ext/alphatau/native/sdl/src/hidapi/hidtest/hidtest.cpp +194 -0
  523. data/ext/alphatau/native/sdl/src/hidapi/ios/Makefile-manual +32 -0
  524. data/ext/alphatau/native/sdl/src/hidapi/ios/Makefile.am +9 -0
  525. data/ext/alphatau/native/sdl/src/hidapi/ios/hid.m +909 -0
  526. data/ext/alphatau/native/sdl/src/hidapi/libusb/Makefile-manual +18 -0
  527. data/ext/alphatau/native/sdl/src/hidapi/libusb/Makefile.am +27 -0
  528. data/ext/alphatau/native/sdl/src/hidapi/libusb/Makefile.freebsd +46 -0
  529. data/ext/alphatau/native/sdl/src/hidapi/libusb/Makefile.linux +49 -0
  530. data/ext/alphatau/native/sdl/src/hidapi/libusb/hid.c +1615 -0
  531. data/ext/alphatau/native/sdl/src/hidapi/libusb/hidusb.cpp +3 -0
  532. data/ext/alphatau/native/sdl/src/hidapi/linux/Makefile-manual +49 -0
  533. data/ext/alphatau/native/sdl/src/hidapi/linux/Makefile.am +10 -0
  534. data/ext/alphatau/native/sdl/src/hidapi/linux/README.txt +59 -0
  535. data/ext/alphatau/native/sdl/src/hidapi/linux/hid.c +893 -0
  536. data/ext/alphatau/native/sdl/src/hidapi/linux/hid.cpp +333 -0
  537. data/ext/alphatau/native/sdl/src/hidapi/linux/hidraw.cpp +3 -0
  538. data/ext/alphatau/native/sdl/src/hidapi/m4/ax_pthread.m4 +309 -0
  539. data/ext/alphatau/native/sdl/src/hidapi/m4/pkg.m4 +157 -0
  540. data/ext/alphatau/native/sdl/src/hidapi/mac/Makefile-manual +32 -0
  541. data/ext/alphatau/native/sdl/src/hidapi/mac/Makefile.am +9 -0
  542. data/ext/alphatau/native/sdl/src/hidapi/mac/hid.c +1186 -0
  543. data/ext/alphatau/native/sdl/src/hidapi/pc/hidapi-hidraw.pc.in +10 -0
  544. data/ext/alphatau/native/sdl/src/hidapi/pc/hidapi-libusb.pc.in +10 -0
  545. data/ext/alphatau/native/sdl/src/hidapi/pc/hidapi.pc.in +10 -0
  546. data/ext/alphatau/native/sdl/src/hidapi/testgui/Makefile-manual +26 -0
  547. data/ext/alphatau/native/sdl/src/hidapi/testgui/Makefile.am +43 -0
  548. data/ext/alphatau/native/sdl/src/hidapi/testgui/Makefile.freebsd +33 -0
  549. data/ext/alphatau/native/sdl/src/hidapi/testgui/Makefile.linux +32 -0
  550. data/ext/alphatau/native/sdl/src/hidapi/testgui/Makefile.mac +46 -0
  551. data/ext/alphatau/native/sdl/src/hidapi/testgui/Makefile.mingw +32 -0
  552. data/ext/alphatau/native/sdl/src/hidapi/testgui/TestGUI.app.in/Contents/Info.plist +28 -0
  553. data/ext/alphatau/native/sdl/src/hidapi/testgui/TestGUI.app.in/Contents/PkgInfo +1 -0
  554. data/ext/alphatau/native/sdl/src/hidapi/testgui/TestGUI.app.in/Contents/Resources/English.lproj/InfoPlist.strings +0 -0
  555. data/ext/alphatau/native/sdl/src/hidapi/testgui/TestGUI.app.in/Contents/Resources/Signal11.icns +0 -0
  556. data/ext/alphatau/native/sdl/src/hidapi/testgui/copy_to_bundle.sh +97 -0
  557. data/ext/alphatau/native/sdl/src/hidapi/testgui/mac_support.cpp +134 -0
  558. data/ext/alphatau/native/sdl/src/hidapi/testgui/mac_support.h +17 -0
  559. data/ext/alphatau/native/sdl/src/hidapi/testgui/mac_support_cocoa.m +94 -0
  560. data/ext/alphatau/native/sdl/src/hidapi/testgui/start.sh +2 -0
  561. data/ext/alphatau/native/sdl/src/hidapi/testgui/test.cpp +532 -0
  562. data/ext/alphatau/native/sdl/src/hidapi/testgui/testgui.sln +20 -0
  563. data/ext/alphatau/native/sdl/src/hidapi/testgui/testgui.vcproj +217 -0
  564. data/ext/alphatau/native/sdl/src/hidapi/udev/99-hid.rules +33 -0
  565. data/ext/alphatau/native/sdl/src/hidapi/windows/Makefile-manual +14 -0
  566. data/ext/alphatau/native/sdl/src/hidapi/windows/Makefile.am +16 -0
  567. data/ext/alphatau/native/sdl/src/hidapi/windows/Makefile.mingw +35 -0
  568. data/ext/alphatau/native/sdl/src/hidapi/windows/ddk_build/hidapi.def +17 -0
  569. data/ext/alphatau/native/sdl/src/hidapi/windows/ddk_build/makefile +49 -0
  570. data/ext/alphatau/native/sdl/src/hidapi/windows/ddk_build/sources +23 -0
  571. data/ext/alphatau/native/sdl/src/hidapi/windows/hid.c +983 -0
  572. data/ext/alphatau/native/sdl/src/hidapi/windows/hidapi.sln +29 -0
  573. data/ext/alphatau/native/sdl/src/hidapi/windows/hidapi.vcproj +201 -0
  574. data/ext/alphatau/native/sdl/src/hidapi/windows/hidtest.vcproj +196 -0
  575. data/ext/alphatau/native/sdl/src/joystick/SDL_gamecontroller.c +2066 -0
  576. data/ext/alphatau/native/sdl/src/joystick/SDL_gamecontrollerdb.h +583 -0
  577. data/ext/alphatau/native/sdl/src/joystick/SDL_joystick.c +1547 -0
  578. data/ext/alphatau/native/sdl/src/joystick/SDL_joystick_c.h +94 -0
  579. data/ext/alphatau/native/sdl/src/joystick/SDL_sysjoystick.h +153 -0
  580. data/ext/alphatau/native/sdl/src/joystick/android/SDL_sysjoystick.c +703 -0
  581. data/ext/alphatau/native/sdl/src/joystick/android/SDL_sysjoystick_c.h +59 -0
  582. data/ext/alphatau/native/sdl/src/joystick/bsd/SDL_sysjoystick.c +701 -0
  583. data/ext/alphatau/native/sdl/src/joystick/controller_type.h +457 -0
  584. data/ext/alphatau/native/sdl/src/joystick/darwin/SDL_sysjoystick.c +1012 -0
  585. data/ext/alphatau/native/sdl/src/joystick/darwin/SDL_sysjoystick_c.h +79 -0
  586. data/ext/alphatau/native/sdl/src/joystick/dummy/SDL_sysjoystick.c +113 -0
  587. data/ext/alphatau/native/sdl/src/joystick/emscripten/SDL_sysjoystick.c +406 -0
  588. data/ext/alphatau/native/sdl/src/joystick/emscripten/SDL_sysjoystick_c.h +52 -0
  589. data/ext/alphatau/native/sdl/src/joystick/haiku/SDL_haikujoystick.cc +272 -0
  590. data/ext/alphatau/native/sdl/src/joystick/hidapi/SDL_hidapi_ps4.c +545 -0
  591. data/ext/alphatau/native/sdl/src/joystick/hidapi/SDL_hidapi_switch.c +905 -0
  592. data/ext/alphatau/native/sdl/src/joystick/hidapi/SDL_hidapi_xbox360.c +461 -0
  593. data/ext/alphatau/native/sdl/src/joystick/hidapi/SDL_hidapi_xboxone.c +318 -0
  594. data/ext/alphatau/native/sdl/src/joystick/hidapi/SDL_hidapijoystick.c +1021 -0
  595. data/ext/alphatau/native/sdl/src/joystick/hidapi/SDL_hidapijoystick_c.h +72 -0
  596. data/ext/alphatau/native/sdl/src/joystick/iphoneos/SDL_sysjoystick.m +727 -0
  597. data/ext/alphatau/native/sdl/src/joystick/iphoneos/SDL_sysjoystick_c.h +57 -0
  598. data/ext/alphatau/native/sdl/src/joystick/linux/SDL_sysjoystick.c +1116 -0
  599. data/ext/alphatau/native/sdl/src/joystick/linux/SDL_sysjoystick_c.h +64 -0
  600. data/ext/alphatau/native/sdl/src/joystick/psp/SDL_sysjoystick.c +264 -0
  601. data/ext/alphatau/native/sdl/src/joystick/sort_controllers.py +78 -0
  602. data/ext/alphatau/native/sdl/src/joystick/steam/SDL_steamcontroller.c +52 -0
  603. data/ext/alphatau/native/sdl/src/joystick/steam/SDL_steamcontroller.h +33 -0
  604. data/ext/alphatau/native/sdl/src/joystick/windows/SDL_dinputjoystick.c +1155 -0
  605. data/ext/alphatau/native/sdl/src/joystick/windows/SDL_dinputjoystick_c.h +31 -0
  606. data/ext/alphatau/native/sdl/src/joystick/windows/SDL_mmjoystick.c +452 -0
  607. data/ext/alphatau/native/sdl/src/joystick/windows/SDL_windowsjoystick.c +558 -0
  608. data/ext/alphatau/native/sdl/src/joystick/windows/SDL_windowsjoystick_c.h +95 -0
  609. data/ext/alphatau/native/sdl/src/joystick/windows/SDL_xinputjoystick.c +558 -0
  610. data/ext/alphatau/native/sdl/src/joystick/windows/SDL_xinputjoystick_c.h +34 -0
  611. data/ext/alphatau/native/sdl/src/libm/e_atan2.c +134 -0
  612. data/ext/alphatau/native/sdl/src/libm/e_exp.c +187 -0
  613. data/ext/alphatau/native/sdl/src/libm/e_fmod.c +144 -0
  614. data/ext/alphatau/native/sdl/src/libm/e_log.c +152 -0
  615. data/ext/alphatau/native/sdl/src/libm/e_log10.c +106 -0
  616. data/ext/alphatau/native/sdl/src/libm/e_pow.c +343 -0
  617. data/ext/alphatau/native/sdl/src/libm/e_rem_pio2.c +161 -0
  618. data/ext/alphatau/native/sdl/src/libm/e_sqrt.c +457 -0
  619. data/ext/alphatau/native/sdl/src/libm/k_cos.c +82 -0
  620. data/ext/alphatau/native/sdl/src/libm/k_rem_pio2.c +317 -0
  621. data/ext/alphatau/native/sdl/src/libm/k_sin.c +65 -0
  622. data/ext/alphatau/native/sdl/src/libm/k_tan.c +118 -0
  623. data/ext/alphatau/native/sdl/src/libm/math_libm.h +41 -0
  624. data/ext/alphatau/native/sdl/src/libm/math_private.h +227 -0
  625. data/ext/alphatau/native/sdl/src/libm/s_atan.c +114 -0
  626. data/ext/alphatau/native/sdl/src/libm/s_copysign.c +29 -0
  627. data/ext/alphatau/native/sdl/src/libm/s_cos.c +73 -0
  628. data/ext/alphatau/native/sdl/src/libm/s_fabs.c +29 -0
  629. data/ext/alphatau/native/sdl/src/libm/s_floor.c +71 -0
  630. data/ext/alphatau/native/sdl/src/libm/s_scalbn.c +69 -0
  631. data/ext/alphatau/native/sdl/src/libm/s_sin.c +73 -0
  632. data/ext/alphatau/native/sdl/src/libm/s_tan.c +67 -0
  633. data/ext/alphatau/native/sdl/src/loadso/dlopen/SDL_sysloadso.c +88 -0
  634. data/ext/alphatau/native/sdl/src/loadso/dummy/SDL_sysloadso.c +54 -0
  635. data/ext/alphatau/native/sdl/src/loadso/windows/SDL_sysloadso.c +80 -0
  636. data/ext/alphatau/native/sdl/src/main/android/SDL_android_main.c +7 -0
  637. data/ext/alphatau/native/sdl/src/main/dummy/SDL_dummy_main.c +28 -0
  638. data/ext/alphatau/native/sdl/src/main/haiku/SDL_BApp.h +399 -0
  639. data/ext/alphatau/native/sdl/src/main/haiku/SDL_BeApp.cc +157 -0
  640. data/ext/alphatau/native/sdl/src/main/haiku/SDL_BeApp.h +38 -0
  641. data/ext/alphatau/native/sdl/src/main/nacl/SDL_nacl_main.c +93 -0
  642. data/ext/alphatau/native/sdl/src/main/psp/SDL_psp_main.c +70 -0
  643. data/ext/alphatau/native/sdl/src/main/windows/SDL_windows_main.c +207 -0
  644. data/ext/alphatau/native/sdl/src/main/windows/version.rc +38 -0
  645. data/ext/alphatau/native/sdl/src/main/winrt/SDL2-WinRTResource_BlankCursor.cur +0 -0
  646. data/ext/alphatau/native/sdl/src/main/winrt/SDL2-WinRTResources.rc +3 -0
  647. data/ext/alphatau/native/sdl/src/main/winrt/SDL_winrt_main_NonXAML.cpp +54 -0
  648. data/ext/alphatau/native/sdl/src/power/SDL_power.c +116 -0
  649. data/ext/alphatau/native/sdl/src/power/SDL_syspower.h +47 -0
  650. data/ext/alphatau/native/sdl/src/power/android/SDL_syspower.c +64 -0
  651. data/ext/alphatau/native/sdl/src/power/emscripten/SDL_syspower.c +62 -0
  652. data/ext/alphatau/native/sdl/src/power/haiku/SDL_syspower.c +128 -0
  653. data/ext/alphatau/native/sdl/src/power/linux/SDL_syspower.c +642 -0
  654. data/ext/alphatau/native/sdl/src/power/macosx/SDL_syspower.c +192 -0
  655. data/ext/alphatau/native/sdl/src/power/psp/SDL_syspower.c +68 -0
  656. data/ext/alphatau/native/sdl/src/power/uikit/SDL_syspower.h +32 -0
  657. data/ext/alphatau/native/sdl/src/power/uikit/SDL_syspower.m +113 -0
  658. data/ext/alphatau/native/sdl/src/power/windows/SDL_syspower.c +76 -0
  659. data/ext/alphatau/native/sdl/src/power/winrt/SDL_syspower.cpp +44 -0
  660. data/ext/alphatau/native/sdl/src/render/SDL_d3dmath.c +136 -0
  661. data/ext/alphatau/native/sdl/src/render/SDL_d3dmath.h +72 -0
  662. data/ext/alphatau/native/sdl/src/render/SDL_render.c +2292 -0
  663. data/ext/alphatau/native/sdl/src/render/SDL_sysrender.h +214 -0
  664. data/ext/alphatau/native/sdl/src/render/SDL_yuv_sw.c +414 -0
  665. data/ext/alphatau/native/sdl/src/render/SDL_yuv_sw_c.h +67 -0
  666. data/ext/alphatau/native/sdl/src/render/direct3d/SDL_render_d3d.c +1813 -0
  667. data/ext/alphatau/native/sdl/src/render/direct3d/SDL_shaders_d3d.c +274 -0
  668. data/ext/alphatau/native/sdl/src/render/direct3d/SDL_shaders_d3d.h +34 -0
  669. data/ext/alphatau/native/sdl/src/render/direct3d11/SDL_render_d3d11.c +2559 -0
  670. data/ext/alphatau/native/sdl/src/render/direct3d11/SDL_render_winrt.cpp +116 -0
  671. data/ext/alphatau/native/sdl/src/render/direct3d11/SDL_render_winrt.h +40 -0
  672. data/ext/alphatau/native/sdl/src/render/direct3d11/SDL_shaders_d3d11.c +1957 -0
  673. data/ext/alphatau/native/sdl/src/render/direct3d11/SDL_shaders_d3d11.h +43 -0
  674. data/ext/alphatau/native/sdl/src/render/metal/SDL_render_metal.m +1428 -0
  675. data/ext/alphatau/native/sdl/src/render/metal/SDL_shaders_metal.metal +109 -0
  676. data/ext/alphatau/native/sdl/src/render/metal/SDL_shaders_metal_ios.h +1899 -0
  677. data/ext/alphatau/native/sdl/src/render/metal/SDL_shaders_metal_osx.h +1903 -0
  678. data/ext/alphatau/native/sdl/src/render/metal/build-metal-shaders.sh +18 -0
  679. data/ext/alphatau/native/sdl/src/render/opengl/SDL_glfuncs.h +478 -0
  680. data/ext/alphatau/native/sdl/src/render/opengl/SDL_render_gl.c +1678 -0
  681. data/ext/alphatau/native/sdl/src/render/opengl/SDL_shaders_gl.c +524 -0
  682. data/ext/alphatau/native/sdl/src/render/opengl/SDL_shaders_gl.h +47 -0
  683. data/ext/alphatau/native/sdl/src/render/opengles/SDL_glesfuncs.h +65 -0
  684. data/ext/alphatau/native/sdl/src/render/opengles/SDL_render_gles.c +1278 -0
  685. data/ext/alphatau/native/sdl/src/render/opengles2/SDL_gles2funcs.h +80 -0
  686. data/ext/alphatau/native/sdl/src/render/opengles2/SDL_render_gles2.c +2256 -0
  687. data/ext/alphatau/native/sdl/src/render/opengles2/SDL_shaders_gles2.c +569 -0
  688. data/ext/alphatau/native/sdl/src/render/opengles2/SDL_shaders_gles2.h +70 -0
  689. data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/Makefile +41 -0
  690. data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/convert_gl2_h_into_gles2_stubcall_overs_c.sno +181 -0
  691. data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/convert_gl2_h_into_gles2_stubcall_overs_h.sno +116 -0
  692. data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/convert_gl2_h_into_gles2funcs_h.sno +82 -0
  693. data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/convert_gles2funcs_into_gles2_define_overs_h.sno +42 -0
  694. data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/gl2.h +686 -0
  695. data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/readme.txt +70 -0
  696. data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/testgles2.c +725 -0
  697. data/ext/alphatau/native/sdl/src/render/opengles2/build_code_with_snobol/triangle.c +147 -0
  698. data/ext/alphatau/native/sdl/src/render/psp/SDL_render_psp.c +1016 -0
  699. data/ext/alphatau/native/sdl/src/render/software/SDL_blendfillrect.c +336 -0
  700. data/ext/alphatau/native/sdl/src/render/software/SDL_blendfillrect.h +27 -0
  701. data/ext/alphatau/native/sdl/src/render/software/SDL_blendline.c +777 -0
  702. data/ext/alphatau/native/sdl/src/render/software/SDL_blendline.h +27 -0
  703. data/ext/alphatau/native/sdl/src/render/software/SDL_blendpoint.c +341 -0
  704. data/ext/alphatau/native/sdl/src/render/software/SDL_blendpoint.h +27 -0
  705. data/ext/alphatau/native/sdl/src/render/software/SDL_draw.h +576 -0
  706. data/ext/alphatau/native/sdl/src/render/software/SDL_drawline.c +209 -0
  707. data/ext/alphatau/native/sdl/src/render/software/SDL_drawline.h +27 -0
  708. data/ext/alphatau/native/sdl/src/render/software/SDL_drawpoint.c +114 -0
  709. data/ext/alphatau/native/sdl/src/render/software/SDL_drawpoint.h +27 -0
  710. data/ext/alphatau/native/sdl/src/render/software/SDL_render_sw.c +882 -0
  711. data/ext/alphatau/native/sdl/src/render/software/SDL_render_sw_c.h +24 -0
  712. data/ext/alphatau/native/sdl/src/render/software/SDL_rotate.c +530 -0
  713. data/ext/alphatau/native/sdl/src/render/software/SDL_rotate.h +28 -0
  714. data/ext/alphatau/native/sdl/src/sensor/SDL_sensor.c +546 -0
  715. data/ext/alphatau/native/sdl/src/sensor/SDL_sensor_c.h +38 -0
  716. data/ext/alphatau/native/sdl/src/sensor/SDL_syssensor.h +99 -0
  717. data/ext/alphatau/native/sdl/src/sensor/android/SDL_androidsensor.c +211 -0
  718. data/ext/alphatau/native/sdl/src/sensor/android/SDL_androidsensor.h +31 -0
  719. data/ext/alphatau/native/sdl/src/sensor/coremotion/SDL_coremotionsensor.h +30 -0
  720. data/ext/alphatau/native/sdl/src/sensor/coremotion/SDL_coremotionsensor.m +234 -0
  721. data/ext/alphatau/native/sdl/src/sensor/dummy/SDL_dummysensor.c +110 -0
  722. data/ext/alphatau/native/sdl/src/sensor/dummy/SDL_dummysensor.h +23 -0
  723. data/ext/alphatau/native/sdl/src/stdlib/SDL_getenv.c +315 -0
  724. data/ext/alphatau/native/sdl/src/stdlib/SDL_iconv.c +934 -0
  725. data/ext/alphatau/native/sdl/src/stdlib/SDL_malloc.c +5376 -0
  726. data/ext/alphatau/native/sdl/src/stdlib/SDL_qsort.c +534 -0
  727. data/ext/alphatau/native/sdl/src/stdlib/SDL_stdlib.c +1155 -0
  728. data/ext/alphatau/native/sdl/src/stdlib/SDL_string.c +1737 -0
  729. data/ext/alphatau/native/sdl/src/test/SDL_test_assert.c +152 -0
  730. data/ext/alphatau/native/sdl/src/test/SDL_test_common.c +1826 -0
  731. data/ext/alphatau/native/sdl/src/test/SDL_test_compare.c +117 -0
  732. data/ext/alphatau/native/sdl/src/test/SDL_test_crc32.c +166 -0
  733. data/ext/alphatau/native/sdl/src/test/SDL_test_font.c +3250 -0
  734. data/ext/alphatau/native/sdl/src/test/SDL_test_fuzzer.c +534 -0
  735. data/ext/alphatau/native/sdl/src/test/SDL_test_harness.c +683 -0
  736. data/ext/alphatau/native/sdl/src/test/SDL_test_imageBlit.c +1559 -0
  737. data/ext/alphatau/native/sdl/src/test/SDL_test_imageBlitBlend.c +2845 -0
  738. data/ext/alphatau/native/sdl/src/test/SDL_test_imageFace.c +247 -0
  739. data/ext/alphatau/native/sdl/src/test/SDL_test_imagePrimitives.c +514 -0
  740. data/ext/alphatau/native/sdl/src/test/SDL_test_imagePrimitivesBlend.c +696 -0
  741. data/ext/alphatau/native/sdl/src/test/SDL_test_log.c +118 -0
  742. data/ext/alphatau/native/sdl/src/test/SDL_test_md5.c +338 -0
  743. data/ext/alphatau/native/sdl/src/test/SDL_test_memory.c +274 -0
  744. data/ext/alphatau/native/sdl/src/test/SDL_test_random.c +96 -0
  745. data/ext/alphatau/native/sdl/src/thread/SDL_systhread.h +70 -0
  746. data/ext/alphatau/native/sdl/src/thread/SDL_thread.c +503 -0
  747. data/ext/alphatau/native/sdl/src/thread/SDL_thread_c.h +95 -0
  748. data/ext/alphatau/native/sdl/src/thread/generic/SDL_syscond.c +220 -0
  749. data/ext/alphatau/native/sdl/src/thread/generic/SDL_sysmutex.c +165 -0
  750. data/ext/alphatau/native/sdl/src/thread/generic/SDL_sysmutex_c.h +22 -0
  751. data/ext/alphatau/native/sdl/src/thread/generic/SDL_syssem.c +217 -0
  752. data/ext/alphatau/native/sdl/src/thread/generic/SDL_systhread.c +71 -0
  753. data/ext/alphatau/native/sdl/src/thread/generic/SDL_systhread_c.h +26 -0
  754. data/ext/alphatau/native/sdl/src/thread/generic/SDL_systls.c +38 -0
  755. data/ext/alphatau/native/sdl/src/thread/psp/SDL_syscond.c +224 -0
  756. data/ext/alphatau/native/sdl/src/thread/psp/SDL_sysmutex.c +136 -0
  757. data/ext/alphatau/native/sdl/src/thread/psp/SDL_sysmutex_c.h +22 -0
  758. data/ext/alphatau/native/sdl/src/thread/psp/SDL_syssem.c +161 -0
  759. data/ext/alphatau/native/sdl/src/thread/psp/SDL_systhread.c +114 -0
  760. data/ext/alphatau/native/sdl/src/thread/psp/SDL_systhread_c.h +24 -0
  761. data/ext/alphatau/native/sdl/src/thread/pthread/SDL_syscond.c +158 -0
  762. data/ext/alphatau/native/sdl/src/thread/pthread/SDL_sysmutex.c +195 -0
  763. data/ext/alphatau/native/sdl/src/thread/pthread/SDL_sysmutex_c.h +32 -0
  764. data/ext/alphatau/native/sdl/src/thread/pthread/SDL_syssem.c +209 -0
  765. data/ext/alphatau/native/sdl/src/thread/pthread/SDL_systhread.c +324 -0
  766. data/ext/alphatau/native/sdl/src/thread/pthread/SDL_systhread_c.h +27 -0
  767. data/ext/alphatau/native/sdl/src/thread/pthread/SDL_systls.c +70 -0
  768. data/ext/alphatau/native/sdl/src/thread/stdcpp/SDL_syscond.cpp +164 -0
  769. data/ext/alphatau/native/sdl/src/thread/stdcpp/SDL_sysmutex.cpp +111 -0
  770. data/ext/alphatau/native/sdl/src/thread/stdcpp/SDL_sysmutex_c.h +30 -0
  771. data/ext/alphatau/native/sdl/src/thread/stdcpp/SDL_systhread.cpp +168 -0
  772. data/ext/alphatau/native/sdl/src/thread/stdcpp/SDL_systhread_c.h +26 -0
  773. data/ext/alphatau/native/sdl/src/thread/windows/SDL_sysmutex.c +110 -0
  774. data/ext/alphatau/native/sdl/src/thread/windows/SDL_syssem.c +152 -0
  775. data/ext/alphatau/native/sdl/src/thread/windows/SDL_systhread.c +260 -0
  776. data/ext/alphatau/native/sdl/src/thread/windows/SDL_systhread_c.h +32 -0
  777. data/ext/alphatau/native/sdl/src/thread/windows/SDL_systls.c +72 -0
  778. data/ext/alphatau/native/sdl/src/timer/SDL_timer.c +373 -0
  779. data/ext/alphatau/native/sdl/src/timer/SDL_timer_c.h +34 -0
  780. data/ext/alphatau/native/sdl/src/timer/dummy/SDL_systimer.c +75 -0
  781. data/ext/alphatau/native/sdl/src/timer/haiku/SDL_systimer.c +80 -0
  782. data/ext/alphatau/native/sdl/src/timer/psp/SDL_systimer.c +91 -0
  783. data/ext/alphatau/native/sdl/src/timer/unix/SDL_systimer.c +232 -0
  784. data/ext/alphatau/native/sdl/src/timer/windows/SDL_systimer.c +200 -0
  785. data/ext/alphatau/native/sdl/src/video/SDL_RLEaccel.c +1581 -0
  786. data/ext/alphatau/native/sdl/src/video/SDL_RLEaccel_c.h +31 -0
  787. data/ext/alphatau/native/sdl/src/video/SDL_blit.c +296 -0
  788. data/ext/alphatau/native/sdl/src/video/SDL_blit.h +553 -0
  789. data/ext/alphatau/native/sdl/src/video/SDL_blit_0.c +483 -0
  790. data/ext/alphatau/native/sdl/src/video/SDL_blit_1.c +552 -0
  791. data/ext/alphatau/native/sdl/src/video/SDL_blit_A.c +1388 -0
  792. data/ext/alphatau/native/sdl/src/video/SDL_blit_N.c +2647 -0
  793. data/ext/alphatau/native/sdl/src/video/SDL_blit_auto.c +7419 -0
  794. data/ext/alphatau/native/sdl/src/video/SDL_blit_auto.h +30 -0
  795. data/ext/alphatau/native/sdl/src/video/SDL_blit_copy.c +162 -0
  796. data/ext/alphatau/native/sdl/src/video/SDL_blit_copy.h +24 -0
  797. data/ext/alphatau/native/sdl/src/video/SDL_blit_slow.c +164 -0
  798. data/ext/alphatau/native/sdl/src/video/SDL_blit_slow.h +25 -0
  799. data/ext/alphatau/native/sdl/src/video/SDL_bmp.c +702 -0
  800. data/ext/alphatau/native/sdl/src/video/SDL_clipboard.c +90 -0
  801. data/ext/alphatau/native/sdl/src/video/SDL_egl.c +899 -0
  802. data/ext/alphatau/native/sdl/src/video/SDL_egl_c.h +149 -0
  803. data/ext/alphatau/native/sdl/src/video/SDL_fillrect.c +343 -0
  804. data/ext/alphatau/native/sdl/src/video/SDL_pixels.c +1125 -0
  805. data/ext/alphatau/native/sdl/src/video/SDL_pixels_c.h +40 -0
  806. data/ext/alphatau/native/sdl/src/video/SDL_rect.c +531 -0
  807. data/ext/alphatau/native/sdl/src/video/SDL_rect_c.h +25 -0
  808. data/ext/alphatau/native/sdl/src/video/SDL_shape.c +309 -0
  809. data/ext/alphatau/native/sdl/src/video/SDL_shape_internals.h +69 -0
  810. data/ext/alphatau/native/sdl/src/video/SDL_stretch.c +353 -0
  811. data/ext/alphatau/native/sdl/src/video/SDL_surface.c +1232 -0
  812. data/ext/alphatau/native/sdl/src/video/SDL_sysvideo.h +467 -0
  813. data/ext/alphatau/native/sdl/src/video/SDL_video.c +4160 -0
  814. data/ext/alphatau/native/sdl/src/video/SDL_vulkan_internal.h +91 -0
  815. data/ext/alphatau/native/sdl/src/video/SDL_vulkan_utils.c +172 -0
  816. data/ext/alphatau/native/sdl/src/video/SDL_yuv.c +1834 -0
  817. data/ext/alphatau/native/sdl/src/video/SDL_yuv_c.h +30 -0
  818. data/ext/alphatau/native/sdl/src/video/android/SDL_androidclipboard.c +48 -0
  819. data/ext/alphatau/native/sdl/src/video/android/SDL_androidclipboard.h +32 -0
  820. data/ext/alphatau/native/sdl/src/video/android/SDL_androidevents.c +123 -0
  821. data/ext/alphatau/native/sdl/src/video/android/SDL_androidevents.h +27 -0
  822. data/ext/alphatau/native/sdl/src/video/android/SDL_androidgl.c +62 -0
  823. data/ext/alphatau/native/sdl/src/video/android/SDL_androidgl.h +34 -0
  824. data/ext/alphatau/native/sdl/src/video/android/SDL_androidkeyboard.c +391 -0
  825. data/ext/alphatau/native/sdl/src/video/android/SDL_androidkeyboard.h +36 -0
  826. data/ext/alphatau/native/sdl/src/video/android/SDL_androidmessagebox.c +37 -0
  827. data/ext/alphatau/native/sdl/src/video/android/SDL_androidmessagebox.h +29 -0
  828. data/ext/alphatau/native/sdl/src/video/android/SDL_androidmouse.c +266 -0
  829. data/ext/alphatau/native/sdl/src/video/android/SDL_androidmouse.h +33 -0
  830. data/ext/alphatau/native/sdl/src/video/android/SDL_androidtouch.c +151 -0
  831. data/ext/alphatau/native/sdl/src/video/android/SDL_androidtouch.h +29 -0
  832. data/ext/alphatau/native/sdl/src/video/android/SDL_androidvideo.c +259 -0
  833. data/ext/alphatau/native/sdl/src/video/android/SDL_androidvideo.h +51 -0
  834. data/ext/alphatau/native/sdl/src/video/android/SDL_androidvulkan.c +175 -0
  835. data/ext/alphatau/native/sdl/src/video/android/SDL_androidvulkan.h +52 -0
  836. data/ext/alphatau/native/sdl/src/video/android/SDL_androidwindow.c +175 -0
  837. data/ext/alphatau/native/sdl/src/video/android/SDL_androidwindow.h +45 -0
  838. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaclipboard.h +36 -0
  839. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaclipboard.m +103 -0
  840. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaevents.h +32 -0
  841. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaevents.m +483 -0
  842. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoakeyboard.h +36 -0
  843. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoakeyboard.m +720 -0
  844. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamessagebox.h +29 -0
  845. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamessagebox.m +145 -0
  846. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoametalview.h +63 -0
  847. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoametalview.m +134 -0
  848. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamodes.h +46 -0
  849. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamodes.m +490 -0
  850. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamouse.h +52 -0
  851. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamouse.m +477 -0
  852. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamousetap.h +34 -0
  853. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoamousetap.m +279 -0
  854. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaopengl.h +68 -0
  855. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaopengl.m +428 -0
  856. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaopengles.h +49 -0
  857. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoaopengles.m +132 -0
  858. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoashape.h +45 -0
  859. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoashape.m +113 -0
  860. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoavideo.h +118 -0
  861. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoavideo.m +254 -0
  862. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoavulkan.h +55 -0
  863. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoavulkan.m +231 -0
  864. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoawindow.h +155 -0
  865. data/ext/alphatau/native/sdl/src/video/cocoa/SDL_cocoawindow.m +1885 -0
  866. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_WM.c +413 -0
  867. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_WM.h +56 -0
  868. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_dyn.c +117 -0
  869. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_dyn.h +41 -0
  870. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_events.c +748 -0
  871. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_events.h +34 -0
  872. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_modes.c +414 -0
  873. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_modes.h +59 -0
  874. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_mouse.c +389 -0
  875. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_mouse.h +44 -0
  876. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_opengl.c +332 -0
  877. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_opengl.h +64 -0
  878. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_render.c +1335 -0
  879. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_render.h +25 -0
  880. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_shape.c +131 -0
  881. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_shape.h +38 -0
  882. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_video.c +418 -0
  883. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_video.h +170 -0
  884. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_window.c +565 -0
  885. data/ext/alphatau/native/sdl/src/video/directfb/SDL_DirectFB_window.h +82 -0
  886. data/ext/alphatau/native/sdl/src/video/dummy/SDL_nullevents.c +41 -0
  887. data/ext/alphatau/native/sdl/src/video/dummy/SDL_nullevents_c.h +27 -0
  888. data/ext/alphatau/native/sdl/src/video/dummy/SDL_nullframebuffer.c +89 -0
  889. data/ext/alphatau/native/sdl/src/video/dummy/SDL_nullframebuffer_c.h +27 -0
  890. data/ext/alphatau/native/sdl/src/video/dummy/SDL_nullvideo.c +144 -0
  891. data/ext/alphatau/native/sdl/src/video/dummy/SDL_nullvideo.h +30 -0
  892. data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenevents.c +716 -0
  893. data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenevents.h +40 -0
  894. data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenframebuffer.c +178 -0
  895. data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenframebuffer.h +32 -0
  896. data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenmouse.c +275 -0
  897. data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenmouse.h +42 -0
  898. data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenopengles.c +119 -0
  899. data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenopengles.h +49 -0
  900. data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenvideo.c +354 -0
  901. data/ext/alphatau/native/sdl/src/video/emscripten/SDL_emscriptenvideo.h +58 -0
  902. data/ext/alphatau/native/sdl/src/video/haiku/SDL_BWin.h +679 -0
  903. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bclipboard.cc +95 -0
  904. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bclipboard.h +33 -0
  905. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bevents.cc +41 -0
  906. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bevents.h +39 -0
  907. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bframebuffer.cc +259 -0
  908. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bframebuffer.h +47 -0
  909. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bkeyboard.cc +190 -0
  910. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bkeyboard.h +44 -0
  911. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bmodes.cc +333 -0
  912. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bmodes.h +48 -0
  913. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bopengl.cc +176 -0
  914. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bopengl.h +55 -0
  915. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bvideo.cc +178 -0
  916. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bvideo.h +44 -0
  917. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bwindow.cc +233 -0
  918. data/ext/alphatau/native/sdl/src/video/haiku/SDL_bwindow.h +55 -0
  919. data/ext/alphatau/native/sdl/src/video/khronos/EGL/egl.h +303 -0
  920. data/ext/alphatau/native/sdl/src/video/khronos/EGL/eglext.h +1241 -0
  921. data/ext/alphatau/native/sdl/src/video/khronos/EGL/eglplatform.h +132 -0
  922. data/ext/alphatau/native/sdl/src/video/khronos/GLES2/gl2.h +675 -0
  923. data/ext/alphatau/native/sdl/src/video/khronos/GLES2/gl2ext.h +3505 -0
  924. data/ext/alphatau/native/sdl/src/video/khronos/GLES2/gl2platform.h +38 -0
  925. data/ext/alphatau/native/sdl/src/video/khronos/KHR/khrplatform.h +284 -0
  926. data/ext/alphatau/native/sdl/src/video/khronos/vulkan/vk_platform.h +120 -0
  927. data/ext/alphatau/native/sdl/src/video/khronos/vulkan/vulkan.h +6458 -0
  928. data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmdyn.c +171 -0
  929. data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmdyn.h +53 -0
  930. data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmevents.c +42 -0
  931. data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmevents.h +31 -0
  932. data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmmouse.c +501 -0
  933. data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmmouse.h +45 -0
  934. data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmopengles.c +189 -0
  935. data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmopengles.h +48 -0
  936. data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmsym.h +99 -0
  937. data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmvideo.c +664 -0
  938. data/ext/alphatau/native/sdl/src/video/kmsdrm/SDL_kmsdrmvideo.h +124 -0
  939. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirdyn.c +170 -0
  940. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirdyn.h +53 -0
  941. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirevents.c +321 -0
  942. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirevents.h +37 -0
  943. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirframebuffer.c +134 -0
  944. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirframebuffer.h +47 -0
  945. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirmouse.c +292 -0
  946. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirmouse.h +37 -0
  947. data/ext/alphatau/native/sdl/src/video/mir/SDL_miropengl.c +78 -0
  948. data/ext/alphatau/native/sdl/src/video/mir/SDL_miropengl.h +53 -0
  949. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirsym.h +143 -0
  950. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirvideo.c +423 -0
  951. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirvideo.h +49 -0
  952. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirvulkan.c +176 -0
  953. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirvulkan.h +52 -0
  954. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirwindow.c +374 -0
  955. data/ext/alphatau/native/sdl/src/video/mir/SDL_mirwindow.h +93 -0
  956. data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclevents.c +438 -0
  957. data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclevents_c.h +30 -0
  958. data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclglue.c +24 -0
  959. data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclopengles.c +174 -0
  960. data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclopengles.h +38 -0
  961. data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclvideo.c +183 -0
  962. data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclvideo.h +67 -0
  963. data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclwindow.c +79 -0
  964. data/ext/alphatau/native/sdl/src/video/nacl/SDL_naclwindow.h +32 -0
  965. data/ext/alphatau/native/sdl/src/video/pandora/SDL_pandora.c +838 -0
  966. data/ext/alphatau/native/sdl/src/video/pandora/SDL_pandora.h +101 -0
  967. data/ext/alphatau/native/sdl/src/video/pandora/SDL_pandora_events.c +38 -0
  968. data/ext/alphatau/native/sdl/src/video/pandora/SDL_pandora_events.h +25 -0
  969. data/ext/alphatau/native/sdl/src/video/psp/SDL_pspevents.c +290 -0
  970. data/ext/alphatau/native/sdl/src/video/psp/SDL_pspevents_c.h +31 -0
  971. data/ext/alphatau/native/sdl/src/video/psp/SDL_pspgl.c +210 -0
  972. data/ext/alphatau/native/sdl/src/video/psp/SDL_pspgl_c.h +54 -0
  973. data/ext/alphatau/native/sdl/src/video/psp/SDL_pspmouse.c +41 -0
  974. data/ext/alphatau/native/sdl/src/video/psp/SDL_pspmouse_c.h +24 -0
  975. data/ext/alphatau/native/sdl/src/video/psp/SDL_pspvideo.c +333 -0
  976. data/ext/alphatau/native/sdl/src/video/psp/SDL_pspvideo.h +102 -0
  977. data/ext/alphatau/native/sdl/src/video/qnx/gl.c +285 -0
  978. data/ext/alphatau/native/sdl/src/video/qnx/keyboard.c +133 -0
  979. data/ext/alphatau/native/sdl/src/video/qnx/sdl_qnx.h +48 -0
  980. data/ext/alphatau/native/sdl/src/video/qnx/video.c +364 -0
  981. data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpievents.c +45 -0
  982. data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpievents_c.h +31 -0
  983. data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpimouse.c +386 -0
  984. data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpimouse.h +43 -0
  985. data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpiopengles.c +71 -0
  986. data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpiopengles.h +49 -0
  987. data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpivideo.c +442 -0
  988. data/ext/alphatau/native/sdl/src/video/raspberry/SDL_rpivideo.h +104 -0
  989. data/ext/alphatau/native/sdl/src/video/sdlgenblit.pl +535 -0
  990. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitappdelegate.h +47 -0
  991. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitappdelegate.m +516 -0
  992. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitclipboard.h +35 -0
  993. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitclipboard.m +111 -0
  994. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitevents.h +30 -0
  995. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitevents.m +73 -0
  996. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitmessagebox.h +31 -0
  997. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitmessagebox.m +208 -0
  998. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitmetalview.h +58 -0
  999. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitmetalview.m +131 -0
  1000. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitmodes.h +54 -0
  1001. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitmodes.m +378 -0
  1002. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitopengles.h +40 -0
  1003. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitopengles.m +250 -0
  1004. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitopenglview.h +60 -0
  1005. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitopenglview.m +384 -0
  1006. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitvideo.h +46 -0
  1007. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitvideo.m +249 -0
  1008. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitview.h +41 -0
  1009. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitview.m +328 -0
  1010. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitviewcontroller.h +91 -0
  1011. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitviewcontroller.m +532 -0
  1012. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitvulkan.h +54 -0
  1013. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitvulkan.m +222 -0
  1014. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitwindow.h +56 -0
  1015. data/ext/alphatau/native/sdl/src/video/uikit/SDL_uikitwindow.m +465 -0
  1016. data/ext/alphatau/native/sdl/src/video/uikit/keyinfotable.h +174 -0
  1017. data/ext/alphatau/native/sdl/src/video/vivante/SDL_vivanteopengles.c +47 -0
  1018. data/ext/alphatau/native/sdl/src/video/vivante/SDL_vivanteopengles.h +48 -0
  1019. data/ext/alphatau/native/sdl/src/video/vivante/SDL_vivanteplatform.c +54 -0
  1020. data/ext/alphatau/native/sdl/src/video/vivante/SDL_vivanteplatform.h +47 -0
  1021. data/ext/alphatau/native/sdl/src/video/vivante/SDL_vivantevideo.c +409 -0
  1022. data/ext/alphatau/native/sdl/src/video/vivante/SDL_vivantevideo.h +91 -0
  1023. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandclipboard.c +123 -0
  1024. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandclipboard.h +32 -0
  1025. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylanddatamanager.c +468 -0
  1026. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylanddatamanager.h +103 -0
  1027. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylanddyn.c +178 -0
  1028. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylanddyn.h +107 -0
  1029. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandevents.c +1134 -0
  1030. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandevents_c.h +51 -0
  1031. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandmouse.c +396 -0
  1032. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandmouse.h +31 -0
  1033. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandopengles.c +93 -0
  1034. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandopengles.h +49 -0
  1035. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandsym.h +127 -0
  1036. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandtouch.c +265 -0
  1037. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandtouch.h +352 -0
  1038. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandvideo.c +517 -0
  1039. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandvideo.h +85 -0
  1040. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandvulkan.c +176 -0
  1041. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandvulkan.h +52 -0
  1042. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandwindow.c +684 -0
  1043. data/ext/alphatau/native/sdl/src/video/wayland/SDL_waylandwindow.h +88 -0
  1044. data/ext/alphatau/native/sdl/src/video/windows/SDL_msctf.h +242 -0
  1045. data/ext/alphatau/native/sdl/src/video/windows/SDL_vkeys.h +76 -0
  1046. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsclipboard.c +160 -0
  1047. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsclipboard.h +36 -0
  1048. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsevents.c +1229 -0
  1049. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsevents.h +36 -0
  1050. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsframebuffer.c +127 -0
  1051. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsframebuffer.h +27 -0
  1052. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowskeyboard.c +1579 -0
  1053. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowskeyboard.h +40 -0
  1054. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsmessagebox.c +905 -0
  1055. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsmessagebox.h +29 -0
  1056. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsmodes.c +407 -0
  1057. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsmodes.h +47 -0
  1058. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsmouse.c +322 -0
  1059. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsmouse.h +33 -0
  1060. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsopengl.c +895 -0
  1061. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsopengl.h +142 -0
  1062. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsopengles.c +131 -0
  1063. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsopengles.h +49 -0
  1064. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsshape.c +110 -0
  1065. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsshape.h +40 -0
  1066. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowstaskdialog.h +156 -0
  1067. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsvideo.c +442 -0
  1068. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsvideo.h +199 -0
  1069. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsvulkan.c +176 -0
  1070. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowsvulkan.h +52 -0
  1071. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowswindow.c +992 -0
  1072. data/ext/alphatau/native/sdl/src/video/windows/SDL_windowswindow.h +86 -0
  1073. data/ext/alphatau/native/sdl/src/video/windows/wmmsg.h +1052 -0
  1074. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtevents.cpp +154 -0
  1075. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtevents_c.h +82 -0
  1076. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtgamebar.cpp +196 -0
  1077. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtgamebar_cpp.h +35 -0
  1078. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtkeyboard.cpp +430 -0
  1079. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtmessagebox.cpp +112 -0
  1080. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtmessagebox.h +29 -0
  1081. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtmouse.cpp +224 -0
  1082. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtmouse_c.h +40 -0
  1083. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtopengles.cpp +203 -0
  1084. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtopengles.h +70 -0
  1085. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtpointerinput.cpp +415 -0
  1086. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtvideo.cpp +842 -0
  1087. data/ext/alphatau/native/sdl/src/video/winrt/SDL_winrtvideo_cpp.h +106 -0
  1088. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11clipboard.c +199 -0
  1089. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11clipboard.h +33 -0
  1090. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11dyn.c +212 -0
  1091. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11dyn.h +111 -0
  1092. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11events.c +1500 -0
  1093. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11events.h +31 -0
  1094. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11framebuffer.c +257 -0
  1095. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11framebuffer.h +31 -0
  1096. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11keyboard.c +543 -0
  1097. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11keyboard.h +36 -0
  1098. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11messagebox.c +853 -0
  1099. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11messagebox.h +28 -0
  1100. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11modes.c +1112 -0
  1101. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11modes.h +85 -0
  1102. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11mouse.c +448 -0
  1103. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11mouse.h +31 -0
  1104. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11opengl.c +946 -0
  1105. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11opengl.h +84 -0
  1106. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11opengles.c +109 -0
  1107. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11opengles.h +56 -0
  1108. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11shape.c +115 -0
  1109. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11shape.h +39 -0
  1110. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11sym.h +337 -0
  1111. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11touch.c +54 -0
  1112. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11touch.h +32 -0
  1113. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11video.c +497 -0
  1114. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11video.h +156 -0
  1115. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11vulkan.c +243 -0
  1116. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11vulkan.h +48 -0
  1117. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11window.c +1619 -0
  1118. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11window.h +111 -0
  1119. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11xinput2.c +313 -0
  1120. data/ext/alphatau/native/sdl/src/video/x11/SDL_x11xinput2.h +42 -0
  1121. data/ext/alphatau/native/sdl/src/video/x11/edid-parse.c +754 -0
  1122. data/ext/alphatau/native/sdl/src/video/x11/edid.h +167 -0
  1123. data/ext/alphatau/native/sdl/src/video/x11/imKStoUCS.c +350 -0
  1124. data/ext/alphatau/native/sdl/src/video/x11/imKStoUCS.h +32 -0
  1125. data/ext/alphatau/native/sdl/src/video/yuv2rgb/LICENSE +27 -0
  1126. data/ext/alphatau/native/sdl/src/video/yuv2rgb/README.md +63 -0
  1127. data/ext/alphatau/native/sdl/src/video/yuv2rgb/yuv_rgb.c +687 -0
  1128. data/ext/alphatau/native/sdl/src/video/yuv2rgb/yuv_rgb.h +381 -0
  1129. data/ext/alphatau/native/sdl/src/video/yuv2rgb/yuv_rgb_sse_func.h +498 -0
  1130. data/ext/alphatau/native/sdl/src/video/yuv2rgb/yuv_rgb_std_func.h +228 -0
  1131. data/ext/alphatau/native/sdl/test/CMakeLists.txt +122 -0
  1132. data/ext/alphatau/native/sdl/test/COPYING +8 -0
  1133. data/ext/alphatau/native/sdl/test/Makefile.in +328 -0
  1134. data/ext/alphatau/native/sdl/test/README +47 -0
  1135. data/ext/alphatau/native/sdl/test/acinclude.m4 +359 -0
  1136. data/ext/alphatau/native/sdl/test/aclocal.m4 +359 -0
  1137. data/ext/alphatau/native/sdl/test/autogen.sh +12 -0
  1138. data/ext/alphatau/native/sdl/test/axis.bmp +0 -0
  1139. data/ext/alphatau/native/sdl/test/button.bmp +0 -0
  1140. data/ext/alphatau/native/sdl/test/checkkeys.c +248 -0
  1141. data/ext/alphatau/native/sdl/test/configure +5124 -0
  1142. data/ext/alphatau/native/sdl/test/configure.in +191 -0
  1143. data/ext/alphatau/native/sdl/test/controllermap.bmp +0 -0
  1144. data/ext/alphatau/native/sdl/test/controllermap.c +781 -0
  1145. data/ext/alphatau/native/sdl/test/emscripten/joystick-pre.js +25 -0
  1146. data/ext/alphatau/native/sdl/test/gcc-fat.sh +110 -0
  1147. data/ext/alphatau/native/sdl/test/icon.bmp +0 -0
  1148. data/ext/alphatau/native/sdl/test/loopwave.c +179 -0
  1149. data/ext/alphatau/native/sdl/test/loopwavequeue.c +149 -0
  1150. data/ext/alphatau/native/sdl/test/moose.dat +0 -0
  1151. data/ext/alphatau/native/sdl/test/nacl/Makefile +63 -0
  1152. data/ext/alphatau/native/sdl/test/nacl/background.js +40 -0
  1153. data/ext/alphatau/native/sdl/test/nacl/common.js +474 -0
  1154. data/ext/alphatau/native/sdl/test/nacl/index.html +21 -0
  1155. data/ext/alphatau/native/sdl/test/nacl/manifest.json +22 -0
  1156. data/ext/alphatau/native/sdl/test/picture.xbm +14 -0
  1157. data/ext/alphatau/native/sdl/test/relative_mode.markdown +58 -0
  1158. data/ext/alphatau/native/sdl/test/sample.bmp +0 -0
  1159. data/ext/alphatau/native/sdl/test/sample.wav +0 -0
  1160. data/ext/alphatau/native/sdl/test/shapes/p01_shape24.bmp +0 -0
  1161. data/ext/alphatau/native/sdl/test/shapes/p01_shape32alpha.bmp +0 -0
  1162. data/ext/alphatau/native/sdl/test/shapes/p01_shape8.bmp +0 -0
  1163. data/ext/alphatau/native/sdl/test/shapes/p02_shape24.bmp +0 -0
  1164. data/ext/alphatau/native/sdl/test/shapes/p02_shape32alpha.bmp +0 -0
  1165. data/ext/alphatau/native/sdl/test/shapes/p02_shape8.bmp +0 -0
  1166. data/ext/alphatau/native/sdl/test/shapes/p03_shape24.bmp +0 -0
  1167. data/ext/alphatau/native/sdl/test/shapes/p03_shape8.bmp +0 -0
  1168. data/ext/alphatau/native/sdl/test/shapes/p04_shape1.bmp +0 -0
  1169. data/ext/alphatau/native/sdl/test/shapes/p04_shape24.bmp +0 -0
  1170. data/ext/alphatau/native/sdl/test/shapes/p04_shape32alpha.bmp +0 -0
  1171. data/ext/alphatau/native/sdl/test/shapes/p04_shape8.bmp +0 -0
  1172. data/ext/alphatau/native/sdl/test/shapes/p05_shape8.bmp +0 -0
  1173. data/ext/alphatau/native/sdl/test/shapes/p06_shape1alpha.bmp +0 -0
  1174. data/ext/alphatau/native/sdl/test/shapes/p06_shape24.bmp +0 -0
  1175. data/ext/alphatau/native/sdl/test/shapes/p06_shape32alpha.bmp +0 -0
  1176. data/ext/alphatau/native/sdl/test/shapes/p06_shape8.bmp +0 -0
  1177. data/ext/alphatau/native/sdl/test/shapes/p07_shape24.bmp +0 -0
  1178. data/ext/alphatau/native/sdl/test/shapes/p07_shape32alpha.bmp +0 -0
  1179. data/ext/alphatau/native/sdl/test/shapes/p07_shape8.bmp +0 -0
  1180. data/ext/alphatau/native/sdl/test/shapes/p08_shape24.bmp +0 -0
  1181. data/ext/alphatau/native/sdl/test/shapes/p08_shape32alpha.bmp +0 -0
  1182. data/ext/alphatau/native/sdl/test/shapes/p08_shape8.bmp +0 -0
  1183. data/ext/alphatau/native/sdl/test/shapes/p09_shape24.bmp +0 -0
  1184. data/ext/alphatau/native/sdl/test/shapes/p09_shape32alpha.bmp +0 -0
  1185. data/ext/alphatau/native/sdl/test/shapes/p09_shape8.bmp +0 -0
  1186. data/ext/alphatau/native/sdl/test/shapes/p10_shape1.bmp +0 -0
  1187. data/ext/alphatau/native/sdl/test/shapes/p10_shape24.bmp +0 -0
  1188. data/ext/alphatau/native/sdl/test/shapes/p10_shape32alpha.bmp +0 -0
  1189. data/ext/alphatau/native/sdl/test/shapes/p10_shape8.bmp +0 -0
  1190. data/ext/alphatau/native/sdl/test/shapes/p11_shape24.bmp +0 -0
  1191. data/ext/alphatau/native/sdl/test/shapes/p11_shape32alpha.bmp +0 -0
  1192. data/ext/alphatau/native/sdl/test/shapes/p11_shape8.bmp +0 -0
  1193. data/ext/alphatau/native/sdl/test/shapes/p12_shape24.bmp +0 -0
  1194. data/ext/alphatau/native/sdl/test/shapes/p12_shape8.bmp +0 -0
  1195. data/ext/alphatau/native/sdl/test/shapes/p13_shape24.bmp +0 -0
  1196. data/ext/alphatau/native/sdl/test/shapes/p13_shape32alpha.bmp +0 -0
  1197. data/ext/alphatau/native/sdl/test/shapes/p13_shape8.bmp +0 -0
  1198. data/ext/alphatau/native/sdl/test/shapes/p14_shape24.bmp +0 -0
  1199. data/ext/alphatau/native/sdl/test/shapes/p14_shape8.bmp +0 -0
  1200. data/ext/alphatau/native/sdl/test/shapes/p15_shape24.bmp +0 -0
  1201. data/ext/alphatau/native/sdl/test/shapes/p15_shape32alpha.bmp +0 -0
  1202. data/ext/alphatau/native/sdl/test/shapes/p15_shape8.bmp +0 -0
  1203. data/ext/alphatau/native/sdl/test/shapes/p16_shape1.bmp +0 -0
  1204. data/ext/alphatau/native/sdl/test/shapes/p16_shape24.bmp +0 -0
  1205. data/ext/alphatau/native/sdl/test/shapes/p16_shape8.bmp +0 -0
  1206. data/ext/alphatau/native/sdl/test/shapes/trollface_24.bmp +0 -0
  1207. data/ext/alphatau/native/sdl/test/shapes/trollface_32alpha.bmp +0 -0
  1208. data/ext/alphatau/native/sdl/test/testatomic.c +727 -0
  1209. data/ext/alphatau/native/sdl/test/testaudiocapture.c +165 -0
  1210. data/ext/alphatau/native/sdl/test/testaudiohotplug.c +203 -0
  1211. data/ext/alphatau/native/sdl/test/testaudioinfo.c +74 -0
  1212. data/ext/alphatau/native/sdl/test/testautomation.c +124 -0
  1213. data/ext/alphatau/native/sdl/test/testautomation_audio.c +1038 -0
  1214. data/ext/alphatau/native/sdl/test/testautomation_clipboard.c +184 -0
  1215. data/ext/alphatau/native/sdl/test/testautomation_events.c +201 -0
  1216. data/ext/alphatau/native/sdl/test/testautomation_hints.c +168 -0
  1217. data/ext/alphatau/native/sdl/test/testautomation_keyboard.c +713 -0
  1218. data/ext/alphatau/native/sdl/test/testautomation_main.c +157 -0
  1219. data/ext/alphatau/native/sdl/test/testautomation_mouse.c +606 -0
  1220. data/ext/alphatau/native/sdl/test/testautomation_pixels.c +529 -0
  1221. data/ext/alphatau/native/sdl/test/testautomation_platform.c +584 -0
  1222. data/ext/alphatau/native/sdl/test/testautomation_rect.c +1696 -0
  1223. data/ext/alphatau/native/sdl/test/testautomation_render.c +1099 -0
  1224. data/ext/alphatau/native/sdl/test/testautomation_rwops.c +748 -0
  1225. data/ext/alphatau/native/sdl/test/testautomation_sdltest.c +1319 -0
  1226. data/ext/alphatau/native/sdl/test/testautomation_stdlib.c +319 -0
  1227. data/ext/alphatau/native/sdl/test/testautomation_suites.h +54 -0
  1228. data/ext/alphatau/native/sdl/test/testautomation_surface.c +647 -0
  1229. data/ext/alphatau/native/sdl/test/testautomation_syswm.c +61 -0
  1230. data/ext/alphatau/native/sdl/test/testautomation_timer.c +201 -0
  1231. data/ext/alphatau/native/sdl/test/testautomation_video.c +1811 -0
  1232. data/ext/alphatau/native/sdl/test/testbounds.c +40 -0
  1233. data/ext/alphatau/native/sdl/test/testcustomcursor.c +259 -0
  1234. data/ext/alphatau/native/sdl/test/testdisplayinfo.c +96 -0
  1235. data/ext/alphatau/native/sdl/test/testdraw2.c +305 -0
  1236. data/ext/alphatau/native/sdl/test/testdrawchessboard.c +147 -0
  1237. data/ext/alphatau/native/sdl/test/testdropfile.c +98 -0
  1238. data/ext/alphatau/native/sdl/test/testerror.c +76 -0
  1239. data/ext/alphatau/native/sdl/test/testfile.c +283 -0
  1240. data/ext/alphatau/native/sdl/test/testfilesystem.c +60 -0
  1241. data/ext/alphatau/native/sdl/test/testgamecontroller.c +375 -0
  1242. data/ext/alphatau/native/sdl/test/testgesture.c +309 -0
  1243. data/ext/alphatau/native/sdl/test/testgl2.c +416 -0
  1244. data/ext/alphatau/native/sdl/test/testgles.c +355 -0
  1245. data/ext/alphatau/native/sdl/test/testgles2.c +732 -0
  1246. data/ext/alphatau/native/sdl/test/testhaptic.c +369 -0
  1247. data/ext/alphatau/native/sdl/test/testhittesting.c +134 -0
  1248. data/ext/alphatau/native/sdl/test/testhotplug.c +162 -0
  1249. data/ext/alphatau/native/sdl/test/testiconv.c +88 -0
  1250. data/ext/alphatau/native/sdl/test/testime.c +801 -0
  1251. data/ext/alphatau/native/sdl/test/testintersections.c +363 -0
  1252. data/ext/alphatau/native/sdl/test/testjoystick.c +387 -0
  1253. data/ext/alphatau/native/sdl/test/testkeys.c +40 -0
  1254. data/ext/alphatau/native/sdl/test/testloadso.c +82 -0
  1255. data/ext/alphatau/native/sdl/test/testlock.c +128 -0
  1256. data/ext/alphatau/native/sdl/test/testmessage.c +193 -0
  1257. data/ext/alphatau/native/sdl/test/testmultiaudio.c +199 -0
  1258. data/ext/alphatau/native/sdl/test/testnative.c +237 -0
  1259. data/ext/alphatau/native/sdl/test/testnative.h +46 -0
  1260. data/ext/alphatau/native/sdl/test/testnativecocoa.m +51 -0
  1261. data/ext/alphatau/native/sdl/test/testnativew32.c +86 -0
  1262. data/ext/alphatau/native/sdl/test/testnativex11.c +53 -0
  1263. data/ext/alphatau/native/sdl/test/testoverlay2.c +408 -0
  1264. data/ext/alphatau/native/sdl/test/testplatform.c +442 -0
  1265. data/ext/alphatau/native/sdl/test/testpower.c +80 -0
  1266. data/ext/alphatau/native/sdl/test/testqsort.c +108 -0
  1267. data/ext/alphatau/native/sdl/test/testrelative.c +126 -0
  1268. data/ext/alphatau/native/sdl/test/testrendercopyex.c +233 -0
  1269. data/ext/alphatau/native/sdl/test/testrendertarget.c +335 -0
  1270. data/ext/alphatau/native/sdl/test/testresample.c +120 -0
  1271. data/ext/alphatau/native/sdl/test/testrumble.c +153 -0
  1272. data/ext/alphatau/native/sdl/test/testscale.c +224 -0
  1273. data/ext/alphatau/native/sdl/test/testsem.c +130 -0
  1274. data/ext/alphatau/native/sdl/test/testsensor.c +117 -0
  1275. data/ext/alphatau/native/sdl/test/testshader.c +500 -0
  1276. data/ext/alphatau/native/sdl/test/testshape.c +200 -0
  1277. data/ext/alphatau/native/sdl/test/testsprite2.c +409 -0
  1278. data/ext/alphatau/native/sdl/test/testspriteminimal.c +194 -0
  1279. data/ext/alphatau/native/sdl/test/teststreaming.c +190 -0
  1280. data/ext/alphatau/native/sdl/test/testthread.c +130 -0
  1281. data/ext/alphatau/native/sdl/test/testtimer.c +122 -0
  1282. data/ext/alphatau/native/sdl/test/testver.c +47 -0
  1283. data/ext/alphatau/native/sdl/test/testviewport.c +217 -0
  1284. data/ext/alphatau/native/sdl/test/testvulkan.c +1201 -0
  1285. data/ext/alphatau/native/sdl/test/testwm2.c +174 -0
  1286. data/ext/alphatau/native/sdl/test/testyuv.bmp +0 -0
  1287. data/ext/alphatau/native/sdl/test/testyuv.c +455 -0
  1288. data/ext/alphatau/native/sdl/test/testyuv_cvt.c +300 -0
  1289. data/ext/alphatau/native/sdl/test/testyuv_cvt.h +16 -0
  1290. data/ext/alphatau/native/sdl/test/torturethread.c +113 -0
  1291. data/ext/alphatau/native/sdl/test/utf8.txt +287 -0
  1292. data/ext/alphatau/native/sdl/visualtest/COPYING.txt +18 -0
  1293. data/ext/alphatau/native/sdl/visualtest/Makefile.in +37 -0
  1294. data/ext/alphatau/native/sdl/visualtest/README.txt +214 -0
  1295. data/ext/alphatau/native/sdl/visualtest/acinclude.m4 +359 -0
  1296. data/ext/alphatau/native/sdl/visualtest/autogen.sh +12 -0
  1297. data/ext/alphatau/native/sdl/visualtest/compile +1 -0
  1298. data/ext/alphatau/native/sdl/visualtest/config.h +23 -0
  1299. data/ext/alphatau/native/sdl/visualtest/config.h.in +22 -0
  1300. data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_blendmodes/testsprite2_blendmodes.actions +3 -0
  1301. data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_blendmodes/testsprite2_blendmodes.config +5 -0
  1302. data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_blendmodes/testsprite2_blendmodes.parameters +5 -0
  1303. data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_crashtest/testsprite2_crashtest.actions +1 -0
  1304. data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_crashtest/testsprite2_crashtest.config +5 -0
  1305. data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_crashtest/testsprite2_crashtest.parameters +24 -0
  1306. data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_fullscreen/testsprite2_fullscreen.actions +3 -0
  1307. data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_fullscreen/testsprite2_fullscreen.config +5 -0
  1308. data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_fullscreen/testsprite2_fullscreen.parameters +5 -0
  1309. data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_geometry/testsprite2_geometry.actions +3 -0
  1310. data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_geometry/testsprite2_geometry.config +5 -0
  1311. data/ext/alphatau/native/sdl/visualtest/configs/testsprite2_geometry/testsprite2_geometry.parameters +5 -0
  1312. data/ext/alphatau/native/sdl/visualtest/configure +5203 -0
  1313. data/ext/alphatau/native/sdl/visualtest/configure.in +166 -0
  1314. data/ext/alphatau/native/sdl/visualtest/depcomp +1 -0
  1315. data/ext/alphatau/native/sdl/visualtest/docs/Doxyfile +1936 -0
  1316. data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_action_configparser.h +149 -0
  1317. data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_exhaustive_variator.h +64 -0
  1318. data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_harness_argparser.h +75 -0
  1319. data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_mischelper.h +28 -0
  1320. data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_parsehelper.h +46 -0
  1321. data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_process.h +112 -0
  1322. data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_random_variator.h +61 -0
  1323. data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_rwhelper.h +87 -0
  1324. data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_screenshot.h +52 -0
  1325. data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_sut_configparser.h +105 -0
  1326. data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_variator_common.h +122 -0
  1327. data/ext/alphatau/native/sdl/visualtest/include/SDL_visualtest_variators.h +66 -0
  1328. data/ext/alphatau/native/sdl/visualtest/install-sh +1 -0
  1329. data/ext/alphatau/native/sdl/visualtest/launch_harness.cmd +2 -0
  1330. data/ext/alphatau/native/sdl/visualtest/launch_harness.sh +6 -0
  1331. data/ext/alphatau/native/sdl/visualtest/missing +1 -0
  1332. data/ext/alphatau/native/sdl/visualtest/src/action_configparser.c +396 -0
  1333. data/ext/alphatau/native/sdl/visualtest/src/harness_argparser.c +358 -0
  1334. data/ext/alphatau/native/sdl/visualtest/src/linux/linux_process.c +199 -0
  1335. data/ext/alphatau/native/sdl/visualtest/src/mischelper.c +28 -0
  1336. data/ext/alphatau/native/sdl/visualtest/src/parsehelper.c +231 -0
  1337. data/ext/alphatau/native/sdl/visualtest/src/rwhelper.c +131 -0
  1338. data/ext/alphatau/native/sdl/visualtest/src/screenshot.c +136 -0
  1339. data/ext/alphatau/native/sdl/visualtest/src/sut_configparser.c +232 -0
  1340. data/ext/alphatau/native/sdl/visualtest/src/testharness.c +533 -0
  1341. data/ext/alphatau/native/sdl/visualtest/src/variator_common.c +225 -0
  1342. data/ext/alphatau/native/sdl/visualtest/src/variator_exhaustive.c +132 -0
  1343. data/ext/alphatau/native/sdl/visualtest/src/variator_random.c +111 -0
  1344. data/ext/alphatau/native/sdl/visualtest/src/variators.c +93 -0
  1345. data/ext/alphatau/native/sdl/visualtest/src/windows/windows_process.c +284 -0
  1346. data/ext/alphatau/native/sdl/visualtest/src/windows/windows_screenshot.c +349 -0
  1347. data/ext/alphatau/native/sdl/visualtest/stamp-h1 +1 -0
  1348. data/ext/alphatau/native/sdl/visualtest/testsprite2_sample.actions +3 -0
  1349. data/ext/alphatau/native/sdl/visualtest/testsprite2_sample.config +6 -0
  1350. data/ext/alphatau/native/sdl/visualtest/testsprite2_sample.parameters +29 -0
  1351. data/ext/alphatau/native/sdl/visualtest/unittest/testquit.actions +1 -0
  1352. data/ext/alphatau/native/sdl/visualtest/unittest/testquit.c +101 -0
  1353. data/ext/alphatau/native/sdl/visualtest/unittest/testquit.config +5 -0
  1354. data/ext/alphatau/native/sdl/visualtest/unittest/testquit.parameters +3 -0
  1355. data/ext/alphatau/native/sdl/wayland-protocols/pointer-constraints-unstable-v1.xml +339 -0
  1356. data/ext/alphatau/native/sdl/wayland-protocols/relative-pointer-unstable-v1.xml +136 -0
  1357. data/ext/alphatau/native/sdl/wayland-protocols/wayland.xml +2746 -0
  1358. data/ext/alphatau/native/sdl/wayland-protocols/xdg-shell-unstable-v6.xml +1044 -0
  1359. data/ext/alphatau/native/sdl/wayland-protocols/xdg-shell.xml +1120 -0
  1360. data/lib/alphatau.rb +12 -0
  1361. data/lib/alphatau/version.rb +3 -0
  1362. metadata +1465 -0
@@ -0,0 +1,44 @@
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
+ #ifndef SDL_POWER_DISABLED
24
+ #if SDL_POWER_WINRT
25
+
26
+ #include "SDL_power.h"
27
+
28
+ extern "C"
29
+ SDL_bool
30
+ SDL_GetPowerInfo_WinRT(SDL_PowerState * state, int *seconds, int *percent)
31
+ {
32
+ /* TODO, WinRT: Battery info is available on at least one WinRT platform (Windows Phone 8). Implement SDL_GetPowerInfo_WinRT as appropriate. */
33
+ /* Notes:
34
+ - the Win32 function, GetSystemPowerStatus, is not available for use on WinRT
35
+ - Windows Phone 8 has a 'Battery' class, which is documented as available for C++
36
+ - More info on WP8's Battery class can be found at http://msdn.microsoft.com/library/windowsphone/develop/jj207231
37
+ */
38
+ return SDL_FALSE;
39
+ }
40
+
41
+ #endif /* SDL_POWER_WINRT */
42
+ #endif /* SDL_POWER_DISABLED */
43
+
44
+ /* vi: set ts=4 sw=4 expandtab: */
@@ -0,0 +1,136 @@
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_D3D || SDL_VIDEO_RENDER_D3D11) && !SDL_RENDER_DISABLED
24
+ #include "SDL_stdinc.h"
25
+
26
+ #include "SDL_d3dmath.h"
27
+
28
+ /* Direct3D matrix math functions */
29
+
30
+ Float4X4 MatrixIdentity()
31
+ {
32
+ Float4X4 m;
33
+ SDL_zero(m);
34
+ m.v._11 = 1.0f;
35
+ m.v._22 = 1.0f;
36
+ m.v._33 = 1.0f;
37
+ m.v._44 = 1.0f;
38
+ return m;
39
+ }
40
+
41
+ Float4X4 MatrixMultiply(Float4X4 M1, Float4X4 M2)
42
+ {
43
+ Float4X4 m;
44
+ m.v._11 = M1.v._11 * M2.v._11 + M1.v._12 * M2.v._21 + M1.v._13 * M2.v._31 + M1.v._14 * M2.v._41;
45
+ m.v._12 = M1.v._11 * M2.v._12 + M1.v._12 * M2.v._22 + M1.v._13 * M2.v._32 + M1.v._14 * M2.v._42;
46
+ m.v._13 = M1.v._11 * M2.v._13 + M1.v._12 * M2.v._23 + M1.v._13 * M2.v._33 + M1.v._14 * M2.v._43;
47
+ m.v._14 = M1.v._11 * M2.v._14 + M1.v._12 * M2.v._24 + M1.v._13 * M2.v._34 + M1.v._14 * M2.v._44;
48
+ m.v._21 = M1.v._21 * M2.v._11 + M1.v._22 * M2.v._21 + M1.v._23 * M2.v._31 + M1.v._24 * M2.v._41;
49
+ m.v._22 = M1.v._21 * M2.v._12 + M1.v._22 * M2.v._22 + M1.v._23 * M2.v._32 + M1.v._24 * M2.v._42;
50
+ m.v._23 = M1.v._21 * M2.v._13 + M1.v._22 * M2.v._23 + M1.v._23 * M2.v._33 + M1.v._24 * M2.v._43;
51
+ m.v._24 = M1.v._21 * M2.v._14 + M1.v._22 * M2.v._24 + M1.v._23 * M2.v._34 + M1.v._24 * M2.v._44;
52
+ m.v._31 = M1.v._31 * M2.v._11 + M1.v._32 * M2.v._21 + M1.v._33 * M2.v._31 + M1.v._34 * M2.v._41;
53
+ m.v._32 = M1.v._31 * M2.v._12 + M1.v._32 * M2.v._22 + M1.v._33 * M2.v._32 + M1.v._34 * M2.v._42;
54
+ m.v._33 = M1.v._31 * M2.v._13 + M1.v._32 * M2.v._23 + M1.v._33 * M2.v._33 + M1.v._34 * M2.v._43;
55
+ m.v._34 = M1.v._31 * M2.v._14 + M1.v._32 * M2.v._24 + M1.v._33 * M2.v._34 + M1.v._34 * M2.v._44;
56
+ m.v._41 = M1.v._41 * M2.v._11 + M1.v._42 * M2.v._21 + M1.v._43 * M2.v._31 + M1.v._44 * M2.v._41;
57
+ m.v._42 = M1.v._41 * M2.v._12 + M1.v._42 * M2.v._22 + M1.v._43 * M2.v._32 + M1.v._44 * M2.v._42;
58
+ m.v._43 = M1.v._41 * M2.v._13 + M1.v._42 * M2.v._23 + M1.v._43 * M2.v._33 + M1.v._44 * M2.v._43;
59
+ m.v._44 = M1.v._41 * M2.v._14 + M1.v._42 * M2.v._24 + M1.v._43 * M2.v._34 + M1.v._44 * M2.v._44;
60
+ return m;
61
+ }
62
+
63
+ Float4X4 MatrixScaling(float x, float y, float z)
64
+ {
65
+ Float4X4 m;
66
+ SDL_zero(m);
67
+ m.v._11 = x;
68
+ m.v._22 = y;
69
+ m.v._33 = z;
70
+ m.v._44 = 1.0f;
71
+ return m;
72
+ }
73
+
74
+ Float4X4 MatrixTranslation(float x, float y, float z)
75
+ {
76
+ Float4X4 m;
77
+ SDL_zero(m);
78
+ m.v._11 = 1.0f;
79
+ m.v._22 = 1.0f;
80
+ m.v._33 = 1.0f;
81
+ m.v._44 = 1.0f;
82
+ m.v._41 = x;
83
+ m.v._42 = y;
84
+ m.v._43 = z;
85
+ return m;
86
+ }
87
+
88
+ Float4X4 MatrixRotationX(float r)
89
+ {
90
+ float sinR = SDL_sinf(r);
91
+ float cosR = SDL_cosf(r);
92
+ Float4X4 m;
93
+ SDL_zero(m);
94
+ m.v._11 = 1.0f;
95
+ m.v._22 = cosR;
96
+ m.v._23 = sinR;
97
+ m.v._32 = -sinR;
98
+ m.v._33 = cosR;
99
+ m.v._44 = 1.0f;
100
+ return m;
101
+ }
102
+
103
+ Float4X4 MatrixRotationY(float r)
104
+ {
105
+ float sinR = SDL_sinf(r);
106
+ float cosR = SDL_cosf(r);
107
+ Float4X4 m;
108
+ SDL_zero(m);
109
+ m.v._11 = cosR;
110
+ m.v._13 = -sinR;
111
+ m.v._22 = 1.0f;
112
+ m.v._31 = sinR;
113
+ m.v._33 = cosR;
114
+ m.v._44 = 1.0f;
115
+ return m;
116
+ }
117
+
118
+ Float4X4 MatrixRotationZ(float r)
119
+ {
120
+ float sinR = SDL_sinf(r);
121
+ float cosR = SDL_cosf(r);
122
+ Float4X4 m;
123
+ SDL_zero(m);
124
+ m.v._11 = cosR;
125
+ m.v._12 = sinR;
126
+ m.v._21 = -sinR;
127
+ m.v._22 = cosR;
128
+ m.v._33 = 1.0f;
129
+ m.v._44 = 1.0f;
130
+ return m;
131
+
132
+ }
133
+
134
+ #endif /* (SDL_VIDEO_RENDER_D3D || SDL_VIDEO_RENDER_D3D11) && !SDL_RENDER_DISABLED */
135
+
136
+ /* vi: set ts=4 sw=4 expandtab: */
@@ -0,0 +1,72 @@
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_D3D || SDL_VIDEO_RENDER_D3D11) && !SDL_RENDER_DISABLED
24
+
25
+ /* Direct3D matrix math functions */
26
+
27
+ typedef struct
28
+ {
29
+ float x;
30
+ float y;
31
+ } Float2;
32
+
33
+ typedef struct
34
+ {
35
+ float x;
36
+ float y;
37
+ float z;
38
+ } Float3;
39
+
40
+ typedef struct
41
+ {
42
+ float x;
43
+ float y;
44
+ float z;
45
+ float w;
46
+ } Float4;
47
+
48
+ typedef struct
49
+ {
50
+ union {
51
+ struct {
52
+ float _11, _12, _13, _14;
53
+ float _21, _22, _23, _24;
54
+ float _31, _32, _33, _34;
55
+ float _41, _42, _43, _44;
56
+ } v;
57
+ float m[4][4];
58
+ };
59
+ } Float4X4;
60
+
61
+
62
+ Float4X4 MatrixIdentity();
63
+ Float4X4 MatrixMultiply(Float4X4 M1, Float4X4 M2);
64
+ Float4X4 MatrixScaling(float x, float y, float z);
65
+ Float4X4 MatrixTranslation(float x, float y, float z);
66
+ Float4X4 MatrixRotationX(float r);
67
+ Float4X4 MatrixRotationY(float r);
68
+ Float4X4 MatrixRotationZ(float r);
69
+
70
+ #endif /* (SDL_VIDEO_RENDER_D3D || SDL_VIDEO_RENDER_D3D11) && !SDL_RENDER_DISABLED */
71
+
72
+ /* vi: set ts=4 sw=4 expandtab: */
@@ -0,0 +1,2292 @@
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
+ /* The SDL 2D rendering system */
24
+
25
+ #include "SDL_assert.h"
26
+ #include "SDL_hints.h"
27
+ #include "SDL_log.h"
28
+ #include "SDL_render.h"
29
+ #include "SDL_sysrender.h"
30
+ #include "software/SDL_render_sw_c.h"
31
+
32
+
33
+ #define SDL_WINDOWRENDERDATA "_SDL_WindowRenderData"
34
+
35
+ #define CHECK_RENDERER_MAGIC(renderer, retval) \
36
+ SDL_assert(renderer && renderer->magic == &renderer_magic); \
37
+ if (!renderer || renderer->magic != &renderer_magic) { \
38
+ SDL_SetError("Invalid renderer"); \
39
+ return retval; \
40
+ }
41
+
42
+ #define CHECK_TEXTURE_MAGIC(texture, retval) \
43
+ SDL_assert(texture && texture->magic == &texture_magic); \
44
+ if (!texture || texture->magic != &texture_magic) { \
45
+ SDL_SetError("Invalid texture"); \
46
+ return retval; \
47
+ }
48
+
49
+ /* Predefined blend modes */
50
+ #define SDL_COMPOSE_BLENDMODE(srcColorFactor, dstColorFactor, colorOperation, \
51
+ srcAlphaFactor, dstAlphaFactor, alphaOperation) \
52
+ (SDL_BlendMode)(((Uint32)colorOperation << 0) | \
53
+ ((Uint32)srcColorFactor << 4) | \
54
+ ((Uint32)dstColorFactor << 8) | \
55
+ ((Uint32)alphaOperation << 16) | \
56
+ ((Uint32)srcAlphaFactor << 20) | \
57
+ ((Uint32)dstAlphaFactor << 24))
58
+
59
+ #define SDL_BLENDMODE_NONE_FULL \
60
+ SDL_COMPOSE_BLENDMODE(SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ZERO, SDL_BLENDOPERATION_ADD, \
61
+ SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ZERO, SDL_BLENDOPERATION_ADD)
62
+
63
+ #define SDL_BLENDMODE_BLEND_FULL \
64
+ SDL_COMPOSE_BLENDMODE(SDL_BLENDFACTOR_SRC_ALPHA, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD, \
65
+ SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD)
66
+
67
+ #define SDL_BLENDMODE_ADD_FULL \
68
+ SDL_COMPOSE_BLENDMODE(SDL_BLENDFACTOR_SRC_ALPHA, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_ADD, \
69
+ SDL_BLENDFACTOR_ZERO, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_ADD)
70
+
71
+ #define SDL_BLENDMODE_MOD_FULL \
72
+ SDL_COMPOSE_BLENDMODE(SDL_BLENDFACTOR_ZERO, SDL_BLENDFACTOR_SRC_COLOR, SDL_BLENDOPERATION_ADD, \
73
+ SDL_BLENDFACTOR_ZERO, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_ADD)
74
+
75
+ #if !SDL_RENDER_DISABLED
76
+ static const SDL_RenderDriver *render_drivers[] = {
77
+ #if SDL_VIDEO_RENDER_D3D
78
+ &D3D_RenderDriver,
79
+ #endif
80
+ #if SDL_VIDEO_RENDER_D3D11
81
+ &D3D11_RenderDriver,
82
+ #endif
83
+ #if SDL_VIDEO_RENDER_OGL
84
+ &GL_RenderDriver,
85
+ #endif
86
+ #if SDL_VIDEO_RENDER_OGL_ES2
87
+ &GLES2_RenderDriver,
88
+ #endif
89
+ #if SDL_VIDEO_RENDER_OGL_ES
90
+ &GLES_RenderDriver,
91
+ #endif
92
+ #if SDL_VIDEO_RENDER_DIRECTFB
93
+ &DirectFB_RenderDriver,
94
+ #endif
95
+ #if SDL_VIDEO_RENDER_METAL
96
+ &METAL_RenderDriver,
97
+ #endif
98
+ #if SDL_VIDEO_RENDER_PSP
99
+ &PSP_RenderDriver,
100
+ #endif
101
+ &SW_RenderDriver
102
+ };
103
+ #endif /* !SDL_RENDER_DISABLED */
104
+
105
+ static char renderer_magic;
106
+ static char texture_magic;
107
+
108
+ static int UpdateLogicalSize(SDL_Renderer *renderer);
109
+
110
+ int
111
+ SDL_GetNumRenderDrivers(void)
112
+ {
113
+ #if !SDL_RENDER_DISABLED
114
+ return SDL_arraysize(render_drivers);
115
+ #else
116
+ return 0;
117
+ #endif
118
+ }
119
+
120
+ int
121
+ SDL_GetRenderDriverInfo(int index, SDL_RendererInfo * info)
122
+ {
123
+ #if !SDL_RENDER_DISABLED
124
+ if (index < 0 || index >= SDL_GetNumRenderDrivers()) {
125
+ return SDL_SetError("index must be in the range of 0 - %d",
126
+ SDL_GetNumRenderDrivers() - 1);
127
+ }
128
+ *info = render_drivers[index]->info;
129
+ return 0;
130
+ #else
131
+ return SDL_SetError("SDL not built with rendering support");
132
+ #endif
133
+ }
134
+
135
+ static void GetWindowViewportValues(SDL_Renderer *renderer, int *logical_w, int *logical_h, SDL_Rect *viewport, SDL_FPoint *scale)
136
+ {
137
+ SDL_LockMutex(renderer->target_mutex);
138
+ *logical_w = renderer->target ? renderer->logical_w_backup : renderer->logical_w;
139
+ *logical_h = renderer->target ? renderer->logical_h_backup : renderer->logical_h;
140
+ *viewport = renderer->target ? renderer->viewport_backup : renderer->viewport;
141
+ *scale = renderer->target ? renderer->scale_backup : renderer->scale;
142
+ SDL_UnlockMutex(renderer->target_mutex);
143
+ }
144
+
145
+ static int SDLCALL
146
+ SDL_RendererEventWatch(void *userdata, SDL_Event *event)
147
+ {
148
+ SDL_Renderer *renderer = (SDL_Renderer *)userdata;
149
+
150
+ if (event->type == SDL_WINDOWEVENT) {
151
+ SDL_Window *window = SDL_GetWindowFromID(event->window.windowID);
152
+ if (window == renderer->window) {
153
+ if (renderer->WindowEvent) {
154
+ renderer->WindowEvent(renderer, &event->window);
155
+ }
156
+
157
+ if (event->window.event == SDL_WINDOWEVENT_SIZE_CHANGED) {
158
+ /* Make sure we're operating on the default render target */
159
+ SDL_Texture *saved_target = SDL_GetRenderTarget(renderer);
160
+ if (saved_target) {
161
+ SDL_SetRenderTarget(renderer, NULL);
162
+ }
163
+
164
+ if (renderer->logical_w) {
165
+ UpdateLogicalSize(renderer);
166
+ } else {
167
+ /* Window was resized, reset viewport */
168
+ int w, h;
169
+
170
+ if (renderer->GetOutputSize) {
171
+ renderer->GetOutputSize(renderer, &w, &h);
172
+ } else {
173
+ SDL_GetWindowSize(renderer->window, &w, &h);
174
+ }
175
+
176
+ if (renderer->target) {
177
+ renderer->viewport_backup.x = 0;
178
+ renderer->viewport_backup.y = 0;
179
+ renderer->viewport_backup.w = w;
180
+ renderer->viewport_backup.h = h;
181
+ } else {
182
+ renderer->viewport.x = 0;
183
+ renderer->viewport.y = 0;
184
+ renderer->viewport.w = w;
185
+ renderer->viewport.h = h;
186
+ renderer->UpdateViewport(renderer);
187
+ }
188
+ }
189
+
190
+ if (saved_target) {
191
+ SDL_SetRenderTarget(renderer, saved_target);
192
+ }
193
+ } else if (event->window.event == SDL_WINDOWEVENT_HIDDEN) {
194
+ renderer->hidden = SDL_TRUE;
195
+ } else if (event->window.event == SDL_WINDOWEVENT_SHOWN) {
196
+ if (!(SDL_GetWindowFlags(window) & SDL_WINDOW_MINIMIZED)) {
197
+ renderer->hidden = SDL_FALSE;
198
+ }
199
+ } else if (event->window.event == SDL_WINDOWEVENT_MINIMIZED) {
200
+ renderer->hidden = SDL_TRUE;
201
+ } else if (event->window.event == SDL_WINDOWEVENT_RESTORED ||
202
+ event->window.event == SDL_WINDOWEVENT_MAXIMIZED) {
203
+ if (!(SDL_GetWindowFlags(window) & SDL_WINDOW_HIDDEN)) {
204
+ renderer->hidden = SDL_FALSE;
205
+ }
206
+ }
207
+ }
208
+ } else if (event->type == SDL_MOUSEMOTION) {
209
+ SDL_Window *window = SDL_GetWindowFromID(event->motion.windowID);
210
+ if (window == renderer->window) {
211
+ int logical_w, logical_h;
212
+ SDL_Rect viewport;
213
+ SDL_FPoint scale;
214
+ GetWindowViewportValues(renderer, &logical_w, &logical_h, &viewport, &scale);
215
+ if (logical_w) {
216
+ event->motion.x -= (int)(viewport.x * renderer->dpi_scale.x);
217
+ event->motion.y -= (int)(viewport.y * renderer->dpi_scale.y);
218
+ event->motion.x = (int)(event->motion.x / (scale.x * renderer->dpi_scale.x));
219
+ event->motion.y = (int)(event->motion.y / (scale.y * renderer->dpi_scale.y));
220
+ if (event->motion.xrel > 0) {
221
+ event->motion.xrel = SDL_max(1, (int)(event->motion.xrel / (scale.x * renderer->dpi_scale.x)));
222
+ } else if (event->motion.xrel < 0) {
223
+ event->motion.xrel = SDL_min(-1, (int)(event->motion.xrel / (scale.x * renderer->dpi_scale.x)));
224
+ }
225
+ if (event->motion.yrel > 0) {
226
+ event->motion.yrel = SDL_max(1, (int)(event->motion.yrel / (scale.y * renderer->dpi_scale.y)));
227
+ } else if (event->motion.yrel < 0) {
228
+ event->motion.yrel = SDL_min(-1, (int)(event->motion.yrel / (scale.y * renderer->dpi_scale.y)));
229
+ }
230
+ }
231
+ }
232
+ } else if (event->type == SDL_MOUSEBUTTONDOWN ||
233
+ event->type == SDL_MOUSEBUTTONUP) {
234
+ SDL_Window *window = SDL_GetWindowFromID(event->button.windowID);
235
+ if (window == renderer->window) {
236
+ int logical_w, logical_h;
237
+ SDL_Rect viewport;
238
+ SDL_FPoint scale;
239
+ GetWindowViewportValues(renderer, &logical_w, &logical_h, &viewport, &scale);
240
+ if (logical_w) {
241
+ event->button.x -= (int)(viewport.x * renderer->dpi_scale.x);
242
+ event->button.y -= (int)(viewport.y * renderer->dpi_scale.y);
243
+ event->button.x = (int)(event->button.x / (scale.x * renderer->dpi_scale.x));
244
+ event->button.y = (int)(event->button.y / (scale.y * renderer->dpi_scale.y));
245
+ }
246
+ }
247
+ } else if (event->type == SDL_FINGERDOWN ||
248
+ event->type == SDL_FINGERUP ||
249
+ event->type == SDL_FINGERMOTION) {
250
+ int logical_w, logical_h;
251
+ SDL_Rect viewport;
252
+ SDL_FPoint scale;
253
+ GetWindowViewportValues(renderer, &logical_w, &logical_h, &viewport, &scale);
254
+ if (logical_w) {
255
+ int w = 1;
256
+ int h = 1;
257
+ SDL_GetRendererOutputSize(renderer, &w, &h);
258
+
259
+ event->tfinger.x *= (w - 1);
260
+ event->tfinger.y *= (h - 1);
261
+
262
+ event->tfinger.x -= (viewport.x * renderer->dpi_scale.x);
263
+ event->tfinger.y -= (viewport.y * renderer->dpi_scale.y);
264
+ event->tfinger.x = (event->tfinger.x / (scale.x * renderer->dpi_scale.x));
265
+ event->tfinger.y = (event->tfinger.y / (scale.y * renderer->dpi_scale.y));
266
+
267
+ if (logical_w > 1) {
268
+ event->tfinger.x = event->tfinger.x / (logical_w - 1);
269
+ } else {
270
+ event->tfinger.x = 0.5f;
271
+ }
272
+ if (logical_h > 1) {
273
+ event->tfinger.y = event->tfinger.y / (logical_h - 1);
274
+ } else {
275
+ event->tfinger.y = 0.5f;
276
+ }
277
+ }
278
+ }
279
+
280
+ return 0;
281
+ }
282
+
283
+ int
284
+ SDL_CreateWindowAndRenderer(int width, int height, Uint32 window_flags,
285
+ SDL_Window **window, SDL_Renderer **renderer)
286
+ {
287
+ *window = SDL_CreateWindow(NULL, SDL_WINDOWPOS_UNDEFINED,
288
+ SDL_WINDOWPOS_UNDEFINED,
289
+ width, height, window_flags);
290
+ if (!*window) {
291
+ *renderer = NULL;
292
+ return -1;
293
+ }
294
+
295
+ *renderer = SDL_CreateRenderer(*window, -1, 0);
296
+ if (!*renderer) {
297
+ return -1;
298
+ }
299
+
300
+ return 0;
301
+ }
302
+
303
+ SDL_Renderer *
304
+ SDL_CreateRenderer(SDL_Window * window, int index, Uint32 flags)
305
+ {
306
+ #if !SDL_RENDER_DISABLED
307
+ SDL_Renderer *renderer = NULL;
308
+ int n = SDL_GetNumRenderDrivers();
309
+ const char *hint;
310
+
311
+ if (!window) {
312
+ SDL_SetError("Invalid window");
313
+ return NULL;
314
+ }
315
+
316
+ if (SDL_GetRenderer(window)) {
317
+ SDL_SetError("Renderer already associated with window");
318
+ return NULL;
319
+ }
320
+
321
+ if (SDL_GetHint(SDL_HINT_RENDER_VSYNC)) {
322
+ if (SDL_GetHintBoolean(SDL_HINT_RENDER_VSYNC, SDL_TRUE)) {
323
+ flags |= SDL_RENDERER_PRESENTVSYNC;
324
+ } else {
325
+ flags &= ~SDL_RENDERER_PRESENTVSYNC;
326
+ }
327
+ }
328
+
329
+ if (index < 0) {
330
+ hint = SDL_GetHint(SDL_HINT_RENDER_DRIVER);
331
+ if (hint) {
332
+ for (index = 0; index < n; ++index) {
333
+ const SDL_RenderDriver *driver = render_drivers[index];
334
+
335
+ if (SDL_strcasecmp(hint, driver->info.name) == 0) {
336
+ /* Create a new renderer instance */
337
+ renderer = driver->CreateRenderer(window, flags);
338
+ break;
339
+ }
340
+ }
341
+ }
342
+
343
+ if (!renderer) {
344
+ for (index = 0; index < n; ++index) {
345
+ const SDL_RenderDriver *driver = render_drivers[index];
346
+
347
+ if ((driver->info.flags & flags) == flags) {
348
+ /* Create a new renderer instance */
349
+ renderer = driver->CreateRenderer(window, flags);
350
+ if (renderer) {
351
+ /* Yay, we got one! */
352
+ break;
353
+ }
354
+ }
355
+ }
356
+ }
357
+ if (index == n) {
358
+ SDL_SetError("Couldn't find matching render driver");
359
+ return NULL;
360
+ }
361
+ } else {
362
+ if (index >= SDL_GetNumRenderDrivers()) {
363
+ SDL_SetError("index must be -1 or in the range of 0 - %d",
364
+ SDL_GetNumRenderDrivers() - 1);
365
+ return NULL;
366
+ }
367
+ /* Create a new renderer instance */
368
+ renderer = render_drivers[index]->CreateRenderer(window, flags);
369
+ }
370
+
371
+ if (renderer) {
372
+ renderer->magic = &renderer_magic;
373
+ renderer->window = window;
374
+ renderer->target_mutex = SDL_CreateMutex();
375
+ renderer->scale.x = 1.0f;
376
+ renderer->scale.y = 1.0f;
377
+ renderer->dpi_scale.x = 1.0f;
378
+ renderer->dpi_scale.y = 1.0f;
379
+
380
+ if (window && renderer->GetOutputSize) {
381
+ int window_w, window_h;
382
+ int output_w, output_h;
383
+ if (renderer->GetOutputSize(renderer, &output_w, &output_h) == 0) {
384
+ SDL_GetWindowSize(renderer->window, &window_w, &window_h);
385
+ renderer->dpi_scale.x = (float)window_w / output_w;
386
+ renderer->dpi_scale.y = (float)window_h / output_h;
387
+ }
388
+ }
389
+
390
+ if (SDL_GetWindowFlags(window) & (SDL_WINDOW_HIDDEN|SDL_WINDOW_MINIMIZED)) {
391
+ renderer->hidden = SDL_TRUE;
392
+ } else {
393
+ renderer->hidden = SDL_FALSE;
394
+ }
395
+
396
+ SDL_SetWindowData(window, SDL_WINDOWRENDERDATA, renderer);
397
+
398
+ SDL_RenderSetViewport(renderer, NULL);
399
+
400
+ SDL_AddEventWatch(SDL_RendererEventWatch, renderer);
401
+
402
+ SDL_LogInfo(SDL_LOG_CATEGORY_RENDER,
403
+ "Created renderer: %s", renderer->info.name);
404
+ }
405
+ return renderer;
406
+ #else
407
+ SDL_SetError("SDL not built with rendering support");
408
+ return NULL;
409
+ #endif
410
+ }
411
+
412
+ SDL_Renderer *
413
+ SDL_CreateSoftwareRenderer(SDL_Surface * surface)
414
+ {
415
+ #if !SDL_RENDER_DISABLED
416
+ SDL_Renderer *renderer;
417
+
418
+ renderer = SW_CreateRendererForSurface(surface);
419
+
420
+ if (renderer) {
421
+ renderer->magic = &renderer_magic;
422
+ renderer->target_mutex = SDL_CreateMutex();
423
+ renderer->scale.x = 1.0f;
424
+ renderer->scale.y = 1.0f;
425
+
426
+ SDL_RenderSetViewport(renderer, NULL);
427
+ }
428
+ return renderer;
429
+ #else
430
+ SDL_SetError("SDL not built with rendering support");
431
+ return NULL;
432
+ #endif /* !SDL_RENDER_DISABLED */
433
+ }
434
+
435
+ SDL_Renderer *
436
+ SDL_GetRenderer(SDL_Window * window)
437
+ {
438
+ return (SDL_Renderer *)SDL_GetWindowData(window, SDL_WINDOWRENDERDATA);
439
+ }
440
+
441
+ int
442
+ SDL_GetRendererInfo(SDL_Renderer * renderer, SDL_RendererInfo * info)
443
+ {
444
+ CHECK_RENDERER_MAGIC(renderer, -1);
445
+
446
+ *info = renderer->info;
447
+ return 0;
448
+ }
449
+
450
+ int
451
+ SDL_GetRendererOutputSize(SDL_Renderer * renderer, int *w, int *h)
452
+ {
453
+ CHECK_RENDERER_MAGIC(renderer, -1);
454
+
455
+ if (renderer->target) {
456
+ return SDL_QueryTexture(renderer->target, NULL, NULL, w, h);
457
+ } else if (renderer->GetOutputSize) {
458
+ return renderer->GetOutputSize(renderer, w, h);
459
+ } else if (renderer->window) {
460
+ SDL_GetWindowSize(renderer->window, w, h);
461
+ return 0;
462
+ } else {
463
+ SDL_assert(0 && "This should never happen");
464
+ return SDL_SetError("Renderer doesn't support querying output size");
465
+ }
466
+ }
467
+
468
+ static SDL_bool
469
+ IsSupportedBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode)
470
+ {
471
+ switch (blendMode)
472
+ {
473
+ /* These are required to be supported by all renderers */
474
+ case SDL_BLENDMODE_NONE:
475
+ case SDL_BLENDMODE_BLEND:
476
+ case SDL_BLENDMODE_ADD:
477
+ case SDL_BLENDMODE_MOD:
478
+ return SDL_TRUE;
479
+
480
+ default:
481
+ return renderer->SupportsBlendMode && renderer->SupportsBlendMode(renderer, blendMode);
482
+ }
483
+ }
484
+
485
+ static SDL_bool
486
+ IsSupportedFormat(SDL_Renderer * renderer, Uint32 format)
487
+ {
488
+ Uint32 i;
489
+
490
+ for (i = 0; i < renderer->info.num_texture_formats; ++i) {
491
+ if (renderer->info.texture_formats[i] == format) {
492
+ return SDL_TRUE;
493
+ }
494
+ }
495
+ return SDL_FALSE;
496
+ }
497
+
498
+ static Uint32
499
+ GetClosestSupportedFormat(SDL_Renderer * renderer, Uint32 format)
500
+ {
501
+ Uint32 i;
502
+
503
+ if (SDL_ISPIXELFORMAT_FOURCC(format)) {
504
+ /* Look for an exact match */
505
+ for (i = 0; i < renderer->info.num_texture_formats; ++i) {
506
+ if (renderer->info.texture_formats[i] == format) {
507
+ return renderer->info.texture_formats[i];
508
+ }
509
+ }
510
+ } else {
511
+ SDL_bool hasAlpha = SDL_ISPIXELFORMAT_ALPHA(format);
512
+
513
+ /* We just want to match the first format that has the same channels */
514
+ for (i = 0; i < renderer->info.num_texture_formats; ++i) {
515
+ if (!SDL_ISPIXELFORMAT_FOURCC(renderer->info.texture_formats[i]) &&
516
+ SDL_ISPIXELFORMAT_ALPHA(renderer->info.texture_formats[i]) == hasAlpha) {
517
+ return renderer->info.texture_formats[i];
518
+ }
519
+ }
520
+ }
521
+ return renderer->info.texture_formats[0];
522
+ }
523
+
524
+ SDL_ScaleMode SDL_GetScaleMode(void)
525
+ {
526
+ const char *hint = SDL_GetHint(SDL_HINT_RENDER_SCALE_QUALITY);
527
+
528
+ if (!hint || SDL_strcasecmp(hint, "nearest") == 0) {
529
+ return SDL_ScaleModeNearest;
530
+ } else if (SDL_strcasecmp(hint, "linear") == 0) {
531
+ return SDL_ScaleModeLinear;
532
+ } else if (SDL_strcasecmp(hint, "best") == 0) {
533
+ return SDL_ScaleModeBest;
534
+ } else {
535
+ return (SDL_ScaleMode)SDL_atoi(hint);
536
+ }
537
+ }
538
+
539
+ SDL_Texture *
540
+ SDL_CreateTexture(SDL_Renderer * renderer, Uint32 format, int access, int w, int h)
541
+ {
542
+ SDL_Texture *texture;
543
+
544
+ CHECK_RENDERER_MAGIC(renderer, NULL);
545
+
546
+ if (!format) {
547
+ format = renderer->info.texture_formats[0];
548
+ }
549
+ if (SDL_BYTESPERPIXEL(format) == 0) {
550
+ SDL_SetError("Invalid texture format");
551
+ return NULL;
552
+ }
553
+ if (SDL_ISPIXELFORMAT_INDEXED(format)) {
554
+ SDL_SetError("Palettized textures are not supported");
555
+ return NULL;
556
+ }
557
+ if (w <= 0 || h <= 0) {
558
+ SDL_SetError("Texture dimensions can't be 0");
559
+ return NULL;
560
+ }
561
+ if ((renderer->info.max_texture_width && w > renderer->info.max_texture_width) ||
562
+ (renderer->info.max_texture_height && h > renderer->info.max_texture_height)) {
563
+ SDL_SetError("Texture dimensions are limited to %dx%d", renderer->info.max_texture_width, renderer->info.max_texture_height);
564
+ return NULL;
565
+ }
566
+ texture = (SDL_Texture *) SDL_calloc(1, sizeof(*texture));
567
+ if (!texture) {
568
+ SDL_OutOfMemory();
569
+ return NULL;
570
+ }
571
+ texture->magic = &texture_magic;
572
+ texture->format = format;
573
+ texture->access = access;
574
+ texture->w = w;
575
+ texture->h = h;
576
+ texture->r = 255;
577
+ texture->g = 255;
578
+ texture->b = 255;
579
+ texture->a = 255;
580
+ texture->scaleMode = SDL_GetScaleMode();
581
+ texture->renderer = renderer;
582
+ texture->next = renderer->textures;
583
+ if (renderer->textures) {
584
+ renderer->textures->prev = texture;
585
+ }
586
+ renderer->textures = texture;
587
+
588
+ if (IsSupportedFormat(renderer, format)) {
589
+ if (renderer->CreateTexture(renderer, texture) < 0) {
590
+ SDL_DestroyTexture(texture);
591
+ return NULL;
592
+ }
593
+ } else {
594
+ texture->native = SDL_CreateTexture(renderer,
595
+ GetClosestSupportedFormat(renderer, format),
596
+ access, w, h);
597
+ if (!texture->native) {
598
+ SDL_DestroyTexture(texture);
599
+ return NULL;
600
+ }
601
+
602
+ /* Swap textures to have texture before texture->native in the list */
603
+ texture->native->next = texture->next;
604
+ if (texture->native->next) {
605
+ texture->native->next->prev = texture->native;
606
+ }
607
+ texture->prev = texture->native->prev;
608
+ if (texture->prev) {
609
+ texture->prev->next = texture;
610
+ }
611
+ texture->native->prev = texture;
612
+ texture->next = texture->native;
613
+ renderer->textures = texture;
614
+
615
+ if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) {
616
+ texture->yuv = SDL_SW_CreateYUVTexture(format, w, h);
617
+ if (!texture->yuv) {
618
+ SDL_DestroyTexture(texture);
619
+ return NULL;
620
+ }
621
+ } else if (access == SDL_TEXTUREACCESS_STREAMING) {
622
+ /* The pitch is 4 byte aligned */
623
+ texture->pitch = (((w * SDL_BYTESPERPIXEL(format)) + 3) & ~3);
624
+ texture->pixels = SDL_calloc(1, texture->pitch * h);
625
+ if (!texture->pixels) {
626
+ SDL_DestroyTexture(texture);
627
+ return NULL;
628
+ }
629
+ }
630
+ }
631
+ return texture;
632
+ }
633
+
634
+ SDL_Texture *
635
+ SDL_CreateTextureFromSurface(SDL_Renderer * renderer, SDL_Surface * surface)
636
+ {
637
+ const SDL_PixelFormat *fmt;
638
+ SDL_bool needAlpha;
639
+ Uint32 i;
640
+ Uint32 format;
641
+ SDL_Texture *texture;
642
+
643
+ CHECK_RENDERER_MAGIC(renderer, NULL);
644
+
645
+ if (!surface) {
646
+ SDL_SetError("SDL_CreateTextureFromSurface() passed NULL surface");
647
+ return NULL;
648
+ }
649
+
650
+ /* See what the best texture format is */
651
+ fmt = surface->format;
652
+ if (fmt->Amask || SDL_GetColorKey(surface, NULL) == 0) {
653
+ needAlpha = SDL_TRUE;
654
+ } else {
655
+ needAlpha = SDL_FALSE;
656
+ }
657
+ format = renderer->info.texture_formats[0];
658
+ for (i = 0; i < renderer->info.num_texture_formats; ++i) {
659
+ if (!SDL_ISPIXELFORMAT_FOURCC(renderer->info.texture_formats[i]) &&
660
+ SDL_ISPIXELFORMAT_ALPHA(renderer->info.texture_formats[i]) == needAlpha) {
661
+ format = renderer->info.texture_formats[i];
662
+ break;
663
+ }
664
+ }
665
+
666
+ texture = SDL_CreateTexture(renderer, format, SDL_TEXTUREACCESS_STATIC,
667
+ surface->w, surface->h);
668
+ if (!texture) {
669
+ return NULL;
670
+ }
671
+
672
+ if (format == surface->format->format) {
673
+ if (SDL_MUSTLOCK(surface)) {
674
+ SDL_LockSurface(surface);
675
+ SDL_UpdateTexture(texture, NULL, surface->pixels, surface->pitch);
676
+ SDL_UnlockSurface(surface);
677
+ } else {
678
+ SDL_UpdateTexture(texture, NULL, surface->pixels, surface->pitch);
679
+ }
680
+ } else {
681
+ SDL_PixelFormat *dst_fmt;
682
+ SDL_Surface *temp = NULL;
683
+
684
+ /* Set up a destination surface for the texture update */
685
+ dst_fmt = SDL_AllocFormat(format);
686
+ if (!dst_fmt) {
687
+ SDL_DestroyTexture(texture);
688
+ return NULL;
689
+ }
690
+ temp = SDL_ConvertSurface(surface, dst_fmt, 0);
691
+ SDL_FreeFormat(dst_fmt);
692
+ if (temp) {
693
+ SDL_UpdateTexture(texture, NULL, temp->pixels, temp->pitch);
694
+ SDL_FreeSurface(temp);
695
+ } else {
696
+ SDL_DestroyTexture(texture);
697
+ return NULL;
698
+ }
699
+ }
700
+
701
+ {
702
+ Uint8 r, g, b, a;
703
+ SDL_BlendMode blendMode;
704
+
705
+ SDL_GetSurfaceColorMod(surface, &r, &g, &b);
706
+ SDL_SetTextureColorMod(texture, r, g, b);
707
+
708
+ SDL_GetSurfaceAlphaMod(surface, &a);
709
+ SDL_SetTextureAlphaMod(texture, a);
710
+
711
+ if (SDL_GetColorKey(surface, NULL) == 0) {
712
+ /* We converted to a texture with alpha format */
713
+ SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND);
714
+ } else {
715
+ SDL_GetSurfaceBlendMode(surface, &blendMode);
716
+ SDL_SetTextureBlendMode(texture, blendMode);
717
+ }
718
+ }
719
+ return texture;
720
+ }
721
+
722
+ int
723
+ SDL_QueryTexture(SDL_Texture * texture, Uint32 * format, int *access,
724
+ int *w, int *h)
725
+ {
726
+ CHECK_TEXTURE_MAGIC(texture, -1);
727
+
728
+ if (format) {
729
+ *format = texture->format;
730
+ }
731
+ if (access) {
732
+ *access = texture->access;
733
+ }
734
+ if (w) {
735
+ *w = texture->w;
736
+ }
737
+ if (h) {
738
+ *h = texture->h;
739
+ }
740
+ return 0;
741
+ }
742
+
743
+ int
744
+ SDL_SetTextureColorMod(SDL_Texture * texture, Uint8 r, Uint8 g, Uint8 b)
745
+ {
746
+ SDL_Renderer *renderer;
747
+
748
+ CHECK_TEXTURE_MAGIC(texture, -1);
749
+
750
+ renderer = texture->renderer;
751
+ if (r < 255 || g < 255 || b < 255) {
752
+ texture->modMode |= SDL_TEXTUREMODULATE_COLOR;
753
+ } else {
754
+ texture->modMode &= ~SDL_TEXTUREMODULATE_COLOR;
755
+ }
756
+ texture->r = r;
757
+ texture->g = g;
758
+ texture->b = b;
759
+ if (texture->native) {
760
+ return SDL_SetTextureColorMod(texture->native, r, g, b);
761
+ } else if (renderer->SetTextureColorMod) {
762
+ return renderer->SetTextureColorMod(renderer, texture);
763
+ } else {
764
+ return 0;
765
+ }
766
+ }
767
+
768
+ int
769
+ SDL_GetTextureColorMod(SDL_Texture * texture, Uint8 * r, Uint8 * g,
770
+ Uint8 * b)
771
+ {
772
+ CHECK_TEXTURE_MAGIC(texture, -1);
773
+
774
+ if (r) {
775
+ *r = texture->r;
776
+ }
777
+ if (g) {
778
+ *g = texture->g;
779
+ }
780
+ if (b) {
781
+ *b = texture->b;
782
+ }
783
+ return 0;
784
+ }
785
+
786
+ int
787
+ SDL_SetTextureAlphaMod(SDL_Texture * texture, Uint8 alpha)
788
+ {
789
+ SDL_Renderer *renderer;
790
+
791
+ CHECK_TEXTURE_MAGIC(texture, -1);
792
+
793
+ renderer = texture->renderer;
794
+ if (alpha < 255) {
795
+ texture->modMode |= SDL_TEXTUREMODULATE_ALPHA;
796
+ } else {
797
+ texture->modMode &= ~SDL_TEXTUREMODULATE_ALPHA;
798
+ }
799
+ texture->a = alpha;
800
+ if (texture->native) {
801
+ return SDL_SetTextureAlphaMod(texture->native, alpha);
802
+ } else if (renderer->SetTextureAlphaMod) {
803
+ return renderer->SetTextureAlphaMod(renderer, texture);
804
+ } else {
805
+ return 0;
806
+ }
807
+ }
808
+
809
+ int
810
+ SDL_GetTextureAlphaMod(SDL_Texture * texture, Uint8 * alpha)
811
+ {
812
+ CHECK_TEXTURE_MAGIC(texture, -1);
813
+
814
+ if (alpha) {
815
+ *alpha = texture->a;
816
+ }
817
+ return 0;
818
+ }
819
+
820
+ int
821
+ SDL_SetTextureBlendMode(SDL_Texture * texture, SDL_BlendMode blendMode)
822
+ {
823
+ SDL_Renderer *renderer;
824
+
825
+ CHECK_TEXTURE_MAGIC(texture, -1);
826
+
827
+ renderer = texture->renderer;
828
+ if (!IsSupportedBlendMode(renderer, blendMode)) {
829
+ return SDL_Unsupported();
830
+ }
831
+ texture->blendMode = blendMode;
832
+ if (texture->native) {
833
+ return SDL_SetTextureBlendMode(texture->native, blendMode);
834
+ } else if (renderer->SetTextureBlendMode) {
835
+ return renderer->SetTextureBlendMode(renderer, texture);
836
+ } else {
837
+ return 0;
838
+ }
839
+ }
840
+
841
+ int
842
+ SDL_GetTextureBlendMode(SDL_Texture * texture, SDL_BlendMode *blendMode)
843
+ {
844
+ CHECK_TEXTURE_MAGIC(texture, -1);
845
+
846
+ if (blendMode) {
847
+ *blendMode = texture->blendMode;
848
+ }
849
+ return 0;
850
+ }
851
+
852
+ static int
853
+ SDL_UpdateTextureYUV(SDL_Texture * texture, const SDL_Rect * rect,
854
+ const void *pixels, int pitch)
855
+ {
856
+ SDL_Texture *native = texture->native;
857
+ SDL_Rect full_rect;
858
+
859
+ if (SDL_SW_UpdateYUVTexture(texture->yuv, rect, pixels, pitch) < 0) {
860
+ return -1;
861
+ }
862
+
863
+ full_rect.x = 0;
864
+ full_rect.y = 0;
865
+ full_rect.w = texture->w;
866
+ full_rect.h = texture->h;
867
+ rect = &full_rect;
868
+
869
+ if (texture->access == SDL_TEXTUREACCESS_STREAMING) {
870
+ /* We can lock the texture and copy to it */
871
+ void *native_pixels = NULL;
872
+ int native_pitch = 0;
873
+
874
+ if (SDL_LockTexture(native, rect, &native_pixels, &native_pitch) < 0) {
875
+ return -1;
876
+ }
877
+ SDL_SW_CopyYUVToRGB(texture->yuv, rect, native->format,
878
+ rect->w, rect->h, native_pixels, native_pitch);
879
+ SDL_UnlockTexture(native);
880
+ } else {
881
+ /* Use a temporary buffer for updating */
882
+ const int temp_pitch = (((rect->w * SDL_BYTESPERPIXEL(native->format)) + 3) & ~3);
883
+ const size_t alloclen = rect->h * temp_pitch;
884
+ if (alloclen > 0) {
885
+ void *temp_pixels = SDL_malloc(alloclen);
886
+ if (!temp_pixels) {
887
+ return SDL_OutOfMemory();
888
+ }
889
+ SDL_SW_CopyYUVToRGB(texture->yuv, rect, native->format,
890
+ rect->w, rect->h, temp_pixels, temp_pitch);
891
+ SDL_UpdateTexture(native, rect, temp_pixels, temp_pitch);
892
+ SDL_free(temp_pixels);
893
+ }
894
+ }
895
+ return 0;
896
+ }
897
+
898
+ static int
899
+ SDL_UpdateTextureNative(SDL_Texture * texture, const SDL_Rect * rect,
900
+ const void *pixels, int pitch)
901
+ {
902
+ SDL_Texture *native = texture->native;
903
+
904
+ if (!rect->w || !rect->h) {
905
+ return 0; /* nothing to do. */
906
+ }
907
+
908
+ if (texture->access == SDL_TEXTUREACCESS_STREAMING) {
909
+ /* We can lock the texture and copy to it */
910
+ void *native_pixels = NULL;
911
+ int native_pitch = 0;
912
+
913
+ if (SDL_LockTexture(native, rect, &native_pixels, &native_pitch) < 0) {
914
+ return -1;
915
+ }
916
+ SDL_ConvertPixels(rect->w, rect->h,
917
+ texture->format, pixels, pitch,
918
+ native->format, native_pixels, native_pitch);
919
+ SDL_UnlockTexture(native);
920
+ } else {
921
+ /* Use a temporary buffer for updating */
922
+ const int temp_pitch = (((rect->w * SDL_BYTESPERPIXEL(native->format)) + 3) & ~3);
923
+ const size_t alloclen = rect->h * temp_pitch;
924
+ if (alloclen > 0) {
925
+ void *temp_pixels = SDL_malloc(alloclen);
926
+ if (!temp_pixels) {
927
+ return SDL_OutOfMemory();
928
+ }
929
+ SDL_ConvertPixels(rect->w, rect->h,
930
+ texture->format, pixels, pitch,
931
+ native->format, temp_pixels, temp_pitch);
932
+ SDL_UpdateTexture(native, rect, temp_pixels, temp_pitch);
933
+ SDL_free(temp_pixels);
934
+ }
935
+ }
936
+ return 0;
937
+ }
938
+
939
+ int
940
+ SDL_UpdateTexture(SDL_Texture * texture, const SDL_Rect * rect,
941
+ const void *pixels, int pitch)
942
+ {
943
+ SDL_Renderer *renderer;
944
+ SDL_Rect full_rect;
945
+
946
+ CHECK_TEXTURE_MAGIC(texture, -1);
947
+
948
+ if (!pixels) {
949
+ return SDL_InvalidParamError("pixels");
950
+ }
951
+ if (!pitch) {
952
+ return SDL_InvalidParamError("pitch");
953
+ }
954
+
955
+ if (!rect) {
956
+ full_rect.x = 0;
957
+ full_rect.y = 0;
958
+ full_rect.w = texture->w;
959
+ full_rect.h = texture->h;
960
+ rect = &full_rect;
961
+ }
962
+
963
+ if ((rect->w == 0) || (rect->h == 0)) {
964
+ return 0; /* nothing to do. */
965
+ } else if (texture->yuv) {
966
+ return SDL_UpdateTextureYUV(texture, rect, pixels, pitch);
967
+ } else if (texture->native) {
968
+ return SDL_UpdateTextureNative(texture, rect, pixels, pitch);
969
+ } else {
970
+ renderer = texture->renderer;
971
+ return renderer->UpdateTexture(renderer, texture, rect, pixels, pitch);
972
+ }
973
+ }
974
+
975
+ static int
976
+ SDL_UpdateTextureYUVPlanar(SDL_Texture * texture, const SDL_Rect * rect,
977
+ const Uint8 *Yplane, int Ypitch,
978
+ const Uint8 *Uplane, int Upitch,
979
+ const Uint8 *Vplane, int Vpitch)
980
+ {
981
+ SDL_Texture *native = texture->native;
982
+ SDL_Rect full_rect;
983
+
984
+ if (SDL_SW_UpdateYUVTexturePlanar(texture->yuv, rect, Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch) < 0) {
985
+ return -1;
986
+ }
987
+
988
+ full_rect.x = 0;
989
+ full_rect.y = 0;
990
+ full_rect.w = texture->w;
991
+ full_rect.h = texture->h;
992
+ rect = &full_rect;
993
+
994
+ if (!rect->w || !rect->h) {
995
+ return 0; /* nothing to do. */
996
+ }
997
+
998
+ if (texture->access == SDL_TEXTUREACCESS_STREAMING) {
999
+ /* We can lock the texture and copy to it */
1000
+ void *native_pixels = NULL;
1001
+ int native_pitch = 0;
1002
+
1003
+ if (SDL_LockTexture(native, rect, &native_pixels, &native_pitch) < 0) {
1004
+ return -1;
1005
+ }
1006
+ SDL_SW_CopyYUVToRGB(texture->yuv, rect, native->format,
1007
+ rect->w, rect->h, native_pixels, native_pitch);
1008
+ SDL_UnlockTexture(native);
1009
+ } else {
1010
+ /* Use a temporary buffer for updating */
1011
+ const int temp_pitch = (((rect->w * SDL_BYTESPERPIXEL(native->format)) + 3) & ~3);
1012
+ const size_t alloclen = rect->h * temp_pitch;
1013
+ if (alloclen > 0) {
1014
+ void *temp_pixels = SDL_malloc(alloclen);
1015
+ if (!temp_pixels) {
1016
+ return SDL_OutOfMemory();
1017
+ }
1018
+ SDL_SW_CopyYUVToRGB(texture->yuv, rect, native->format,
1019
+ rect->w, rect->h, temp_pixels, temp_pitch);
1020
+ SDL_UpdateTexture(native, rect, temp_pixels, temp_pitch);
1021
+ SDL_free(temp_pixels);
1022
+ }
1023
+ }
1024
+ return 0;
1025
+ }
1026
+
1027
+ int SDL_UpdateYUVTexture(SDL_Texture * texture, const SDL_Rect * rect,
1028
+ const Uint8 *Yplane, int Ypitch,
1029
+ const Uint8 *Uplane, int Upitch,
1030
+ const Uint8 *Vplane, int Vpitch)
1031
+ {
1032
+ SDL_Renderer *renderer;
1033
+ SDL_Rect full_rect;
1034
+
1035
+ CHECK_TEXTURE_MAGIC(texture, -1);
1036
+
1037
+ if (!Yplane) {
1038
+ return SDL_InvalidParamError("Yplane");
1039
+ }
1040
+ if (!Ypitch) {
1041
+ return SDL_InvalidParamError("Ypitch");
1042
+ }
1043
+ if (!Uplane) {
1044
+ return SDL_InvalidParamError("Uplane");
1045
+ }
1046
+ if (!Upitch) {
1047
+ return SDL_InvalidParamError("Upitch");
1048
+ }
1049
+ if (!Vplane) {
1050
+ return SDL_InvalidParamError("Vplane");
1051
+ }
1052
+ if (!Vpitch) {
1053
+ return SDL_InvalidParamError("Vpitch");
1054
+ }
1055
+
1056
+ if (texture->format != SDL_PIXELFORMAT_YV12 &&
1057
+ texture->format != SDL_PIXELFORMAT_IYUV) {
1058
+ return SDL_SetError("Texture format must by YV12 or IYUV");
1059
+ }
1060
+
1061
+ if (!rect) {
1062
+ full_rect.x = 0;
1063
+ full_rect.y = 0;
1064
+ full_rect.w = texture->w;
1065
+ full_rect.h = texture->h;
1066
+ rect = &full_rect;
1067
+ }
1068
+
1069
+ if (!rect->w || !rect->h) {
1070
+ return 0; /* nothing to do. */
1071
+ }
1072
+
1073
+ if (texture->yuv) {
1074
+ return SDL_UpdateTextureYUVPlanar(texture, rect, Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch);
1075
+ } else {
1076
+ SDL_assert(!texture->native);
1077
+ renderer = texture->renderer;
1078
+ SDL_assert(renderer->UpdateTextureYUV);
1079
+ if (renderer->UpdateTextureYUV) {
1080
+ return renderer->UpdateTextureYUV(renderer, texture, rect, Yplane, Ypitch, Uplane, Upitch, Vplane, Vpitch);
1081
+ } else {
1082
+ return SDL_Unsupported();
1083
+ }
1084
+ }
1085
+ }
1086
+
1087
+ static int
1088
+ SDL_LockTextureYUV(SDL_Texture * texture, const SDL_Rect * rect,
1089
+ void **pixels, int *pitch)
1090
+ {
1091
+ return SDL_SW_LockYUVTexture(texture->yuv, rect, pixels, pitch);
1092
+ }
1093
+
1094
+ static int
1095
+ SDL_LockTextureNative(SDL_Texture * texture, const SDL_Rect * rect,
1096
+ void **pixels, int *pitch)
1097
+ {
1098
+ texture->locked_rect = *rect;
1099
+ *pixels = (void *) ((Uint8 *) texture->pixels +
1100
+ rect->y * texture->pitch +
1101
+ rect->x * SDL_BYTESPERPIXEL(texture->format));
1102
+ *pitch = texture->pitch;
1103
+ return 0;
1104
+ }
1105
+
1106
+ int
1107
+ SDL_LockTexture(SDL_Texture * texture, const SDL_Rect * rect,
1108
+ void **pixels, int *pitch)
1109
+ {
1110
+ SDL_Renderer *renderer;
1111
+ SDL_Rect full_rect;
1112
+
1113
+ CHECK_TEXTURE_MAGIC(texture, -1);
1114
+
1115
+ if (texture->access != SDL_TEXTUREACCESS_STREAMING) {
1116
+ return SDL_SetError("SDL_LockTexture(): texture must be streaming");
1117
+ }
1118
+
1119
+ if (!rect) {
1120
+ full_rect.x = 0;
1121
+ full_rect.y = 0;
1122
+ full_rect.w = texture->w;
1123
+ full_rect.h = texture->h;
1124
+ rect = &full_rect;
1125
+ }
1126
+
1127
+ if (texture->yuv) {
1128
+ return SDL_LockTextureYUV(texture, rect, pixels, pitch);
1129
+ } else if (texture->native) {
1130
+ return SDL_LockTextureNative(texture, rect, pixels, pitch);
1131
+ } else {
1132
+ renderer = texture->renderer;
1133
+ return renderer->LockTexture(renderer, texture, rect, pixels, pitch);
1134
+ }
1135
+ }
1136
+
1137
+ static void
1138
+ SDL_UnlockTextureYUV(SDL_Texture * texture)
1139
+ {
1140
+ SDL_Texture *native = texture->native;
1141
+ void *native_pixels = NULL;
1142
+ int native_pitch = 0;
1143
+ SDL_Rect rect;
1144
+
1145
+ rect.x = 0;
1146
+ rect.y = 0;
1147
+ rect.w = texture->w;
1148
+ rect.h = texture->h;
1149
+
1150
+ if (SDL_LockTexture(native, &rect, &native_pixels, &native_pitch) < 0) {
1151
+ return;
1152
+ }
1153
+ SDL_SW_CopyYUVToRGB(texture->yuv, &rect, native->format,
1154
+ rect.w, rect.h, native_pixels, native_pitch);
1155
+ SDL_UnlockTexture(native);
1156
+ }
1157
+
1158
+ static void
1159
+ SDL_UnlockTextureNative(SDL_Texture * texture)
1160
+ {
1161
+ SDL_Texture *native = texture->native;
1162
+ void *native_pixels = NULL;
1163
+ int native_pitch = 0;
1164
+ const SDL_Rect *rect = &texture->locked_rect;
1165
+ const void* pixels = (void *) ((Uint8 *) texture->pixels +
1166
+ rect->y * texture->pitch +
1167
+ rect->x * SDL_BYTESPERPIXEL(texture->format));
1168
+ int pitch = texture->pitch;
1169
+
1170
+ if (SDL_LockTexture(native, rect, &native_pixels, &native_pitch) < 0) {
1171
+ return;
1172
+ }
1173
+ SDL_ConvertPixels(rect->w, rect->h,
1174
+ texture->format, pixels, pitch,
1175
+ native->format, native_pixels, native_pitch);
1176
+ SDL_UnlockTexture(native);
1177
+ }
1178
+
1179
+ void
1180
+ SDL_UnlockTexture(SDL_Texture * texture)
1181
+ {
1182
+ SDL_Renderer *renderer;
1183
+
1184
+ CHECK_TEXTURE_MAGIC(texture, );
1185
+
1186
+ if (texture->access != SDL_TEXTUREACCESS_STREAMING) {
1187
+ return;
1188
+ }
1189
+ if (texture->yuv) {
1190
+ SDL_UnlockTextureYUV(texture);
1191
+ } else if (texture->native) {
1192
+ SDL_UnlockTextureNative(texture);
1193
+ } else {
1194
+ renderer = texture->renderer;
1195
+ renderer->UnlockTexture(renderer, texture);
1196
+ }
1197
+ }
1198
+
1199
+ SDL_bool
1200
+ SDL_RenderTargetSupported(SDL_Renderer *renderer)
1201
+ {
1202
+ if (!renderer || !renderer->SetRenderTarget) {
1203
+ return SDL_FALSE;
1204
+ }
1205
+ return (renderer->info.flags & SDL_RENDERER_TARGETTEXTURE) != 0;
1206
+ }
1207
+
1208
+ int
1209
+ SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture)
1210
+ {
1211
+ if (!SDL_RenderTargetSupported(renderer)) {
1212
+ return SDL_Unsupported();
1213
+ }
1214
+ if (texture == renderer->target) {
1215
+ /* Nothing to do! */
1216
+ return 0;
1217
+ }
1218
+
1219
+ /* texture == NULL is valid and means reset the target to the window */
1220
+ if (texture) {
1221
+ CHECK_TEXTURE_MAGIC(texture, -1);
1222
+ if (renderer != texture->renderer) {
1223
+ return SDL_SetError("Texture was not created with this renderer");
1224
+ }
1225
+ if (texture->access != SDL_TEXTUREACCESS_TARGET) {
1226
+ return SDL_SetError("Texture not created with SDL_TEXTUREACCESS_TARGET");
1227
+ }
1228
+ if (texture->native) {
1229
+ /* Always render to the native texture */
1230
+ texture = texture->native;
1231
+ }
1232
+ }
1233
+
1234
+ SDL_LockMutex(renderer->target_mutex);
1235
+
1236
+ if (texture && !renderer->target) {
1237
+ /* Make a backup of the viewport */
1238
+ renderer->viewport_backup = renderer->viewport;
1239
+ renderer->clip_rect_backup = renderer->clip_rect;
1240
+ renderer->clipping_enabled_backup = renderer->clipping_enabled;
1241
+ renderer->scale_backup = renderer->scale;
1242
+ renderer->logical_w_backup = renderer->logical_w;
1243
+ renderer->logical_h_backup = renderer->logical_h;
1244
+ }
1245
+ renderer->target = texture;
1246
+
1247
+ if (renderer->SetRenderTarget(renderer, texture) < 0) {
1248
+ SDL_UnlockMutex(renderer->target_mutex);
1249
+ return -1;
1250
+ }
1251
+
1252
+ if (texture) {
1253
+ renderer->viewport.x = 0;
1254
+ renderer->viewport.y = 0;
1255
+ renderer->viewport.w = texture->w;
1256
+ renderer->viewport.h = texture->h;
1257
+ SDL_zero(renderer->clip_rect);
1258
+ renderer->clipping_enabled = SDL_FALSE;
1259
+ renderer->scale.x = 1.0f;
1260
+ renderer->scale.y = 1.0f;
1261
+ renderer->logical_w = texture->w;
1262
+ renderer->logical_h = texture->h;
1263
+ } else {
1264
+ renderer->viewport = renderer->viewport_backup;
1265
+ renderer->clip_rect = renderer->clip_rect_backup;
1266
+ renderer->clipping_enabled = renderer->clipping_enabled_backup;
1267
+ renderer->scale = renderer->scale_backup;
1268
+ renderer->logical_w = renderer->logical_w_backup;
1269
+ renderer->logical_h = renderer->logical_h_backup;
1270
+ }
1271
+
1272
+ SDL_UnlockMutex(renderer->target_mutex);
1273
+
1274
+ if (renderer->UpdateViewport(renderer) < 0) {
1275
+ return -1;
1276
+ }
1277
+ if (renderer->UpdateClipRect(renderer) < 0) {
1278
+ return -1;
1279
+ }
1280
+
1281
+ /* All set! */
1282
+ return 0;
1283
+ }
1284
+
1285
+ SDL_Texture *
1286
+ SDL_GetRenderTarget(SDL_Renderer *renderer)
1287
+ {
1288
+ return renderer->target;
1289
+ }
1290
+
1291
+ static int
1292
+ UpdateLogicalSize(SDL_Renderer *renderer)
1293
+ {
1294
+ int w = 1, h = 1;
1295
+ float want_aspect;
1296
+ float real_aspect;
1297
+ float scale;
1298
+ SDL_Rect viewport;
1299
+ /* 0 is for letterbox, 1 is for overscan */
1300
+ int scale_policy = 0;
1301
+ const char *hint;
1302
+
1303
+ if (!renderer->logical_w || !renderer->logical_h) {
1304
+ return 0;
1305
+ }
1306
+ if (SDL_GetRendererOutputSize(renderer, &w, &h) < 0) {
1307
+ return -1;
1308
+ }
1309
+
1310
+ hint = SDL_GetHint(SDL_HINT_RENDER_LOGICAL_SIZE_MODE);
1311
+ if (hint && (*hint == '1' || SDL_strcasecmp(hint, "overscan") == 0)) {
1312
+ #if SDL_VIDEO_RENDER_D3D
1313
+ SDL_bool overscan_supported = SDL_TRUE;
1314
+ /* Unfortunately, Direct3D 9 doesn't support negative viewport numbers
1315
+ which the overscan implementation relies on.
1316
+ */
1317
+ if (SDL_strcasecmp(SDL_GetCurrentVideoDriver(), "direct3d") == 0) {
1318
+ overscan_supported = SDL_FALSE;
1319
+ }
1320
+ if (overscan_supported) {
1321
+ scale_policy = 1;
1322
+ }
1323
+ #else
1324
+ scale_policy = 1;
1325
+ #endif
1326
+ }
1327
+
1328
+ want_aspect = (float)renderer->logical_w / renderer->logical_h;
1329
+ real_aspect = (float)w / h;
1330
+
1331
+ /* Clear the scale because we're setting viewport in output coordinates */
1332
+ SDL_RenderSetScale(renderer, 1.0f, 1.0f);
1333
+
1334
+ if (renderer->integer_scale) {
1335
+ if (want_aspect > real_aspect) {
1336
+ scale = (float)(w / renderer->logical_w);
1337
+ } else {
1338
+ scale = (float)(h / renderer->logical_h);
1339
+ }
1340
+ viewport.w = (int)SDL_ceil(renderer->logical_w * scale);
1341
+ viewport.x = (w - viewport.w) / 2;
1342
+ viewport.h = (int)SDL_ceil(renderer->logical_h * scale);
1343
+ viewport.y = (h - viewport.h) / 2;
1344
+
1345
+ SDL_RenderSetViewport(renderer, &viewport);
1346
+ } else if (SDL_fabs(want_aspect-real_aspect) < 0.0001) {
1347
+ /* The aspect ratios are the same, just scale appropriately */
1348
+ scale = (float)w / renderer->logical_w;
1349
+ SDL_RenderSetViewport(renderer, NULL);
1350
+ } else if (want_aspect > real_aspect) {
1351
+ if (scale_policy == 1) {
1352
+ /* We want a wider aspect ratio than is available -
1353
+ zoom so logical height matches the real height
1354
+ and the width will grow off the screen
1355
+ */
1356
+ scale = (float)h / renderer->logical_h;
1357
+ viewport.y = 0;
1358
+ viewport.h = h;
1359
+ viewport.w = (int)SDL_ceil(renderer->logical_w * scale);
1360
+ viewport.x = (w - viewport.w) / 2;
1361
+ SDL_RenderSetViewport(renderer, &viewport);
1362
+ } else {
1363
+ /* We want a wider aspect ratio than is available - letterbox it */
1364
+ scale = (float)w / renderer->logical_w;
1365
+ viewport.x = 0;
1366
+ viewport.w = w;
1367
+ viewport.h = (int)SDL_ceil(renderer->logical_h * scale);
1368
+ viewport.y = (h - viewport.h) / 2;
1369
+ SDL_RenderSetViewport(renderer, &viewport);
1370
+ }
1371
+ } else {
1372
+ if (scale_policy == 1) {
1373
+ /* We want a narrower aspect ratio than is available -
1374
+ zoom so logical width matches the real width
1375
+ and the height will grow off the screen
1376
+ */
1377
+ scale = (float)w / renderer->logical_w;
1378
+ viewport.x = 0;
1379
+ viewport.w = w;
1380
+ viewport.h = (int)SDL_ceil(renderer->logical_h * scale);
1381
+ viewport.y = (h - viewport.h) / 2;
1382
+ SDL_RenderSetViewport(renderer, &viewport);
1383
+ } else {
1384
+ /* We want a narrower aspect ratio than is available - use side-bars */
1385
+ scale = (float)h / renderer->logical_h;
1386
+ viewport.y = 0;
1387
+ viewport.h = h;
1388
+ viewport.w = (int)SDL_ceil(renderer->logical_w * scale);
1389
+ viewport.x = (w - viewport.w) / 2;
1390
+ SDL_RenderSetViewport(renderer, &viewport);
1391
+ }
1392
+ }
1393
+
1394
+ /* Set the new scale */
1395
+ SDL_RenderSetScale(renderer, scale, scale);
1396
+
1397
+ return 0;
1398
+ }
1399
+
1400
+ int
1401
+ SDL_RenderSetLogicalSize(SDL_Renderer * renderer, int w, int h)
1402
+ {
1403
+ CHECK_RENDERER_MAGIC(renderer, -1);
1404
+
1405
+ if (!w || !h) {
1406
+ /* Clear any previous logical resolution */
1407
+ renderer->logical_w = 0;
1408
+ renderer->logical_h = 0;
1409
+ SDL_RenderSetViewport(renderer, NULL);
1410
+ SDL_RenderSetScale(renderer, 1.0f, 1.0f);
1411
+ return 0;
1412
+ }
1413
+
1414
+ renderer->logical_w = w;
1415
+ renderer->logical_h = h;
1416
+
1417
+ return UpdateLogicalSize(renderer);
1418
+ }
1419
+
1420
+ void
1421
+ SDL_RenderGetLogicalSize(SDL_Renderer * renderer, int *w, int *h)
1422
+ {
1423
+ CHECK_RENDERER_MAGIC(renderer, );
1424
+
1425
+ if (w) {
1426
+ *w = renderer->logical_w;
1427
+ }
1428
+ if (h) {
1429
+ *h = renderer->logical_h;
1430
+ }
1431
+ }
1432
+
1433
+ int
1434
+ SDL_RenderSetIntegerScale(SDL_Renderer * renderer, SDL_bool enable)
1435
+ {
1436
+ CHECK_RENDERER_MAGIC(renderer, -1);
1437
+
1438
+ renderer->integer_scale = enable;
1439
+
1440
+ return UpdateLogicalSize(renderer);
1441
+ }
1442
+
1443
+ SDL_bool
1444
+ SDLCALL SDL_RenderGetIntegerScale(SDL_Renderer * renderer)
1445
+ {
1446
+ CHECK_RENDERER_MAGIC(renderer, SDL_FALSE);
1447
+
1448
+ return renderer->integer_scale;
1449
+ }
1450
+
1451
+ int
1452
+ SDL_RenderSetViewport(SDL_Renderer * renderer, const SDL_Rect * rect)
1453
+ {
1454
+ CHECK_RENDERER_MAGIC(renderer, -1);
1455
+
1456
+ if (rect) {
1457
+ renderer->viewport.x = (int)SDL_floor(rect->x * renderer->scale.x);
1458
+ renderer->viewport.y = (int)SDL_floor(rect->y * renderer->scale.y);
1459
+ renderer->viewport.w = (int)SDL_ceil(rect->w * renderer->scale.x);
1460
+ renderer->viewport.h = (int)SDL_ceil(rect->h * renderer->scale.y);
1461
+ } else {
1462
+ renderer->viewport.x = 0;
1463
+ renderer->viewport.y = 0;
1464
+ if (SDL_GetRendererOutputSize(renderer, &renderer->viewport.w, &renderer->viewport.h) < 0) {
1465
+ return -1;
1466
+ }
1467
+ }
1468
+ return renderer->UpdateViewport(renderer);
1469
+ }
1470
+
1471
+ void
1472
+ SDL_RenderGetViewport(SDL_Renderer * renderer, SDL_Rect * rect)
1473
+ {
1474
+ CHECK_RENDERER_MAGIC(renderer, );
1475
+
1476
+ if (rect) {
1477
+ rect->x = (int)(renderer->viewport.x / renderer->scale.x);
1478
+ rect->y = (int)(renderer->viewport.y / renderer->scale.y);
1479
+ rect->w = (int)(renderer->viewport.w / renderer->scale.x);
1480
+ rect->h = (int)(renderer->viewport.h / renderer->scale.y);
1481
+ }
1482
+ }
1483
+
1484
+ int
1485
+ SDL_RenderSetClipRect(SDL_Renderer * renderer, const SDL_Rect * rect)
1486
+ {
1487
+ CHECK_RENDERER_MAGIC(renderer, -1)
1488
+
1489
+ if (rect) {
1490
+ renderer->clipping_enabled = SDL_TRUE;
1491
+ renderer->clip_rect.x = (int)SDL_floor(rect->x * renderer->scale.x);
1492
+ renderer->clip_rect.y = (int)SDL_floor(rect->y * renderer->scale.y);
1493
+ renderer->clip_rect.w = (int)SDL_ceil(rect->w * renderer->scale.x);
1494
+ renderer->clip_rect.h = (int)SDL_ceil(rect->h * renderer->scale.y);
1495
+ } else {
1496
+ renderer->clipping_enabled = SDL_FALSE;
1497
+ SDL_zero(renderer->clip_rect);
1498
+ }
1499
+ return renderer->UpdateClipRect(renderer);
1500
+ }
1501
+
1502
+ void
1503
+ SDL_RenderGetClipRect(SDL_Renderer * renderer, SDL_Rect * rect)
1504
+ {
1505
+ CHECK_RENDERER_MAGIC(renderer, )
1506
+
1507
+ if (rect) {
1508
+ rect->x = (int)(renderer->clip_rect.x / renderer->scale.x);
1509
+ rect->y = (int)(renderer->clip_rect.y / renderer->scale.y);
1510
+ rect->w = (int)(renderer->clip_rect.w / renderer->scale.x);
1511
+ rect->h = (int)(renderer->clip_rect.h / renderer->scale.y);
1512
+ }
1513
+ }
1514
+
1515
+ SDL_bool
1516
+ SDL_RenderIsClipEnabled(SDL_Renderer * renderer)
1517
+ {
1518
+ CHECK_RENDERER_MAGIC(renderer, SDL_FALSE)
1519
+ return renderer->clipping_enabled;
1520
+ }
1521
+
1522
+ int
1523
+ SDL_RenderSetScale(SDL_Renderer * renderer, float scaleX, float scaleY)
1524
+ {
1525
+ CHECK_RENDERER_MAGIC(renderer, -1);
1526
+
1527
+ renderer->scale.x = scaleX;
1528
+ renderer->scale.y = scaleY;
1529
+ return 0;
1530
+ }
1531
+
1532
+ void
1533
+ SDL_RenderGetScale(SDL_Renderer * renderer, float *scaleX, float *scaleY)
1534
+ {
1535
+ CHECK_RENDERER_MAGIC(renderer, );
1536
+
1537
+ if (scaleX) {
1538
+ *scaleX = renderer->scale.x;
1539
+ }
1540
+ if (scaleY) {
1541
+ *scaleY = renderer->scale.y;
1542
+ }
1543
+ }
1544
+
1545
+ int
1546
+ SDL_SetRenderDrawColor(SDL_Renderer * renderer,
1547
+ Uint8 r, Uint8 g, Uint8 b, Uint8 a)
1548
+ {
1549
+ CHECK_RENDERER_MAGIC(renderer, -1);
1550
+
1551
+ renderer->r = r;
1552
+ renderer->g = g;
1553
+ renderer->b = b;
1554
+ renderer->a = a;
1555
+ return 0;
1556
+ }
1557
+
1558
+ int
1559
+ SDL_GetRenderDrawColor(SDL_Renderer * renderer,
1560
+ Uint8 * r, Uint8 * g, Uint8 * b, Uint8 * a)
1561
+ {
1562
+ CHECK_RENDERER_MAGIC(renderer, -1);
1563
+
1564
+ if (r) {
1565
+ *r = renderer->r;
1566
+ }
1567
+ if (g) {
1568
+ *g = renderer->g;
1569
+ }
1570
+ if (b) {
1571
+ *b = renderer->b;
1572
+ }
1573
+ if (a) {
1574
+ *a = renderer->a;
1575
+ }
1576
+ return 0;
1577
+ }
1578
+
1579
+ int
1580
+ SDL_SetRenderDrawBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode)
1581
+ {
1582
+ CHECK_RENDERER_MAGIC(renderer, -1);
1583
+
1584
+ if (!IsSupportedBlendMode(renderer, blendMode)) {
1585
+ return SDL_Unsupported();
1586
+ }
1587
+ renderer->blendMode = blendMode;
1588
+ return 0;
1589
+ }
1590
+
1591
+ int
1592
+ SDL_GetRenderDrawBlendMode(SDL_Renderer * renderer, SDL_BlendMode *blendMode)
1593
+ {
1594
+ CHECK_RENDERER_MAGIC(renderer, -1);
1595
+
1596
+ *blendMode = renderer->blendMode;
1597
+ return 0;
1598
+ }
1599
+
1600
+ int
1601
+ SDL_RenderClear(SDL_Renderer * renderer)
1602
+ {
1603
+ CHECK_RENDERER_MAGIC(renderer, -1);
1604
+
1605
+ /* Don't draw while we're hidden */
1606
+ if (renderer->hidden) {
1607
+ return 0;
1608
+ }
1609
+ return renderer->RenderClear(renderer);
1610
+ }
1611
+
1612
+ int
1613
+ SDL_RenderDrawPoint(SDL_Renderer * renderer, int x, int y)
1614
+ {
1615
+ SDL_Point point;
1616
+
1617
+ point.x = x;
1618
+ point.y = y;
1619
+ return SDL_RenderDrawPoints(renderer, &point, 1);
1620
+ }
1621
+
1622
+ static int
1623
+ RenderDrawPointsWithRects(SDL_Renderer * renderer,
1624
+ const SDL_Point * points, int count)
1625
+ {
1626
+ SDL_FRect *frects;
1627
+ int i;
1628
+ int status;
1629
+
1630
+ frects = SDL_stack_alloc(SDL_FRect, count);
1631
+ if (!frects) {
1632
+ return SDL_OutOfMemory();
1633
+ }
1634
+ for (i = 0; i < count; ++i) {
1635
+ frects[i].x = points[i].x * renderer->scale.x;
1636
+ frects[i].y = points[i].y * renderer->scale.y;
1637
+ frects[i].w = renderer->scale.x;
1638
+ frects[i].h = renderer->scale.y;
1639
+ }
1640
+
1641
+ status = renderer->RenderFillRects(renderer, frects, count);
1642
+
1643
+ SDL_stack_free(frects);
1644
+
1645
+ return status;
1646
+ }
1647
+
1648
+ int
1649
+ SDL_RenderDrawPoints(SDL_Renderer * renderer,
1650
+ const SDL_Point * points, int count)
1651
+ {
1652
+ SDL_FPoint *fpoints;
1653
+ int i;
1654
+ int status;
1655
+
1656
+ CHECK_RENDERER_MAGIC(renderer, -1);
1657
+
1658
+ if (!points) {
1659
+ return SDL_SetError("SDL_RenderDrawPoints(): Passed NULL points");
1660
+ }
1661
+ if (count < 1) {
1662
+ return 0;
1663
+ }
1664
+
1665
+ /* Don't draw while we're hidden */
1666
+ if (renderer->hidden) {
1667
+ return 0;
1668
+ }
1669
+
1670
+ if (renderer->scale.x != 1.0f || renderer->scale.y != 1.0f) {
1671
+ return RenderDrawPointsWithRects(renderer, points, count);
1672
+ }
1673
+
1674
+ fpoints = SDL_stack_alloc(SDL_FPoint, count);
1675
+ if (!fpoints) {
1676
+ return SDL_OutOfMemory();
1677
+ }
1678
+ for (i = 0; i < count; ++i) {
1679
+ fpoints[i].x = points[i].x * renderer->scale.x;
1680
+ fpoints[i].y = points[i].y * renderer->scale.y;
1681
+ }
1682
+
1683
+ status = renderer->RenderDrawPoints(renderer, fpoints, count);
1684
+
1685
+ SDL_stack_free(fpoints);
1686
+
1687
+ return status;
1688
+ }
1689
+
1690
+ int
1691
+ SDL_RenderDrawLine(SDL_Renderer * renderer, int x1, int y1, int x2, int y2)
1692
+ {
1693
+ SDL_Point points[2];
1694
+
1695
+ points[0].x = x1;
1696
+ points[0].y = y1;
1697
+ points[1].x = x2;
1698
+ points[1].y = y2;
1699
+ return SDL_RenderDrawLines(renderer, points, 2);
1700
+ }
1701
+
1702
+ static int
1703
+ RenderDrawLinesWithRects(SDL_Renderer * renderer,
1704
+ const SDL_Point * points, int count)
1705
+ {
1706
+ SDL_FRect *frect;
1707
+ SDL_FRect *frects;
1708
+ SDL_FPoint fpoints[2];
1709
+ int i, nrects;
1710
+ int status;
1711
+
1712
+ frects = SDL_stack_alloc(SDL_FRect, count-1);
1713
+ if (!frects) {
1714
+ return SDL_OutOfMemory();
1715
+ }
1716
+
1717
+ status = 0;
1718
+ nrects = 0;
1719
+ for (i = 0; i < count-1; ++i) {
1720
+ if (points[i].x == points[i+1].x) {
1721
+ int minY = SDL_min(points[i].y, points[i+1].y);
1722
+ int maxY = SDL_max(points[i].y, points[i+1].y);
1723
+
1724
+ frect = &frects[nrects++];
1725
+ frect->x = points[i].x * renderer->scale.x;
1726
+ frect->y = minY * renderer->scale.y;
1727
+ frect->w = renderer->scale.x;
1728
+ frect->h = (maxY - minY + 1) * renderer->scale.y;
1729
+ } else if (points[i].y == points[i+1].y) {
1730
+ int minX = SDL_min(points[i].x, points[i+1].x);
1731
+ int maxX = SDL_max(points[i].x, points[i+1].x);
1732
+
1733
+ frect = &frects[nrects++];
1734
+ frect->x = minX * renderer->scale.x;
1735
+ frect->y = points[i].y * renderer->scale.y;
1736
+ frect->w = (maxX - minX + 1) * renderer->scale.x;
1737
+ frect->h = renderer->scale.y;
1738
+ } else {
1739
+ /* FIXME: We can't use a rect for this line... */
1740
+ fpoints[0].x = points[i].x * renderer->scale.x;
1741
+ fpoints[0].y = points[i].y * renderer->scale.y;
1742
+ fpoints[1].x = points[i+1].x * renderer->scale.x;
1743
+ fpoints[1].y = points[i+1].y * renderer->scale.y;
1744
+ status += renderer->RenderDrawLines(renderer, fpoints, 2);
1745
+ }
1746
+ }
1747
+
1748
+ status += renderer->RenderFillRects(renderer, frects, nrects);
1749
+
1750
+ SDL_stack_free(frects);
1751
+
1752
+ if (status < 0) {
1753
+ status = -1;
1754
+ }
1755
+ return status;
1756
+ }
1757
+
1758
+ int
1759
+ SDL_RenderDrawLines(SDL_Renderer * renderer,
1760
+ const SDL_Point * points, int count)
1761
+ {
1762
+ SDL_FPoint *fpoints;
1763
+ int i;
1764
+ int status;
1765
+
1766
+ CHECK_RENDERER_MAGIC(renderer, -1);
1767
+
1768
+ if (!points) {
1769
+ return SDL_SetError("SDL_RenderDrawLines(): Passed NULL points");
1770
+ }
1771
+ if (count < 2) {
1772
+ return 0;
1773
+ }
1774
+
1775
+ /* Don't draw while we're hidden */
1776
+ if (renderer->hidden) {
1777
+ return 0;
1778
+ }
1779
+
1780
+ if (renderer->scale.x != 1.0f || renderer->scale.y != 1.0f) {
1781
+ return RenderDrawLinesWithRects(renderer, points, count);
1782
+ }
1783
+
1784
+ fpoints = SDL_stack_alloc(SDL_FPoint, count);
1785
+ if (!fpoints) {
1786
+ return SDL_OutOfMemory();
1787
+ }
1788
+ for (i = 0; i < count; ++i) {
1789
+ fpoints[i].x = points[i].x * renderer->scale.x;
1790
+ fpoints[i].y = points[i].y * renderer->scale.y;
1791
+ }
1792
+
1793
+ status = renderer->RenderDrawLines(renderer, fpoints, count);
1794
+
1795
+ SDL_stack_free(fpoints);
1796
+
1797
+ return status;
1798
+ }
1799
+
1800
+ int
1801
+ SDL_RenderDrawRect(SDL_Renderer * renderer, const SDL_Rect * rect)
1802
+ {
1803
+ SDL_Rect full_rect;
1804
+ SDL_Point points[5];
1805
+
1806
+ CHECK_RENDERER_MAGIC(renderer, -1);
1807
+
1808
+ /* If 'rect' == NULL, then outline the whole surface */
1809
+ if (!rect) {
1810
+ SDL_RenderGetViewport(renderer, &full_rect);
1811
+ full_rect.x = 0;
1812
+ full_rect.y = 0;
1813
+ rect = &full_rect;
1814
+ }
1815
+
1816
+ points[0].x = rect->x;
1817
+ points[0].y = rect->y;
1818
+ points[1].x = rect->x+rect->w-1;
1819
+ points[1].y = rect->y;
1820
+ points[2].x = rect->x+rect->w-1;
1821
+ points[2].y = rect->y+rect->h-1;
1822
+ points[3].x = rect->x;
1823
+ points[3].y = rect->y+rect->h-1;
1824
+ points[4].x = rect->x;
1825
+ points[4].y = rect->y;
1826
+ return SDL_RenderDrawLines(renderer, points, 5);
1827
+ }
1828
+
1829
+ int
1830
+ SDL_RenderDrawRects(SDL_Renderer * renderer,
1831
+ const SDL_Rect * rects, int count)
1832
+ {
1833
+ int i;
1834
+
1835
+ CHECK_RENDERER_MAGIC(renderer, -1);
1836
+
1837
+ if (!rects) {
1838
+ return SDL_SetError("SDL_RenderDrawRects(): Passed NULL rects");
1839
+ }
1840
+ if (count < 1) {
1841
+ return 0;
1842
+ }
1843
+
1844
+ /* Don't draw while we're hidden */
1845
+ if (renderer->hidden) {
1846
+ return 0;
1847
+ }
1848
+
1849
+ for (i = 0; i < count; ++i) {
1850
+ if (SDL_RenderDrawRect(renderer, &rects[i]) < 0) {
1851
+ return -1;
1852
+ }
1853
+ }
1854
+ return 0;
1855
+ }
1856
+
1857
+ int
1858
+ SDL_RenderFillRect(SDL_Renderer * renderer, const SDL_Rect * rect)
1859
+ {
1860
+ SDL_Rect full_rect = { 0, 0, 0, 0 };
1861
+
1862
+ CHECK_RENDERER_MAGIC(renderer, -1);
1863
+
1864
+ /* If 'rect' == NULL, then outline the whole surface */
1865
+ if (!rect) {
1866
+ SDL_RenderGetViewport(renderer, &full_rect);
1867
+ full_rect.x = 0;
1868
+ full_rect.y = 0;
1869
+ rect = &full_rect;
1870
+ }
1871
+ return SDL_RenderFillRects(renderer, rect, 1);
1872
+ }
1873
+
1874
+ int
1875
+ SDL_RenderFillRects(SDL_Renderer * renderer,
1876
+ const SDL_Rect * rects, int count)
1877
+ {
1878
+ SDL_FRect *frects;
1879
+ int i;
1880
+ int status;
1881
+
1882
+ CHECK_RENDERER_MAGIC(renderer, -1);
1883
+
1884
+ if (!rects) {
1885
+ return SDL_SetError("SDL_RenderFillRects(): Passed NULL rects");
1886
+ }
1887
+ if (count < 1) {
1888
+ return 0;
1889
+ }
1890
+
1891
+ /* Don't draw while we're hidden */
1892
+ if (renderer->hidden) {
1893
+ return 0;
1894
+ }
1895
+
1896
+ frects = SDL_stack_alloc(SDL_FRect, count);
1897
+ if (!frects) {
1898
+ return SDL_OutOfMemory();
1899
+ }
1900
+ for (i = 0; i < count; ++i) {
1901
+ frects[i].x = rects[i].x * renderer->scale.x;
1902
+ frects[i].y = rects[i].y * renderer->scale.y;
1903
+ frects[i].w = rects[i].w * renderer->scale.x;
1904
+ frects[i].h = rects[i].h * renderer->scale.y;
1905
+ }
1906
+
1907
+ status = renderer->RenderFillRects(renderer, frects, count);
1908
+
1909
+ SDL_stack_free(frects);
1910
+
1911
+ return status;
1912
+ }
1913
+
1914
+ int
1915
+ SDL_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
1916
+ const SDL_Rect * srcrect, const SDL_Rect * dstrect)
1917
+ {
1918
+ SDL_Rect real_srcrect = { 0, 0, 0, 0 };
1919
+ SDL_Rect real_dstrect = { 0, 0, 0, 0 };
1920
+ SDL_FRect frect;
1921
+
1922
+ CHECK_RENDERER_MAGIC(renderer, -1);
1923
+ CHECK_TEXTURE_MAGIC(texture, -1);
1924
+
1925
+ if (renderer != texture->renderer) {
1926
+ return SDL_SetError("Texture was not created with this renderer");
1927
+ }
1928
+
1929
+ /* Don't draw while we're hidden */
1930
+ if (renderer->hidden) {
1931
+ return 0;
1932
+ }
1933
+
1934
+ real_srcrect.x = 0;
1935
+ real_srcrect.y = 0;
1936
+ real_srcrect.w = texture->w;
1937
+ real_srcrect.h = texture->h;
1938
+ if (srcrect) {
1939
+ if (!SDL_IntersectRect(srcrect, &real_srcrect, &real_srcrect)) {
1940
+ return 0;
1941
+ }
1942
+ }
1943
+
1944
+ SDL_RenderGetViewport(renderer, &real_dstrect);
1945
+ real_dstrect.x = 0;
1946
+ real_dstrect.y = 0;
1947
+ if (dstrect) {
1948
+ if (!SDL_HasIntersection(dstrect, &real_dstrect)) {
1949
+ return 0;
1950
+ }
1951
+ real_dstrect = *dstrect;
1952
+ }
1953
+
1954
+ if (texture->native) {
1955
+ texture = texture->native;
1956
+ }
1957
+
1958
+ frect.x = real_dstrect.x * renderer->scale.x;
1959
+ frect.y = real_dstrect.y * renderer->scale.y;
1960
+ frect.w = real_dstrect.w * renderer->scale.x;
1961
+ frect.h = real_dstrect.h * renderer->scale.y;
1962
+
1963
+ return renderer->RenderCopy(renderer, texture, &real_srcrect, &frect);
1964
+ }
1965
+
1966
+
1967
+ int
1968
+ SDL_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture,
1969
+ const SDL_Rect * srcrect, const SDL_Rect * dstrect,
1970
+ const double angle, const SDL_Point *center, const SDL_RendererFlip flip)
1971
+ {
1972
+ SDL_Rect real_srcrect = { 0, 0, 0, 0 };
1973
+ SDL_Rect real_dstrect = { 0, 0, 0, 0 };
1974
+ SDL_Point real_center;
1975
+ SDL_FRect frect;
1976
+ SDL_FPoint fcenter;
1977
+
1978
+ if (flip == SDL_FLIP_NONE && (int)(angle/360) == angle/360) { /* fast path when we don't need rotation or flipping */
1979
+ return SDL_RenderCopy(renderer, texture, srcrect, dstrect);
1980
+ }
1981
+
1982
+ CHECK_RENDERER_MAGIC(renderer, -1);
1983
+ CHECK_TEXTURE_MAGIC(texture, -1);
1984
+
1985
+ if (renderer != texture->renderer) {
1986
+ return SDL_SetError("Texture was not created with this renderer");
1987
+ }
1988
+ if (!renderer->RenderCopyEx) {
1989
+ return SDL_SetError("Renderer does not support RenderCopyEx");
1990
+ }
1991
+
1992
+ /* Don't draw while we're hidden */
1993
+ if (renderer->hidden) {
1994
+ return 0;
1995
+ }
1996
+
1997
+ real_srcrect.x = 0;
1998
+ real_srcrect.y = 0;
1999
+ real_srcrect.w = texture->w;
2000
+ real_srcrect.h = texture->h;
2001
+ if (srcrect) {
2002
+ if (!SDL_IntersectRect(srcrect, &real_srcrect, &real_srcrect)) {
2003
+ return 0;
2004
+ }
2005
+ }
2006
+
2007
+ /* We don't intersect the dstrect with the viewport as RenderCopy does because of potential rotation clipping issues... TODO: should we? */
2008
+ if (dstrect) {
2009
+ real_dstrect = *dstrect;
2010
+ } else {
2011
+ SDL_RenderGetViewport(renderer, &real_dstrect);
2012
+ real_dstrect.x = 0;
2013
+ real_dstrect.y = 0;
2014
+ }
2015
+
2016
+ if (texture->native) {
2017
+ texture = texture->native;
2018
+ }
2019
+
2020
+ if (center) {
2021
+ real_center = *center;
2022
+ } else {
2023
+ real_center.x = real_dstrect.w/2;
2024
+ real_center.y = real_dstrect.h/2;
2025
+ }
2026
+
2027
+ frect.x = real_dstrect.x * renderer->scale.x;
2028
+ frect.y = real_dstrect.y * renderer->scale.y;
2029
+ frect.w = real_dstrect.w * renderer->scale.x;
2030
+ frect.h = real_dstrect.h * renderer->scale.y;
2031
+
2032
+ fcenter.x = real_center.x * renderer->scale.x;
2033
+ fcenter.y = real_center.y * renderer->scale.y;
2034
+
2035
+ return renderer->RenderCopyEx(renderer, texture, &real_srcrect, &frect, angle, &fcenter, flip);
2036
+ }
2037
+
2038
+ int
2039
+ SDL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
2040
+ Uint32 format, void * pixels, int pitch)
2041
+ {
2042
+ SDL_Rect real_rect;
2043
+
2044
+ CHECK_RENDERER_MAGIC(renderer, -1);
2045
+
2046
+ if (!renderer->RenderReadPixels) {
2047
+ return SDL_Unsupported();
2048
+ }
2049
+
2050
+ if (!format) {
2051
+ format = SDL_GetWindowPixelFormat(renderer->window);
2052
+ }
2053
+
2054
+ real_rect.x = renderer->viewport.x;
2055
+ real_rect.y = renderer->viewport.y;
2056
+ real_rect.w = renderer->viewport.w;
2057
+ real_rect.h = renderer->viewport.h;
2058
+ if (rect) {
2059
+ if (!SDL_IntersectRect(rect, &real_rect, &real_rect)) {
2060
+ return 0;
2061
+ }
2062
+ if (real_rect.y > rect->y) {
2063
+ pixels = (Uint8 *)pixels + pitch * (real_rect.y - rect->y);
2064
+ }
2065
+ if (real_rect.x > rect->x) {
2066
+ int bpp = SDL_BYTESPERPIXEL(format);
2067
+ pixels = (Uint8 *)pixels + bpp * (real_rect.x - rect->x);
2068
+ }
2069
+ }
2070
+
2071
+ return renderer->RenderReadPixels(renderer, &real_rect,
2072
+ format, pixels, pitch);
2073
+ }
2074
+
2075
+ void
2076
+ SDL_RenderPresent(SDL_Renderer * renderer)
2077
+ {
2078
+ CHECK_RENDERER_MAGIC(renderer, );
2079
+
2080
+ /* Don't draw while we're hidden */
2081
+ if (renderer->hidden) {
2082
+ return;
2083
+ }
2084
+ renderer->RenderPresent(renderer);
2085
+ }
2086
+
2087
+ void
2088
+ SDL_DestroyTexture(SDL_Texture * texture)
2089
+ {
2090
+ SDL_Renderer *renderer;
2091
+
2092
+ CHECK_TEXTURE_MAGIC(texture, );
2093
+
2094
+ renderer = texture->renderer;
2095
+ if (texture == renderer->target) {
2096
+ SDL_SetRenderTarget(renderer, NULL);
2097
+ }
2098
+
2099
+ texture->magic = NULL;
2100
+
2101
+ if (texture->next) {
2102
+ texture->next->prev = texture->prev;
2103
+ }
2104
+ if (texture->prev) {
2105
+ texture->prev->next = texture->next;
2106
+ } else {
2107
+ renderer->textures = texture->next;
2108
+ }
2109
+
2110
+ if (texture->native) {
2111
+ SDL_DestroyTexture(texture->native);
2112
+ }
2113
+ if (texture->yuv) {
2114
+ SDL_SW_DestroyYUVTexture(texture->yuv);
2115
+ }
2116
+ SDL_free(texture->pixels);
2117
+
2118
+ renderer->DestroyTexture(renderer, texture);
2119
+ SDL_free(texture);
2120
+ }
2121
+
2122
+ void
2123
+ SDL_DestroyRenderer(SDL_Renderer * renderer)
2124
+ {
2125
+ CHECK_RENDERER_MAGIC(renderer, );
2126
+
2127
+ SDL_DelEventWatch(SDL_RendererEventWatch, renderer);
2128
+
2129
+ /* Free existing textures for this renderer */
2130
+ while (renderer->textures) {
2131
+ SDL_Texture *tex = renderer->textures; (void) tex;
2132
+ SDL_DestroyTexture(renderer->textures);
2133
+ SDL_assert(tex != renderer->textures); /* satisfy static analysis. */
2134
+ }
2135
+
2136
+ if (renderer->window) {
2137
+ SDL_SetWindowData(renderer->window, SDL_WINDOWRENDERDATA, NULL);
2138
+ }
2139
+
2140
+ /* It's no longer magical... */
2141
+ renderer->magic = NULL;
2142
+
2143
+ /* Free the target mutex */
2144
+ SDL_DestroyMutex(renderer->target_mutex);
2145
+ renderer->target_mutex = NULL;
2146
+
2147
+ /* Free the renderer instance */
2148
+ renderer->DestroyRenderer(renderer);
2149
+ }
2150
+
2151
+ int SDL_GL_BindTexture(SDL_Texture *texture, float *texw, float *texh)
2152
+ {
2153
+ SDL_Renderer *renderer;
2154
+
2155
+ CHECK_TEXTURE_MAGIC(texture, -1);
2156
+ renderer = texture->renderer;
2157
+ if (texture->native) {
2158
+ return SDL_GL_BindTexture(texture->native, texw, texh);
2159
+ } else if (renderer && renderer->GL_BindTexture) {
2160
+ return renderer->GL_BindTexture(renderer, texture, texw, texh);
2161
+ } else {
2162
+ return SDL_Unsupported();
2163
+ }
2164
+ }
2165
+
2166
+ int SDL_GL_UnbindTexture(SDL_Texture *texture)
2167
+ {
2168
+ SDL_Renderer *renderer;
2169
+
2170
+ CHECK_TEXTURE_MAGIC(texture, -1);
2171
+ renderer = texture->renderer;
2172
+ if (texture->native) {
2173
+ return SDL_GL_UnbindTexture(texture->native);
2174
+ } else if (renderer && renderer->GL_UnbindTexture) {
2175
+ return renderer->GL_UnbindTexture(renderer, texture);
2176
+ }
2177
+
2178
+ return SDL_Unsupported();
2179
+ }
2180
+
2181
+ void *
2182
+ SDL_RenderGetMetalLayer(SDL_Renderer * renderer)
2183
+ {
2184
+ CHECK_RENDERER_MAGIC(renderer, NULL);
2185
+
2186
+ if (renderer->GetMetalLayer) {
2187
+ return renderer->GetMetalLayer(renderer);
2188
+ }
2189
+ return NULL;
2190
+ }
2191
+
2192
+ void *
2193
+ SDL_RenderGetMetalCommandEncoder(SDL_Renderer * renderer)
2194
+ {
2195
+ CHECK_RENDERER_MAGIC(renderer, NULL);
2196
+
2197
+ if (renderer->GetMetalCommandEncoder) {
2198
+ return renderer->GetMetalCommandEncoder(renderer);
2199
+ }
2200
+ return NULL;
2201
+ }
2202
+
2203
+ static SDL_BlendMode
2204
+ SDL_GetShortBlendMode(SDL_BlendMode blendMode)
2205
+ {
2206
+ if (blendMode == SDL_BLENDMODE_NONE_FULL) {
2207
+ return SDL_BLENDMODE_NONE;
2208
+ }
2209
+ if (blendMode == SDL_BLENDMODE_BLEND_FULL) {
2210
+ return SDL_BLENDMODE_BLEND;
2211
+ }
2212
+ if (blendMode == SDL_BLENDMODE_ADD_FULL) {
2213
+ return SDL_BLENDMODE_ADD;
2214
+ }
2215
+ if (blendMode == SDL_BLENDMODE_MOD_FULL) {
2216
+ return SDL_BLENDMODE_MOD;
2217
+ }
2218
+ return blendMode;
2219
+ }
2220
+
2221
+ static SDL_BlendMode
2222
+ SDL_GetLongBlendMode(SDL_BlendMode blendMode)
2223
+ {
2224
+ if (blendMode == SDL_BLENDMODE_NONE) {
2225
+ return SDL_BLENDMODE_NONE_FULL;
2226
+ }
2227
+ if (blendMode == SDL_BLENDMODE_BLEND) {
2228
+ return SDL_BLENDMODE_BLEND_FULL;
2229
+ }
2230
+ if (blendMode == SDL_BLENDMODE_ADD) {
2231
+ return SDL_BLENDMODE_ADD_FULL;
2232
+ }
2233
+ if (blendMode == SDL_BLENDMODE_MOD) {
2234
+ return SDL_BLENDMODE_MOD_FULL;
2235
+ }
2236
+ return blendMode;
2237
+ }
2238
+
2239
+ SDL_BlendMode
2240
+ SDL_ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor, SDL_BlendFactor dstColorFactor,
2241
+ SDL_BlendOperation colorOperation,
2242
+ SDL_BlendFactor srcAlphaFactor, SDL_BlendFactor dstAlphaFactor,
2243
+ SDL_BlendOperation alphaOperation)
2244
+ {
2245
+ SDL_BlendMode blendMode = SDL_COMPOSE_BLENDMODE(srcColorFactor, dstColorFactor, colorOperation,
2246
+ srcAlphaFactor, dstAlphaFactor, alphaOperation);
2247
+ return SDL_GetShortBlendMode(blendMode);
2248
+ }
2249
+
2250
+ SDL_BlendFactor
2251
+ SDL_GetBlendModeSrcColorFactor(SDL_BlendMode blendMode)
2252
+ {
2253
+ blendMode = SDL_GetLongBlendMode(blendMode);
2254
+ return (SDL_BlendFactor)(((Uint32)blendMode >> 4) & 0xF);
2255
+ }
2256
+
2257
+ SDL_BlendFactor
2258
+ SDL_GetBlendModeDstColorFactor(SDL_BlendMode blendMode)
2259
+ {
2260
+ blendMode = SDL_GetLongBlendMode(blendMode);
2261
+ return (SDL_BlendFactor)(((Uint32)blendMode >> 8) & 0xF);
2262
+ }
2263
+
2264
+ SDL_BlendOperation
2265
+ SDL_GetBlendModeColorOperation(SDL_BlendMode blendMode)
2266
+ {
2267
+ blendMode = SDL_GetLongBlendMode(blendMode);
2268
+ return (SDL_BlendOperation)(((Uint32)blendMode >> 0) & 0xF);
2269
+ }
2270
+
2271
+ SDL_BlendFactor
2272
+ SDL_GetBlendModeSrcAlphaFactor(SDL_BlendMode blendMode)
2273
+ {
2274
+ blendMode = SDL_GetLongBlendMode(blendMode);
2275
+ return (SDL_BlendFactor)(((Uint32)blendMode >> 20) & 0xF);
2276
+ }
2277
+
2278
+ SDL_BlendFactor
2279
+ SDL_GetBlendModeDstAlphaFactor(SDL_BlendMode blendMode)
2280
+ {
2281
+ blendMode = SDL_GetLongBlendMode(blendMode);
2282
+ return (SDL_BlendFactor)(((Uint32)blendMode >> 24) & 0xF);
2283
+ }
2284
+
2285
+ SDL_BlendOperation
2286
+ SDL_GetBlendModeAlphaOperation(SDL_BlendMode blendMode)
2287
+ {
2288
+ blendMode = SDL_GetLongBlendMode(blendMode);
2289
+ return (SDL_BlendOperation)(((Uint32)blendMode >> 16) & 0xF);
2290
+ }
2291
+
2292
+ /* vi: set ts=4 sw=4 expandtab: */