alphatau 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
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,67 @@
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
+ #include "SDL_video.h"
24
+
25
+ /* This is the software implementation of the YUV texture support */
26
+
27
+ struct SDL_SW_YUVTexture
28
+ {
29
+ Uint32 format;
30
+ Uint32 target_format;
31
+ int w, h;
32
+ Uint8 *pixels;
33
+
34
+ /* These are just so we don't have to allocate them separately */
35
+ Uint16 pitches[3];
36
+ Uint8 *planes[3];
37
+
38
+ /* This is a temporary surface in case we have to stretch copy */
39
+ SDL_Surface *stretch;
40
+ SDL_Surface *display;
41
+ };
42
+
43
+ typedef struct SDL_SW_YUVTexture SDL_SW_YUVTexture;
44
+
45
+ SDL_SW_YUVTexture *SDL_SW_CreateYUVTexture(Uint32 format, int w, int h);
46
+ int SDL_SW_QueryYUVTexturePixels(SDL_SW_YUVTexture * swdata, void **pixels,
47
+ int *pitch);
48
+ int SDL_SW_UpdateYUVTexture(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect,
49
+ const void *pixels, int pitch);
50
+ int SDL_SW_UpdateYUVTexturePlanar(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect,
51
+ const Uint8 *Yplane, int Ypitch,
52
+ const Uint8 *Uplane, int Upitch,
53
+ const Uint8 *Vplane, int Vpitch);
54
+ int SDL_SW_LockYUVTexture(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect,
55
+ void **pixels, int *pitch);
56
+ void SDL_SW_UnlockYUVTexture(SDL_SW_YUVTexture * swdata);
57
+ int SDL_SW_CopyYUVToRGB(SDL_SW_YUVTexture * swdata, const SDL_Rect * srcrect,
58
+ Uint32 target_format, int w, int h, void *pixels,
59
+ int pitch);
60
+ void SDL_SW_DestroyYUVTexture(SDL_SW_YUVTexture * swdata);
61
+
62
+ /* FIXME: This breaks on various versions of GCC and should be rewritten using intrinsics */
63
+ #if 0 /* (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES && !defined(__clang__) */
64
+ #define USE_MMX_ASSEMBLY 1
65
+ #endif
66
+
67
+ /* vi: set ts=4 sw=4 expandtab: */
@@ -0,0 +1,1813 @@
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
+ #include "SDL_render.h"
24
+ #include "SDL_system.h"
25
+
26
+ #if SDL_VIDEO_RENDER_D3D && !SDL_RENDER_DISABLED
27
+
28
+ #include "../../core/windows/SDL_windows.h"
29
+
30
+ #include "SDL_hints.h"
31
+ #include "SDL_loadso.h"
32
+ #include "SDL_syswm.h"
33
+ #include "../SDL_sysrender.h"
34
+ #include "../SDL_d3dmath.h"
35
+ #include "../../video/windows/SDL_windowsvideo.h"
36
+
37
+ #if SDL_VIDEO_RENDER_D3D
38
+ #define D3D_DEBUG_INFO
39
+ #include <d3d9.h>
40
+ #endif
41
+
42
+ #include "SDL_shaders_d3d.h"
43
+
44
+
45
+ /* Direct3D renderer implementation */
46
+
47
+ static SDL_Renderer *D3D_CreateRenderer(SDL_Window * window, Uint32 flags);
48
+ static void D3D_WindowEvent(SDL_Renderer * renderer,
49
+ const SDL_WindowEvent *event);
50
+ static SDL_bool D3D_SupportsBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode);
51
+ static int D3D_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture);
52
+ static int D3D_RecreateTexture(SDL_Renderer * renderer, SDL_Texture * texture);
53
+ static int D3D_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
54
+ const SDL_Rect * rect, const void *pixels,
55
+ int pitch);
56
+ static int D3D_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture,
57
+ const SDL_Rect * rect,
58
+ const Uint8 *Yplane, int Ypitch,
59
+ const Uint8 *Uplane, int Upitch,
60
+ const Uint8 *Vplane, int Vpitch);
61
+ static int D3D_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
62
+ const SDL_Rect * rect, void **pixels, int *pitch);
63
+ static void D3D_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture);
64
+ static int D3D_SetRenderTargetInternal(SDL_Renderer * renderer, SDL_Texture * texture);
65
+ static int D3D_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture);
66
+ static int D3D_UpdateViewport(SDL_Renderer * renderer);
67
+ static int D3D_UpdateClipRect(SDL_Renderer * renderer);
68
+ static int D3D_RenderClear(SDL_Renderer * renderer);
69
+ static int D3D_RenderDrawPoints(SDL_Renderer * renderer,
70
+ const SDL_FPoint * points, int count);
71
+ static int D3D_RenderDrawLines(SDL_Renderer * renderer,
72
+ const SDL_FPoint * points, int count);
73
+ static int D3D_RenderFillRects(SDL_Renderer * renderer,
74
+ const SDL_FRect * rects, int count);
75
+ static int D3D_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
76
+ const SDL_Rect * srcrect, const SDL_FRect * dstrect);
77
+ static int D3D_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture,
78
+ const SDL_Rect * srcrect, const SDL_FRect * dstrect,
79
+ const double angle, const SDL_FPoint * center, const SDL_RendererFlip flip);
80
+ static int D3D_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
81
+ Uint32 format, void * pixels, int pitch);
82
+ static void D3D_RenderPresent(SDL_Renderer * renderer);
83
+ static void D3D_DestroyTexture(SDL_Renderer * renderer,
84
+ SDL_Texture * texture);
85
+ static void D3D_DestroyRenderer(SDL_Renderer * renderer);
86
+
87
+
88
+ SDL_RenderDriver D3D_RenderDriver = {
89
+ D3D_CreateRenderer,
90
+ {
91
+ "direct3d",
92
+ (SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_TARGETTEXTURE),
93
+ 1,
94
+ {SDL_PIXELFORMAT_ARGB8888},
95
+ 0,
96
+ 0}
97
+ };
98
+
99
+ typedef struct
100
+ {
101
+ void* d3dDLL;
102
+ IDirect3D9 *d3d;
103
+ IDirect3DDevice9 *device;
104
+ UINT adapter;
105
+ D3DPRESENT_PARAMETERS pparams;
106
+ SDL_bool updateSize;
107
+ SDL_bool beginScene;
108
+ SDL_bool enableSeparateAlphaBlend;
109
+ D3DTEXTUREFILTERTYPE scaleMode[8];
110
+ IDirect3DSurface9 *defaultRenderTarget;
111
+ IDirect3DSurface9 *currentRenderTarget;
112
+ void* d3dxDLL;
113
+ LPDIRECT3DPIXELSHADER9 shaders[NUM_SHADERS];
114
+ } D3D_RenderData;
115
+
116
+ typedef struct
117
+ {
118
+ SDL_bool dirty;
119
+ int w, h;
120
+ DWORD usage;
121
+ Uint32 format;
122
+ D3DFORMAT d3dfmt;
123
+ IDirect3DTexture9 *texture;
124
+ IDirect3DTexture9 *staging;
125
+ } D3D_TextureRep;
126
+
127
+ typedef struct
128
+ {
129
+ D3D_TextureRep texture;
130
+ D3DTEXTUREFILTERTYPE scaleMode;
131
+
132
+ /* YV12 texture support */
133
+ SDL_bool yuv;
134
+ D3D_TextureRep utexture;
135
+ D3D_TextureRep vtexture;
136
+ Uint8 *pixels;
137
+ int pitch;
138
+ SDL_Rect locked_rect;
139
+ } D3D_TextureData;
140
+
141
+ typedef struct
142
+ {
143
+ float x, y, z;
144
+ DWORD color;
145
+ float u, v;
146
+ } Vertex;
147
+
148
+ static int
149
+ D3D_SetError(const char *prefix, HRESULT result)
150
+ {
151
+ const char *error;
152
+
153
+ switch (result) {
154
+ case D3DERR_WRONGTEXTUREFORMAT:
155
+ error = "WRONGTEXTUREFORMAT";
156
+ break;
157
+ case D3DERR_UNSUPPORTEDCOLOROPERATION:
158
+ error = "UNSUPPORTEDCOLOROPERATION";
159
+ break;
160
+ case D3DERR_UNSUPPORTEDCOLORARG:
161
+ error = "UNSUPPORTEDCOLORARG";
162
+ break;
163
+ case D3DERR_UNSUPPORTEDALPHAOPERATION:
164
+ error = "UNSUPPORTEDALPHAOPERATION";
165
+ break;
166
+ case D3DERR_UNSUPPORTEDALPHAARG:
167
+ error = "UNSUPPORTEDALPHAARG";
168
+ break;
169
+ case D3DERR_TOOMANYOPERATIONS:
170
+ error = "TOOMANYOPERATIONS";
171
+ break;
172
+ case D3DERR_CONFLICTINGTEXTUREFILTER:
173
+ error = "CONFLICTINGTEXTUREFILTER";
174
+ break;
175
+ case D3DERR_UNSUPPORTEDFACTORVALUE:
176
+ error = "UNSUPPORTEDFACTORVALUE";
177
+ break;
178
+ case D3DERR_CONFLICTINGRENDERSTATE:
179
+ error = "CONFLICTINGRENDERSTATE";
180
+ break;
181
+ case D3DERR_UNSUPPORTEDTEXTUREFILTER:
182
+ error = "UNSUPPORTEDTEXTUREFILTER";
183
+ break;
184
+ case D3DERR_CONFLICTINGTEXTUREPALETTE:
185
+ error = "CONFLICTINGTEXTUREPALETTE";
186
+ break;
187
+ case D3DERR_DRIVERINTERNALERROR:
188
+ error = "DRIVERINTERNALERROR";
189
+ break;
190
+ case D3DERR_NOTFOUND:
191
+ error = "NOTFOUND";
192
+ break;
193
+ case D3DERR_MOREDATA:
194
+ error = "MOREDATA";
195
+ break;
196
+ case D3DERR_DEVICELOST:
197
+ error = "DEVICELOST";
198
+ break;
199
+ case D3DERR_DEVICENOTRESET:
200
+ error = "DEVICENOTRESET";
201
+ break;
202
+ case D3DERR_NOTAVAILABLE:
203
+ error = "NOTAVAILABLE";
204
+ break;
205
+ case D3DERR_OUTOFVIDEOMEMORY:
206
+ error = "OUTOFVIDEOMEMORY";
207
+ break;
208
+ case D3DERR_INVALIDDEVICE:
209
+ error = "INVALIDDEVICE";
210
+ break;
211
+ case D3DERR_INVALIDCALL:
212
+ error = "INVALIDCALL";
213
+ break;
214
+ case D3DERR_DRIVERINVALIDCALL:
215
+ error = "DRIVERINVALIDCALL";
216
+ break;
217
+ case D3DERR_WASSTILLDRAWING:
218
+ error = "WASSTILLDRAWING";
219
+ break;
220
+ default:
221
+ error = "UNKNOWN";
222
+ break;
223
+ }
224
+ return SDL_SetError("%s: %s", prefix, error);
225
+ }
226
+
227
+ static D3DFORMAT
228
+ PixelFormatToD3DFMT(Uint32 format)
229
+ {
230
+ switch (format) {
231
+ case SDL_PIXELFORMAT_RGB565:
232
+ return D3DFMT_R5G6B5;
233
+ case SDL_PIXELFORMAT_RGB888:
234
+ return D3DFMT_X8R8G8B8;
235
+ case SDL_PIXELFORMAT_ARGB8888:
236
+ return D3DFMT_A8R8G8B8;
237
+ case SDL_PIXELFORMAT_YV12:
238
+ case SDL_PIXELFORMAT_IYUV:
239
+ case SDL_PIXELFORMAT_NV12:
240
+ case SDL_PIXELFORMAT_NV21:
241
+ return D3DFMT_L8;
242
+ default:
243
+ return D3DFMT_UNKNOWN;
244
+ }
245
+ }
246
+
247
+ static Uint32
248
+ D3DFMTToPixelFormat(D3DFORMAT format)
249
+ {
250
+ switch (format) {
251
+ case D3DFMT_R5G6B5:
252
+ return SDL_PIXELFORMAT_RGB565;
253
+ case D3DFMT_X8R8G8B8:
254
+ return SDL_PIXELFORMAT_RGB888;
255
+ case D3DFMT_A8R8G8B8:
256
+ return SDL_PIXELFORMAT_ARGB8888;
257
+ default:
258
+ return SDL_PIXELFORMAT_UNKNOWN;
259
+ }
260
+ }
261
+
262
+ static void
263
+ D3D_InitRenderState(D3D_RenderData *data)
264
+ {
265
+ D3DMATRIX matrix;
266
+
267
+ IDirect3DDevice9 *device = data->device;
268
+
269
+ IDirect3DDevice9_SetVertexShader(device, NULL);
270
+ IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_TEX1);
271
+ IDirect3DDevice9_SetRenderState(device, D3DRS_ZENABLE, D3DZB_FALSE);
272
+ IDirect3DDevice9_SetRenderState(device, D3DRS_CULLMODE, D3DCULL_NONE);
273
+ IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE);
274
+
275
+ /* Enable color modulation by diffuse color */
276
+ IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLOROP,
277
+ D3DTOP_MODULATE);
278
+ IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLORARG1,
279
+ D3DTA_TEXTURE);
280
+ IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLORARG2,
281
+ D3DTA_DIFFUSE);
282
+
283
+ /* Enable alpha modulation by diffuse alpha */
284
+ IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_ALPHAOP,
285
+ D3DTOP_MODULATE);
286
+ IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_ALPHAARG1,
287
+ D3DTA_TEXTURE);
288
+ IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_ALPHAARG2,
289
+ D3DTA_DIFFUSE);
290
+
291
+ /* Enable separate alpha blend function, if possible */
292
+ if (data->enableSeparateAlphaBlend) {
293
+ IDirect3DDevice9_SetRenderState(device, D3DRS_SEPARATEALPHABLENDENABLE, TRUE);
294
+ }
295
+
296
+ /* Disable second texture stage, since we're done */
297
+ IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_COLOROP,
298
+ D3DTOP_DISABLE);
299
+ IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_ALPHAOP,
300
+ D3DTOP_DISABLE);
301
+
302
+ /* Set an identity world and view matrix */
303
+ matrix.m[0][0] = 1.0f;
304
+ matrix.m[0][1] = 0.0f;
305
+ matrix.m[0][2] = 0.0f;
306
+ matrix.m[0][3] = 0.0f;
307
+ matrix.m[1][0] = 0.0f;
308
+ matrix.m[1][1] = 1.0f;
309
+ matrix.m[1][2] = 0.0f;
310
+ matrix.m[1][3] = 0.0f;
311
+ matrix.m[2][0] = 0.0f;
312
+ matrix.m[2][1] = 0.0f;
313
+ matrix.m[2][2] = 1.0f;
314
+ matrix.m[2][3] = 0.0f;
315
+ matrix.m[3][0] = 0.0f;
316
+ matrix.m[3][1] = 0.0f;
317
+ matrix.m[3][2] = 0.0f;
318
+ matrix.m[3][3] = 1.0f;
319
+ IDirect3DDevice9_SetTransform(device, D3DTS_WORLD, &matrix);
320
+ IDirect3DDevice9_SetTransform(device, D3DTS_VIEW, &matrix);
321
+
322
+ /* Reset our current scale mode */
323
+ SDL_memset(data->scaleMode, 0xFF, sizeof(data->scaleMode));
324
+
325
+ /* Start the render with beginScene */
326
+ data->beginScene = SDL_TRUE;
327
+ }
328
+
329
+ static int
330
+ D3D_Reset(SDL_Renderer * renderer)
331
+ {
332
+ D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
333
+ HRESULT result;
334
+ SDL_Texture *texture;
335
+
336
+ /* Release the default render target before reset */
337
+ if (data->defaultRenderTarget) {
338
+ IDirect3DSurface9_Release(data->defaultRenderTarget);
339
+ data->defaultRenderTarget = NULL;
340
+ }
341
+ if (data->currentRenderTarget != NULL) {
342
+ IDirect3DSurface9_Release(data->currentRenderTarget);
343
+ data->currentRenderTarget = NULL;
344
+ }
345
+
346
+ /* Release application render targets */
347
+ for (texture = renderer->textures; texture; texture = texture->next) {
348
+ if (texture->access == SDL_TEXTUREACCESS_TARGET) {
349
+ D3D_DestroyTexture(renderer, texture);
350
+ } else {
351
+ D3D_RecreateTexture(renderer, texture);
352
+ }
353
+ }
354
+
355
+ result = IDirect3DDevice9_Reset(data->device, &data->pparams);
356
+ if (FAILED(result)) {
357
+ if (result == D3DERR_DEVICELOST) {
358
+ /* Don't worry about it, we'll reset later... */
359
+ return 0;
360
+ } else {
361
+ return D3D_SetError("Reset()", result);
362
+ }
363
+ }
364
+
365
+ /* Allocate application render targets */
366
+ for (texture = renderer->textures; texture; texture = texture->next) {
367
+ if (texture->access == SDL_TEXTUREACCESS_TARGET) {
368
+ D3D_CreateTexture(renderer, texture);
369
+ }
370
+ }
371
+
372
+ IDirect3DDevice9_GetRenderTarget(data->device, 0, &data->defaultRenderTarget);
373
+ D3D_InitRenderState(data);
374
+ D3D_SetRenderTargetInternal(renderer, renderer->target);
375
+ D3D_UpdateViewport(renderer);
376
+
377
+ /* Let the application know that render targets were reset */
378
+ {
379
+ SDL_Event event;
380
+ event.type = SDL_RENDER_TARGETS_RESET;
381
+ SDL_PushEvent(&event);
382
+ }
383
+
384
+ return 0;
385
+ }
386
+
387
+ static int
388
+ D3D_ActivateRenderer(SDL_Renderer * renderer)
389
+ {
390
+ D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
391
+ HRESULT result;
392
+
393
+ if (data->updateSize) {
394
+ SDL_Window *window = renderer->window;
395
+ int w, h;
396
+ Uint32 window_flags = SDL_GetWindowFlags(window);
397
+
398
+ SDL_GetWindowSize(window, &w, &h);
399
+ data->pparams.BackBufferWidth = w;
400
+ data->pparams.BackBufferHeight = h;
401
+ if (window_flags & SDL_WINDOW_FULLSCREEN && (window_flags & SDL_WINDOW_FULLSCREEN_DESKTOP) != SDL_WINDOW_FULLSCREEN_DESKTOP) {
402
+ SDL_DisplayMode fullscreen_mode;
403
+ SDL_GetWindowDisplayMode(window, &fullscreen_mode);
404
+ data->pparams.Windowed = FALSE;
405
+ data->pparams.BackBufferFormat = PixelFormatToD3DFMT(fullscreen_mode.format);
406
+ data->pparams.FullScreen_RefreshRateInHz = fullscreen_mode.refresh_rate;
407
+ } else {
408
+ data->pparams.Windowed = TRUE;
409
+ data->pparams.BackBufferFormat = D3DFMT_UNKNOWN;
410
+ data->pparams.FullScreen_RefreshRateInHz = 0;
411
+ }
412
+ if (D3D_Reset(renderer) < 0) {
413
+ return -1;
414
+ }
415
+
416
+ data->updateSize = SDL_FALSE;
417
+ }
418
+ if (data->beginScene) {
419
+ result = IDirect3DDevice9_BeginScene(data->device);
420
+ if (result == D3DERR_DEVICELOST) {
421
+ if (D3D_Reset(renderer) < 0) {
422
+ return -1;
423
+ }
424
+ result = IDirect3DDevice9_BeginScene(data->device);
425
+ }
426
+ if (FAILED(result)) {
427
+ return D3D_SetError("BeginScene()", result);
428
+ }
429
+ data->beginScene = SDL_FALSE;
430
+ }
431
+ return 0;
432
+ }
433
+
434
+ SDL_Renderer *
435
+ D3D_CreateRenderer(SDL_Window * window, Uint32 flags)
436
+ {
437
+ SDL_Renderer *renderer;
438
+ D3D_RenderData *data;
439
+ SDL_SysWMinfo windowinfo;
440
+ HRESULT result;
441
+ D3DPRESENT_PARAMETERS pparams;
442
+ IDirect3DSwapChain9 *chain;
443
+ D3DCAPS9 caps;
444
+ DWORD device_flags;
445
+ Uint32 window_flags;
446
+ int w, h;
447
+ SDL_DisplayMode fullscreen_mode;
448
+ int displayIndex;
449
+
450
+ renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer));
451
+ if (!renderer) {
452
+ SDL_OutOfMemory();
453
+ return NULL;
454
+ }
455
+
456
+ data = (D3D_RenderData *) SDL_calloc(1, sizeof(*data));
457
+ if (!data) {
458
+ SDL_free(renderer);
459
+ SDL_OutOfMemory();
460
+ return NULL;
461
+ }
462
+
463
+ if (!D3D_LoadDLL(&data->d3dDLL, &data->d3d)) {
464
+ SDL_free(renderer);
465
+ SDL_free(data);
466
+ SDL_SetError("Unable to create Direct3D interface");
467
+ return NULL;
468
+ }
469
+
470
+ renderer->WindowEvent = D3D_WindowEvent;
471
+ renderer->SupportsBlendMode = D3D_SupportsBlendMode;
472
+ renderer->CreateTexture = D3D_CreateTexture;
473
+ renderer->UpdateTexture = D3D_UpdateTexture;
474
+ renderer->UpdateTextureYUV = D3D_UpdateTextureYUV;
475
+ renderer->LockTexture = D3D_LockTexture;
476
+ renderer->UnlockTexture = D3D_UnlockTexture;
477
+ renderer->SetRenderTarget = D3D_SetRenderTarget;
478
+ renderer->UpdateViewport = D3D_UpdateViewport;
479
+ renderer->UpdateClipRect = D3D_UpdateClipRect;
480
+ renderer->RenderClear = D3D_RenderClear;
481
+ renderer->RenderDrawPoints = D3D_RenderDrawPoints;
482
+ renderer->RenderDrawLines = D3D_RenderDrawLines;
483
+ renderer->RenderFillRects = D3D_RenderFillRects;
484
+ renderer->RenderCopy = D3D_RenderCopy;
485
+ renderer->RenderCopyEx = D3D_RenderCopyEx;
486
+ renderer->RenderReadPixels = D3D_RenderReadPixels;
487
+ renderer->RenderPresent = D3D_RenderPresent;
488
+ renderer->DestroyTexture = D3D_DestroyTexture;
489
+ renderer->DestroyRenderer = D3D_DestroyRenderer;
490
+ renderer->info = D3D_RenderDriver.info;
491
+ renderer->info.flags = (SDL_RENDERER_ACCELERATED | SDL_RENDERER_TARGETTEXTURE);
492
+ renderer->driverdata = data;
493
+
494
+ SDL_VERSION(&windowinfo.version);
495
+ SDL_GetWindowWMInfo(window, &windowinfo);
496
+
497
+ window_flags = SDL_GetWindowFlags(window);
498
+ SDL_GetWindowSize(window, &w, &h);
499
+ SDL_GetWindowDisplayMode(window, &fullscreen_mode);
500
+
501
+ SDL_zero(pparams);
502
+ pparams.hDeviceWindow = windowinfo.info.win.window;
503
+ pparams.BackBufferWidth = w;
504
+ pparams.BackBufferHeight = h;
505
+ pparams.BackBufferCount = 1;
506
+ pparams.SwapEffect = D3DSWAPEFFECT_DISCARD;
507
+
508
+ if (window_flags & SDL_WINDOW_FULLSCREEN && (window_flags & SDL_WINDOW_FULLSCREEN_DESKTOP) != SDL_WINDOW_FULLSCREEN_DESKTOP) {
509
+ pparams.Windowed = FALSE;
510
+ pparams.BackBufferFormat = PixelFormatToD3DFMT(fullscreen_mode.format);
511
+ pparams.FullScreen_RefreshRateInHz = fullscreen_mode.refresh_rate;
512
+ } else {
513
+ pparams.Windowed = TRUE;
514
+ pparams.BackBufferFormat = D3DFMT_UNKNOWN;
515
+ pparams.FullScreen_RefreshRateInHz = 0;
516
+ }
517
+ if (flags & SDL_RENDERER_PRESENTVSYNC) {
518
+ pparams.PresentationInterval = D3DPRESENT_INTERVAL_ONE;
519
+ } else {
520
+ pparams.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
521
+ }
522
+
523
+ /* Get the adapter for the display that the window is on */
524
+ displayIndex = SDL_GetWindowDisplayIndex(window);
525
+ data->adapter = SDL_Direct3D9GetAdapterIndex(displayIndex);
526
+
527
+ IDirect3D9_GetDeviceCaps(data->d3d, data->adapter, D3DDEVTYPE_HAL, &caps);
528
+
529
+ device_flags = D3DCREATE_FPU_PRESERVE;
530
+ if (caps.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) {
531
+ device_flags |= D3DCREATE_HARDWARE_VERTEXPROCESSING;
532
+ } else {
533
+ device_flags |= D3DCREATE_SOFTWARE_VERTEXPROCESSING;
534
+ }
535
+
536
+ if (SDL_GetHintBoolean(SDL_HINT_RENDER_DIRECT3D_THREADSAFE, SDL_FALSE)) {
537
+ device_flags |= D3DCREATE_MULTITHREADED;
538
+ }
539
+
540
+ result = IDirect3D9_CreateDevice(data->d3d, data->adapter,
541
+ D3DDEVTYPE_HAL,
542
+ pparams.hDeviceWindow,
543
+ device_flags,
544
+ &pparams, &data->device);
545
+ if (FAILED(result)) {
546
+ D3D_DestroyRenderer(renderer);
547
+ D3D_SetError("CreateDevice()", result);
548
+ return NULL;
549
+ }
550
+
551
+ /* Get presentation parameters to fill info */
552
+ result = IDirect3DDevice9_GetSwapChain(data->device, 0, &chain);
553
+ if (FAILED(result)) {
554
+ D3D_DestroyRenderer(renderer);
555
+ D3D_SetError("GetSwapChain()", result);
556
+ return NULL;
557
+ }
558
+ result = IDirect3DSwapChain9_GetPresentParameters(chain, &pparams);
559
+ if (FAILED(result)) {
560
+ IDirect3DSwapChain9_Release(chain);
561
+ D3D_DestroyRenderer(renderer);
562
+ D3D_SetError("GetPresentParameters()", result);
563
+ return NULL;
564
+ }
565
+ IDirect3DSwapChain9_Release(chain);
566
+ if (pparams.PresentationInterval == D3DPRESENT_INTERVAL_ONE) {
567
+ renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
568
+ }
569
+ data->pparams = pparams;
570
+
571
+ IDirect3DDevice9_GetDeviceCaps(data->device, &caps);
572
+ renderer->info.max_texture_width = caps.MaxTextureWidth;
573
+ renderer->info.max_texture_height = caps.MaxTextureHeight;
574
+ if (caps.NumSimultaneousRTs >= 2) {
575
+ renderer->info.flags |= SDL_RENDERER_TARGETTEXTURE;
576
+ }
577
+
578
+ if (caps.PrimitiveMiscCaps & D3DPMISCCAPS_SEPARATEALPHABLEND) {
579
+ data->enableSeparateAlphaBlend = SDL_TRUE;
580
+ }
581
+
582
+ /* Store the default render target */
583
+ IDirect3DDevice9_GetRenderTarget(data->device, 0, &data->defaultRenderTarget);
584
+ data->currentRenderTarget = NULL;
585
+
586
+ /* Set up parameters for rendering */
587
+ D3D_InitRenderState(data);
588
+
589
+ if (caps.MaxSimultaneousTextures >= 3) {
590
+ int i;
591
+ for (i = 0; i < SDL_arraysize(data->shaders); ++i) {
592
+ result = D3D9_CreatePixelShader(data->device, (D3D9_Shader)i, &data->shaders[i]);
593
+ if (FAILED(result)) {
594
+ D3D_SetError("CreatePixelShader()", result);
595
+ }
596
+ }
597
+ if (data->shaders[SHADER_YUV_JPEG] && data->shaders[SHADER_YUV_BT601] && data->shaders[SHADER_YUV_BT709]) {
598
+ renderer->info.texture_formats[renderer->info.num_texture_formats++] = SDL_PIXELFORMAT_YV12;
599
+ renderer->info.texture_formats[renderer->info.num_texture_formats++] = SDL_PIXELFORMAT_IYUV;
600
+ }
601
+ }
602
+ return renderer;
603
+ }
604
+
605
+ static void
606
+ D3D_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event)
607
+ {
608
+ D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
609
+
610
+ if (event->event == SDL_WINDOWEVENT_SIZE_CHANGED) {
611
+ data->updateSize = SDL_TRUE;
612
+ }
613
+ }
614
+
615
+ static D3DBLEND GetBlendFunc(SDL_BlendFactor factor)
616
+ {
617
+ switch (factor) {
618
+ case SDL_BLENDFACTOR_ZERO:
619
+ return D3DBLEND_ZERO;
620
+ case SDL_BLENDFACTOR_ONE:
621
+ return D3DBLEND_ONE;
622
+ case SDL_BLENDFACTOR_SRC_COLOR:
623
+ return D3DBLEND_SRCCOLOR;
624
+ case SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR:
625
+ return D3DBLEND_INVSRCCOLOR;
626
+ case SDL_BLENDFACTOR_SRC_ALPHA:
627
+ return D3DBLEND_SRCALPHA;
628
+ case SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA:
629
+ return D3DBLEND_INVSRCALPHA;
630
+ case SDL_BLENDFACTOR_DST_COLOR:
631
+ return D3DBLEND_DESTCOLOR;
632
+ case SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR:
633
+ return D3DBLEND_INVDESTCOLOR;
634
+ case SDL_BLENDFACTOR_DST_ALPHA:
635
+ return D3DBLEND_DESTALPHA;
636
+ case SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA:
637
+ return D3DBLEND_INVDESTALPHA;
638
+ default:
639
+ return (D3DBLEND)0;
640
+ }
641
+ }
642
+
643
+ static SDL_bool
644
+ D3D_SupportsBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode)
645
+ {
646
+ D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
647
+ SDL_BlendFactor srcColorFactor = SDL_GetBlendModeSrcColorFactor(blendMode);
648
+ SDL_BlendFactor srcAlphaFactor = SDL_GetBlendModeSrcAlphaFactor(blendMode);
649
+ SDL_BlendOperation colorOperation = SDL_GetBlendModeColorOperation(blendMode);
650
+ SDL_BlendFactor dstColorFactor = SDL_GetBlendModeDstColorFactor(blendMode);
651
+ SDL_BlendFactor dstAlphaFactor = SDL_GetBlendModeDstAlphaFactor(blendMode);
652
+ SDL_BlendOperation alphaOperation = SDL_GetBlendModeAlphaOperation(blendMode);
653
+
654
+ if (!GetBlendFunc(srcColorFactor) || !GetBlendFunc(srcAlphaFactor) ||
655
+ !GetBlendFunc(dstColorFactor) || !GetBlendFunc(dstAlphaFactor)) {
656
+ return SDL_FALSE;
657
+ }
658
+ if ((srcColorFactor != srcAlphaFactor || dstColorFactor != dstAlphaFactor) && !data->enableSeparateAlphaBlend) {
659
+ return SDL_FALSE;
660
+ }
661
+ if (colorOperation != SDL_BLENDOPERATION_ADD || alphaOperation != SDL_BLENDOPERATION_ADD) {
662
+ return SDL_FALSE;
663
+ }
664
+ return SDL_TRUE;
665
+ }
666
+
667
+ static int
668
+ D3D_CreateTextureRep(IDirect3DDevice9 *device, D3D_TextureRep *texture, DWORD usage, Uint32 format, D3DFORMAT d3dfmt, int w, int h)
669
+ {
670
+ HRESULT result;
671
+
672
+ texture->dirty = SDL_FALSE;
673
+ texture->w = w;
674
+ texture->h = h;
675
+ texture->usage = usage;
676
+ texture->format = format;
677
+ texture->d3dfmt = d3dfmt;
678
+
679
+ result = IDirect3DDevice9_CreateTexture(device, w, h, 1, usage,
680
+ PixelFormatToD3DFMT(format),
681
+ D3DPOOL_DEFAULT, &texture->texture, NULL);
682
+ if (FAILED(result)) {
683
+ return D3D_SetError("CreateTexture(D3DPOOL_DEFAULT)", result);
684
+ }
685
+ return 0;
686
+ }
687
+
688
+
689
+ static int
690
+ D3D_CreateStagingTexture(IDirect3DDevice9 *device, D3D_TextureRep *texture)
691
+ {
692
+ HRESULT result;
693
+
694
+ if (texture->staging == NULL) {
695
+ result = IDirect3DDevice9_CreateTexture(device, texture->w, texture->h, 1, 0,
696
+ texture->d3dfmt, D3DPOOL_SYSTEMMEM, &texture->staging, NULL);
697
+ if (FAILED(result)) {
698
+ return D3D_SetError("CreateTexture(D3DPOOL_SYSTEMMEM)", result);
699
+ }
700
+ }
701
+ return 0;
702
+ }
703
+
704
+ static int
705
+ D3D_BindTextureRep(IDirect3DDevice9 *device, D3D_TextureRep *texture, DWORD sampler)
706
+ {
707
+ HRESULT result;
708
+
709
+ if (texture->dirty && texture->staging) {
710
+ if (!texture->texture) {
711
+ result = IDirect3DDevice9_CreateTexture(device, texture->w, texture->h, 1, texture->usage,
712
+ PixelFormatToD3DFMT(texture->format), D3DPOOL_DEFAULT, &texture->texture, NULL);
713
+ if (FAILED(result)) {
714
+ return D3D_SetError("CreateTexture(D3DPOOL_DEFAULT)", result);
715
+ }
716
+ }
717
+
718
+ result = IDirect3DDevice9_UpdateTexture(device, (IDirect3DBaseTexture9 *)texture->staging, (IDirect3DBaseTexture9 *)texture->texture);
719
+ if (FAILED(result)) {
720
+ return D3D_SetError("UpdateTexture()", result);
721
+ }
722
+ texture->dirty = SDL_FALSE;
723
+ }
724
+ result = IDirect3DDevice9_SetTexture(device, sampler, (IDirect3DBaseTexture9 *)texture->texture);
725
+ if (FAILED(result)) {
726
+ return D3D_SetError("SetTexture()", result);
727
+ }
728
+ return 0;
729
+ }
730
+
731
+ static int
732
+ D3D_RecreateTextureRep(IDirect3DDevice9 *device, D3D_TextureRep *texture)
733
+ {
734
+ if (texture->texture) {
735
+ IDirect3DTexture9_Release(texture->texture);
736
+ texture->texture = NULL;
737
+ }
738
+ if (texture->staging) {
739
+ IDirect3DTexture9_AddDirtyRect(texture->staging, NULL);
740
+ texture->dirty = SDL_TRUE;
741
+ }
742
+ return 0;
743
+ }
744
+
745
+ static int
746
+ D3D_UpdateTextureRep(IDirect3DDevice9 *device, D3D_TextureRep *texture, int x, int y, int w, int h, const void *pixels, int pitch)
747
+ {
748
+ RECT d3drect;
749
+ D3DLOCKED_RECT locked;
750
+ const Uint8 *src;
751
+ Uint8 *dst;
752
+ int row, length;
753
+ HRESULT result;
754
+
755
+ if (D3D_CreateStagingTexture(device, texture) < 0) {
756
+ return -1;
757
+ }
758
+
759
+ d3drect.left = x;
760
+ d3drect.right = x + w;
761
+ d3drect.top = y;
762
+ d3drect.bottom = y + h;
763
+
764
+ result = IDirect3DTexture9_LockRect(texture->staging, 0, &locked, &d3drect, 0);
765
+ if (FAILED(result)) {
766
+ return D3D_SetError("LockRect()", result);
767
+ }
768
+
769
+ src = (const Uint8 *)pixels;
770
+ dst = (Uint8 *)locked.pBits;
771
+ length = w * SDL_BYTESPERPIXEL(texture->format);
772
+ if (length == pitch && length == locked.Pitch) {
773
+ SDL_memcpy(dst, src, length*h);
774
+ } else {
775
+ if (length > pitch) {
776
+ length = pitch;
777
+ }
778
+ if (length > locked.Pitch) {
779
+ length = locked.Pitch;
780
+ }
781
+ for (row = 0; row < h; ++row) {
782
+ SDL_memcpy(dst, src, length);
783
+ src += pitch;
784
+ dst += locked.Pitch;
785
+ }
786
+ }
787
+ result = IDirect3DTexture9_UnlockRect(texture->staging, 0);
788
+ if (FAILED(result)) {
789
+ return D3D_SetError("UnlockRect()", result);
790
+ }
791
+ texture->dirty = SDL_TRUE;
792
+
793
+ return 0;
794
+ }
795
+
796
+ static void
797
+ D3D_DestroyTextureRep(D3D_TextureRep *texture)
798
+ {
799
+ if (texture->texture) {
800
+ IDirect3DTexture9_Release(texture->texture);
801
+ texture->texture = NULL;
802
+ }
803
+ if (texture->staging) {
804
+ IDirect3DTexture9_Release(texture->staging);
805
+ texture->staging = NULL;
806
+ }
807
+ }
808
+
809
+ static int
810
+ D3D_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
811
+ {
812
+ D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
813
+ D3D_TextureData *texturedata;
814
+ DWORD usage;
815
+
816
+ texturedata = (D3D_TextureData *) SDL_calloc(1, sizeof(*texturedata));
817
+ if (!texturedata) {
818
+ return SDL_OutOfMemory();
819
+ }
820
+ texturedata->scaleMode = (texture->scaleMode == SDL_ScaleModeNearest) ? D3DTEXF_POINT : D3DTEXF_LINEAR;
821
+
822
+ texture->driverdata = texturedata;
823
+
824
+ if (texture->access == SDL_TEXTUREACCESS_TARGET) {
825
+ usage = D3DUSAGE_RENDERTARGET;
826
+ } else {
827
+ usage = 0;
828
+ }
829
+
830
+ if (D3D_CreateTextureRep(data->device, &texturedata->texture, usage, texture->format, PixelFormatToD3DFMT(texture->format), texture->w, texture->h) < 0) {
831
+ return -1;
832
+ }
833
+
834
+ if (texture->format == SDL_PIXELFORMAT_YV12 ||
835
+ texture->format == SDL_PIXELFORMAT_IYUV) {
836
+ texturedata->yuv = SDL_TRUE;
837
+
838
+ if (D3D_CreateTextureRep(data->device, &texturedata->utexture, usage, texture->format, PixelFormatToD3DFMT(texture->format), (texture->w + 1) / 2, (texture->h + 1) / 2) < 0) {
839
+ return -1;
840
+ }
841
+
842
+ if (D3D_CreateTextureRep(data->device, &texturedata->vtexture, usage, texture->format, PixelFormatToD3DFMT(texture->format), (texture->w + 1) / 2, (texture->h + 1) / 2) < 0) {
843
+ return -1;
844
+ }
845
+ }
846
+ return 0;
847
+ }
848
+
849
+ static int
850
+ D3D_RecreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
851
+ {
852
+ D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata;
853
+ D3D_TextureData *texturedata = (D3D_TextureData *)texture->driverdata;
854
+
855
+ if (!texturedata) {
856
+ return 0;
857
+ }
858
+
859
+ if (D3D_RecreateTextureRep(data->device, &texturedata->texture) < 0) {
860
+ return -1;
861
+ }
862
+
863
+ if (texturedata->yuv) {
864
+ if (D3D_RecreateTextureRep(data->device, &texturedata->utexture) < 0) {
865
+ return -1;
866
+ }
867
+
868
+ if (D3D_RecreateTextureRep(data->device, &texturedata->vtexture) < 0) {
869
+ return -1;
870
+ }
871
+ }
872
+ return 0;
873
+ }
874
+
875
+ static int
876
+ D3D_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
877
+ const SDL_Rect * rect, const void *pixels, int pitch)
878
+ {
879
+ D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata;
880
+ D3D_TextureData *texturedata = (D3D_TextureData *) texture->driverdata;
881
+
882
+ if (!texturedata) {
883
+ SDL_SetError("Texture is not currently available");
884
+ return -1;
885
+ }
886
+
887
+ if (D3D_UpdateTextureRep(data->device, &texturedata->texture, rect->x, rect->y, rect->w, rect->h, pixels, pitch) < 0) {
888
+ return -1;
889
+ }
890
+
891
+ if (texturedata->yuv) {
892
+ /* Skip to the correct offset into the next texture */
893
+ pixels = (const void*)((const Uint8*)pixels + rect->h * pitch);
894
+
895
+ if (D3D_UpdateTextureRep(data->device, texture->format == SDL_PIXELFORMAT_YV12 ? &texturedata->vtexture : &texturedata->utexture, rect->x / 2, rect->y / 2, (rect->w + 1) / 2, (rect->h + 1) / 2, pixels, (pitch + 1) / 2) < 0) {
896
+ return -1;
897
+ }
898
+
899
+ /* Skip to the correct offset into the next texture */
900
+ pixels = (const void*)((const Uint8*)pixels + ((rect->h + 1) / 2) * ((pitch + 1) / 2));
901
+ if (D3D_UpdateTextureRep(data->device, texture->format == SDL_PIXELFORMAT_YV12 ? &texturedata->utexture : &texturedata->vtexture, rect->x / 2, (rect->y + 1) / 2, (rect->w + 1) / 2, (rect->h + 1) / 2, pixels, (pitch + 1) / 2) < 0) {
902
+ return -1;
903
+ }
904
+ }
905
+ return 0;
906
+ }
907
+
908
+ static int
909
+ D3D_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture,
910
+ const SDL_Rect * rect,
911
+ const Uint8 *Yplane, int Ypitch,
912
+ const Uint8 *Uplane, int Upitch,
913
+ const Uint8 *Vplane, int Vpitch)
914
+ {
915
+ D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata;
916
+ D3D_TextureData *texturedata = (D3D_TextureData *) texture->driverdata;
917
+
918
+ if (!texturedata) {
919
+ SDL_SetError("Texture is not currently available");
920
+ return -1;
921
+ }
922
+
923
+ if (D3D_UpdateTextureRep(data->device, &texturedata->texture, rect->x, rect->y, rect->w, rect->h, Yplane, Ypitch) < 0) {
924
+ return -1;
925
+ }
926
+ if (D3D_UpdateTextureRep(data->device, &texturedata->utexture, rect->x / 2, rect->y / 2, (rect->w + 1) / 2, (rect->h + 1) / 2, Uplane, Upitch) < 0) {
927
+ return -1;
928
+ }
929
+ if (D3D_UpdateTextureRep(data->device, &texturedata->vtexture, rect->x / 2, rect->y / 2, (rect->w + 1) / 2, (rect->h + 1) / 2, Vplane, Vpitch) < 0) {
930
+ return -1;
931
+ }
932
+ return 0;
933
+ }
934
+
935
+ static int
936
+ D3D_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
937
+ const SDL_Rect * rect, void **pixels, int *pitch)
938
+ {
939
+ D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata;
940
+ D3D_TextureData *texturedata = (D3D_TextureData *)texture->driverdata;
941
+ IDirect3DDevice9 *device = data->device;
942
+
943
+ if (!texturedata) {
944
+ SDL_SetError("Texture is not currently available");
945
+ return -1;
946
+ }
947
+
948
+ texturedata->locked_rect = *rect;
949
+
950
+ if (texturedata->yuv) {
951
+ /* It's more efficient to upload directly... */
952
+ if (!texturedata->pixels) {
953
+ texturedata->pitch = texture->w;
954
+ texturedata->pixels = (Uint8 *)SDL_malloc((texture->h * texturedata->pitch * 3) / 2);
955
+ if (!texturedata->pixels) {
956
+ return SDL_OutOfMemory();
957
+ }
958
+ }
959
+ *pixels =
960
+ (void *) ((Uint8 *) texturedata->pixels + rect->y * texturedata->pitch +
961
+ rect->x * SDL_BYTESPERPIXEL(texture->format));
962
+ *pitch = texturedata->pitch;
963
+ } else {
964
+ RECT d3drect;
965
+ D3DLOCKED_RECT locked;
966
+ HRESULT result;
967
+
968
+ if (D3D_CreateStagingTexture(device, &texturedata->texture) < 0) {
969
+ return -1;
970
+ }
971
+
972
+ d3drect.left = rect->x;
973
+ d3drect.right = rect->x + rect->w;
974
+ d3drect.top = rect->y;
975
+ d3drect.bottom = rect->y + rect->h;
976
+
977
+ result = IDirect3DTexture9_LockRect(texturedata->texture.staging, 0, &locked, &d3drect, 0);
978
+ if (FAILED(result)) {
979
+ return D3D_SetError("LockRect()", result);
980
+ }
981
+ *pixels = locked.pBits;
982
+ *pitch = locked.Pitch;
983
+ }
984
+ return 0;
985
+ }
986
+
987
+ static void
988
+ D3D_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture)
989
+ {
990
+ /*D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata;*/
991
+ D3D_TextureData *texturedata = (D3D_TextureData *)texture->driverdata;
992
+
993
+ if (!texturedata) {
994
+ return;
995
+ }
996
+
997
+ if (texturedata->yuv) {
998
+ const SDL_Rect *rect = &texturedata->locked_rect;
999
+ void *pixels =
1000
+ (void *) ((Uint8 *) texturedata->pixels + rect->y * texturedata->pitch +
1001
+ rect->x * SDL_BYTESPERPIXEL(texture->format));
1002
+ D3D_UpdateTexture(renderer, texture, rect, pixels, texturedata->pitch);
1003
+ } else {
1004
+ IDirect3DTexture9_UnlockRect(texturedata->texture.staging, 0);
1005
+ texturedata->texture.dirty = SDL_TRUE;
1006
+ }
1007
+ }
1008
+
1009
+ static int
1010
+ D3D_SetRenderTargetInternal(SDL_Renderer * renderer, SDL_Texture * texture)
1011
+ {
1012
+ D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
1013
+ D3D_TextureData *texturedata;
1014
+ D3D_TextureRep *texturerep;
1015
+ HRESULT result;
1016
+ IDirect3DDevice9 *device = data->device;
1017
+
1018
+ /* Release the previous render target if it wasn't the default one */
1019
+ if (data->currentRenderTarget != NULL) {
1020
+ IDirect3DSurface9_Release(data->currentRenderTarget);
1021
+ data->currentRenderTarget = NULL;
1022
+ }
1023
+
1024
+ if (texture == NULL) {
1025
+ IDirect3DDevice9_SetRenderTarget(data->device, 0, data->defaultRenderTarget);
1026
+ return 0;
1027
+ }
1028
+
1029
+ texturedata = (D3D_TextureData *)texture->driverdata;
1030
+ if (!texturedata) {
1031
+ SDL_SetError("Texture is not currently available");
1032
+ return -1;
1033
+ }
1034
+
1035
+ /* Make sure the render target is updated if it was locked and written to */
1036
+ texturerep = &texturedata->texture;
1037
+ if (texturerep->dirty && texturerep->staging) {
1038
+ if (!texturerep->texture) {
1039
+ result = IDirect3DDevice9_CreateTexture(device, texturerep->w, texturerep->h, 1, texturerep->usage,
1040
+ PixelFormatToD3DFMT(texturerep->format), D3DPOOL_DEFAULT, &texturerep->texture, NULL);
1041
+ if (FAILED(result)) {
1042
+ return D3D_SetError("CreateTexture(D3DPOOL_DEFAULT)", result);
1043
+ }
1044
+ }
1045
+
1046
+ result = IDirect3DDevice9_UpdateTexture(device, (IDirect3DBaseTexture9 *)texturerep->staging, (IDirect3DBaseTexture9 *)texturerep->texture);
1047
+ if (FAILED(result)) {
1048
+ return D3D_SetError("UpdateTexture()", result);
1049
+ }
1050
+ texturerep->dirty = SDL_FALSE;
1051
+ }
1052
+
1053
+ result = IDirect3DTexture9_GetSurfaceLevel(texturedata->texture.texture, 0, &data->currentRenderTarget);
1054
+ if(FAILED(result)) {
1055
+ return D3D_SetError("GetSurfaceLevel()", result);
1056
+ }
1057
+ result = IDirect3DDevice9_SetRenderTarget(data->device, 0, data->currentRenderTarget);
1058
+ if(FAILED(result)) {
1059
+ return D3D_SetError("SetRenderTarget()", result);
1060
+ }
1061
+
1062
+ return 0;
1063
+ }
1064
+
1065
+ static int
1066
+ D3D_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture)
1067
+ {
1068
+ if (D3D_ActivateRenderer(renderer) < 0) {
1069
+ return -1;
1070
+ }
1071
+
1072
+ return D3D_SetRenderTargetInternal(renderer, texture);
1073
+ }
1074
+
1075
+ static int
1076
+ D3D_UpdateViewport(SDL_Renderer * renderer)
1077
+ {
1078
+ D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
1079
+ D3DVIEWPORT9 viewport;
1080
+ D3DMATRIX matrix;
1081
+
1082
+ /* Set the viewport */
1083
+ viewport.X = renderer->viewport.x;
1084
+ viewport.Y = renderer->viewport.y;
1085
+ viewport.Width = renderer->viewport.w;
1086
+ viewport.Height = renderer->viewport.h;
1087
+ viewport.MinZ = 0.0f;
1088
+ viewport.MaxZ = 1.0f;
1089
+ IDirect3DDevice9_SetViewport(data->device, &viewport);
1090
+
1091
+ /* Set an orthographic projection matrix */
1092
+ if (renderer->viewport.w && renderer->viewport.h) {
1093
+ matrix.m[0][0] = 2.0f / renderer->viewport.w;
1094
+ matrix.m[0][1] = 0.0f;
1095
+ matrix.m[0][2] = 0.0f;
1096
+ matrix.m[0][3] = 0.0f;
1097
+ matrix.m[1][0] = 0.0f;
1098
+ matrix.m[1][1] = -2.0f / renderer->viewport.h;
1099
+ matrix.m[1][2] = 0.0f;
1100
+ matrix.m[1][3] = 0.0f;
1101
+ matrix.m[2][0] = 0.0f;
1102
+ matrix.m[2][1] = 0.0f;
1103
+ matrix.m[2][2] = 1.0f;
1104
+ matrix.m[2][3] = 0.0f;
1105
+ matrix.m[3][0] = -1.0f;
1106
+ matrix.m[3][1] = 1.0f;
1107
+ matrix.m[3][2] = 0.0f;
1108
+ matrix.m[3][3] = 1.0f;
1109
+ IDirect3DDevice9_SetTransform(data->device, D3DTS_PROJECTION, &matrix);
1110
+ }
1111
+
1112
+ return 0;
1113
+ }
1114
+
1115
+ static int
1116
+ D3D_UpdateClipRect(SDL_Renderer * renderer)
1117
+ {
1118
+ D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
1119
+
1120
+ if (renderer->clipping_enabled) {
1121
+ const SDL_Rect *rect = &renderer->clip_rect;
1122
+ RECT r;
1123
+ HRESULT result;
1124
+
1125
+ IDirect3DDevice9_SetRenderState(data->device, D3DRS_SCISSORTESTENABLE, TRUE);
1126
+ r.left = renderer->viewport.x + rect->x;
1127
+ r.top = renderer->viewport.y + rect->y;
1128
+ r.right = renderer->viewport.x + rect->x + rect->w;
1129
+ r.bottom = renderer->viewport.y + rect->y + rect->h;
1130
+
1131
+ result = IDirect3DDevice9_SetScissorRect(data->device, &r);
1132
+ if (result != D3D_OK) {
1133
+ D3D_SetError("SetScissor()", result);
1134
+ return -1;
1135
+ }
1136
+ } else {
1137
+ IDirect3DDevice9_SetRenderState(data->device, D3DRS_SCISSORTESTENABLE, FALSE);
1138
+ }
1139
+ return 0;
1140
+ }
1141
+
1142
+ static int
1143
+ D3D_RenderClear(SDL_Renderer * renderer)
1144
+ {
1145
+ D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
1146
+ DWORD color;
1147
+ HRESULT result;
1148
+ int BackBufferWidth, BackBufferHeight;
1149
+
1150
+ if (D3D_ActivateRenderer(renderer) < 0) {
1151
+ return -1;
1152
+ }
1153
+
1154
+ color = D3DCOLOR_ARGB(renderer->a, renderer->r, renderer->g, renderer->b);
1155
+
1156
+ if (renderer->target) {
1157
+ BackBufferWidth = renderer->target->w;
1158
+ BackBufferHeight = renderer->target->h;
1159
+ } else {
1160
+ BackBufferWidth = data->pparams.BackBufferWidth;
1161
+ BackBufferHeight = data->pparams.BackBufferHeight;
1162
+ }
1163
+
1164
+ if (renderer->clipping_enabled) {
1165
+ IDirect3DDevice9_SetRenderState(data->device, D3DRS_SCISSORTESTENABLE, FALSE);
1166
+ }
1167
+
1168
+ /* Don't reset the viewport if we don't have to! */
1169
+ if (!renderer->viewport.x && !renderer->viewport.y &&
1170
+ renderer->viewport.w == BackBufferWidth &&
1171
+ renderer->viewport.h == BackBufferHeight) {
1172
+ result = IDirect3DDevice9_Clear(data->device, 0, NULL, D3DCLEAR_TARGET, color, 0.0f, 0);
1173
+ } else {
1174
+ D3DVIEWPORT9 viewport;
1175
+
1176
+ /* Clear is defined to clear the entire render target */
1177
+ viewport.X = 0;
1178
+ viewport.Y = 0;
1179
+ viewport.Width = BackBufferWidth;
1180
+ viewport.Height = BackBufferHeight;
1181
+ viewport.MinZ = 0.0f;
1182
+ viewport.MaxZ = 1.0f;
1183
+ IDirect3DDevice9_SetViewport(data->device, &viewport);
1184
+
1185
+ result = IDirect3DDevice9_Clear(data->device, 0, NULL, D3DCLEAR_TARGET, color, 0.0f, 0);
1186
+
1187
+ /* Reset the viewport */
1188
+ viewport.X = renderer->viewport.x;
1189
+ viewport.Y = renderer->viewport.y;
1190
+ viewport.Width = renderer->viewport.w;
1191
+ viewport.Height = renderer->viewport.h;
1192
+ viewport.MinZ = 0.0f;
1193
+ viewport.MaxZ = 1.0f;
1194
+ IDirect3DDevice9_SetViewport(data->device, &viewport);
1195
+ }
1196
+
1197
+ if (renderer->clipping_enabled) {
1198
+ IDirect3DDevice9_SetRenderState(data->device, D3DRS_SCISSORTESTENABLE, TRUE);
1199
+ }
1200
+
1201
+ if (FAILED(result)) {
1202
+ return D3D_SetError("Clear()", result);
1203
+ }
1204
+ return 0;
1205
+ }
1206
+
1207
+ static void
1208
+ D3D_SetBlendMode(D3D_RenderData * data, SDL_BlendMode blendMode)
1209
+ {
1210
+ if (blendMode == SDL_BLENDMODE_NONE) {
1211
+ IDirect3DDevice9_SetRenderState(data->device, D3DRS_ALPHABLENDENABLE, FALSE);
1212
+ } else {
1213
+ IDirect3DDevice9_SetRenderState(data->device, D3DRS_ALPHABLENDENABLE, TRUE);
1214
+ IDirect3DDevice9_SetRenderState(data->device, D3DRS_SRCBLEND,
1215
+ GetBlendFunc(SDL_GetBlendModeSrcColorFactor(blendMode)));
1216
+ IDirect3DDevice9_SetRenderState(data->device, D3DRS_DESTBLEND,
1217
+ GetBlendFunc(SDL_GetBlendModeDstColorFactor(blendMode)));
1218
+ if (data->enableSeparateAlphaBlend) {
1219
+ IDirect3DDevice9_SetRenderState(data->device, D3DRS_SRCBLENDALPHA,
1220
+ GetBlendFunc(SDL_GetBlendModeSrcAlphaFactor(blendMode)));
1221
+ IDirect3DDevice9_SetRenderState(data->device, D3DRS_DESTBLENDALPHA,
1222
+ GetBlendFunc(SDL_GetBlendModeDstAlphaFactor(blendMode)));
1223
+ }
1224
+ }
1225
+ }
1226
+
1227
+ static int
1228
+ D3D_RenderDrawPoints(SDL_Renderer * renderer, const SDL_FPoint * points,
1229
+ int count)
1230
+ {
1231
+ D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
1232
+ DWORD color;
1233
+ Vertex *vertices;
1234
+ int i;
1235
+ HRESULT result;
1236
+
1237
+ if (D3D_ActivateRenderer(renderer) < 0) {
1238
+ return -1;
1239
+ }
1240
+
1241
+ D3D_SetBlendMode(data, renderer->blendMode);
1242
+
1243
+ result =
1244
+ IDirect3DDevice9_SetTexture(data->device, 0,
1245
+ (IDirect3DBaseTexture9 *) 0);
1246
+ if (FAILED(result)) {
1247
+ return D3D_SetError("SetTexture()", result);
1248
+ }
1249
+
1250
+ color = D3DCOLOR_ARGB(renderer->a, renderer->r, renderer->g, renderer->b);
1251
+
1252
+ vertices = SDL_stack_alloc(Vertex, count);
1253
+ for (i = 0; i < count; ++i) {
1254
+ vertices[i].x = points[i].x;
1255
+ vertices[i].y = points[i].y;
1256
+ vertices[i].z = 0.0f;
1257
+ vertices[i].color = color;
1258
+ vertices[i].u = 0.0f;
1259
+ vertices[i].v = 0.0f;
1260
+ }
1261
+ result =
1262
+ IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_POINTLIST, count,
1263
+ vertices, sizeof(*vertices));
1264
+ SDL_stack_free(vertices);
1265
+ if (FAILED(result)) {
1266
+ return D3D_SetError("DrawPrimitiveUP()", result);
1267
+ }
1268
+ return 0;
1269
+ }
1270
+
1271
+ static int
1272
+ D3D_RenderDrawLines(SDL_Renderer * renderer, const SDL_FPoint * points,
1273
+ int count)
1274
+ {
1275
+ D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
1276
+ DWORD color;
1277
+ Vertex *vertices;
1278
+ int i;
1279
+ HRESULT result;
1280
+
1281
+ if (D3D_ActivateRenderer(renderer) < 0) {
1282
+ return -1;
1283
+ }
1284
+
1285
+ D3D_SetBlendMode(data, renderer->blendMode);
1286
+
1287
+ result =
1288
+ IDirect3DDevice9_SetTexture(data->device, 0,
1289
+ (IDirect3DBaseTexture9 *) 0);
1290
+ if (FAILED(result)) {
1291
+ return D3D_SetError("SetTexture()", result);
1292
+ }
1293
+
1294
+ color = D3DCOLOR_ARGB(renderer->a, renderer->r, renderer->g, renderer->b);
1295
+
1296
+ vertices = SDL_stack_alloc(Vertex, count);
1297
+ for (i = 0; i < count; ++i) {
1298
+ vertices[i].x = points[i].x;
1299
+ vertices[i].y = points[i].y;
1300
+ vertices[i].z = 0.0f;
1301
+ vertices[i].color = color;
1302
+ vertices[i].u = 0.0f;
1303
+ vertices[i].v = 0.0f;
1304
+ }
1305
+ result =
1306
+ IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_LINESTRIP, count-1,
1307
+ vertices, sizeof(*vertices));
1308
+
1309
+ /* DirectX 9 has the same line rasterization semantics as GDI,
1310
+ so we need to close the endpoint of the line */
1311
+ if (count == 2 ||
1312
+ points[0].x != points[count-1].x || points[0].y != points[count-1].y) {
1313
+ vertices[0].x = points[count-1].x;
1314
+ vertices[0].y = points[count-1].y;
1315
+ result = IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_POINTLIST, 1, vertices, sizeof(*vertices));
1316
+ }
1317
+
1318
+ SDL_stack_free(vertices);
1319
+ if (FAILED(result)) {
1320
+ return D3D_SetError("DrawPrimitiveUP()", result);
1321
+ }
1322
+ return 0;
1323
+ }
1324
+
1325
+ static int
1326
+ D3D_RenderFillRects(SDL_Renderer * renderer, const SDL_FRect * rects,
1327
+ int count)
1328
+ {
1329
+ D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
1330
+ DWORD color;
1331
+ int i;
1332
+ float minx, miny, maxx, maxy;
1333
+ Vertex vertices[4];
1334
+ HRESULT result;
1335
+
1336
+ if (D3D_ActivateRenderer(renderer) < 0) {
1337
+ return -1;
1338
+ }
1339
+
1340
+ D3D_SetBlendMode(data, renderer->blendMode);
1341
+
1342
+ result =
1343
+ IDirect3DDevice9_SetTexture(data->device, 0,
1344
+ (IDirect3DBaseTexture9 *) 0);
1345
+ if (FAILED(result)) {
1346
+ return D3D_SetError("SetTexture()", result);
1347
+ }
1348
+
1349
+ color = D3DCOLOR_ARGB(renderer->a, renderer->r, renderer->g, renderer->b);
1350
+
1351
+ for (i = 0; i < count; ++i) {
1352
+ const SDL_FRect *rect = &rects[i];
1353
+
1354
+ minx = rect->x;
1355
+ miny = rect->y;
1356
+ maxx = rect->x + rect->w;
1357
+ maxy = rect->y + rect->h;
1358
+
1359
+ vertices[0].x = minx;
1360
+ vertices[0].y = miny;
1361
+ vertices[0].z = 0.0f;
1362
+ vertices[0].color = color;
1363
+ vertices[0].u = 0.0f;
1364
+ vertices[0].v = 0.0f;
1365
+
1366
+ vertices[1].x = maxx;
1367
+ vertices[1].y = miny;
1368
+ vertices[1].z = 0.0f;
1369
+ vertices[1].color = color;
1370
+ vertices[1].u = 0.0f;
1371
+ vertices[1].v = 0.0f;
1372
+
1373
+ vertices[2].x = maxx;
1374
+ vertices[2].y = maxy;
1375
+ vertices[2].z = 0.0f;
1376
+ vertices[2].color = color;
1377
+ vertices[2].u = 0.0f;
1378
+ vertices[2].v = 0.0f;
1379
+
1380
+ vertices[3].x = minx;
1381
+ vertices[3].y = maxy;
1382
+ vertices[3].z = 0.0f;
1383
+ vertices[3].color = color;
1384
+ vertices[3].u = 0.0f;
1385
+ vertices[3].v = 0.0f;
1386
+
1387
+ result =
1388
+ IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_TRIANGLEFAN,
1389
+ 2, vertices, sizeof(*vertices));
1390
+ if (FAILED(result)) {
1391
+ return D3D_SetError("DrawPrimitiveUP()", result);
1392
+ }
1393
+ }
1394
+ return 0;
1395
+ }
1396
+
1397
+ static void
1398
+ D3D_UpdateTextureScaleMode(D3D_RenderData *data, D3D_TextureData *texturedata, unsigned index)
1399
+ {
1400
+ if (texturedata->scaleMode != data->scaleMode[index]) {
1401
+ IDirect3DDevice9_SetSamplerState(data->device, index, D3DSAMP_MINFILTER,
1402
+ texturedata->scaleMode);
1403
+ IDirect3DDevice9_SetSamplerState(data->device, index, D3DSAMP_MAGFILTER,
1404
+ texturedata->scaleMode);
1405
+ IDirect3DDevice9_SetSamplerState(data->device, index, D3DSAMP_ADDRESSU,
1406
+ D3DTADDRESS_CLAMP);
1407
+ IDirect3DDevice9_SetSamplerState(data->device, index, D3DSAMP_ADDRESSV,
1408
+ D3DTADDRESS_CLAMP);
1409
+ data->scaleMode[index] = texturedata->scaleMode;
1410
+ }
1411
+ }
1412
+
1413
+ static int
1414
+ D3D_RenderSetupTextureState(SDL_Renderer * renderer, SDL_Texture * texture, LPDIRECT3DPIXELSHADER9 *shader)
1415
+ {
1416
+ D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
1417
+ D3D_TextureData *texturedata;
1418
+
1419
+ *shader = NULL;
1420
+
1421
+ texturedata = (D3D_TextureData *)texture->driverdata;
1422
+ if (!texturedata) {
1423
+ SDL_SetError("Texture is not currently available");
1424
+ return -1;
1425
+ }
1426
+
1427
+ D3D_UpdateTextureScaleMode(data, texturedata, 0);
1428
+
1429
+ if (D3D_BindTextureRep(data->device, &texturedata->texture, 0) < 0) {
1430
+ return -1;
1431
+ }
1432
+
1433
+ if (texturedata->yuv) {
1434
+ switch (SDL_GetYUVConversionModeForResolution(texture->w, texture->h)) {
1435
+ case SDL_YUV_CONVERSION_JPEG:
1436
+ *shader = data->shaders[SHADER_YUV_JPEG];
1437
+ break;
1438
+ case SDL_YUV_CONVERSION_BT601:
1439
+ *shader = data->shaders[SHADER_YUV_BT601];
1440
+ break;
1441
+ case SDL_YUV_CONVERSION_BT709:
1442
+ *shader = data->shaders[SHADER_YUV_BT709];
1443
+ break;
1444
+ default:
1445
+ return SDL_SetError("Unsupported YUV conversion mode");
1446
+ }
1447
+
1448
+ D3D_UpdateTextureScaleMode(data, texturedata, 1);
1449
+ D3D_UpdateTextureScaleMode(data, texturedata, 2);
1450
+
1451
+ if (D3D_BindTextureRep(data->device, &texturedata->utexture, 1) < 0) {
1452
+ return -1;
1453
+ }
1454
+ if (D3D_BindTextureRep(data->device, &texturedata->vtexture, 2) < 0) {
1455
+ return -1;
1456
+ }
1457
+ }
1458
+ return 0;
1459
+ }
1460
+
1461
+ static int
1462
+ D3D_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
1463
+ const SDL_Rect * srcrect, const SDL_FRect * dstrect)
1464
+ {
1465
+ D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
1466
+ LPDIRECT3DPIXELSHADER9 shader;
1467
+ float minx, miny, maxx, maxy;
1468
+ float minu, maxu, minv, maxv;
1469
+ DWORD color;
1470
+ Vertex vertices[4];
1471
+ HRESULT result;
1472
+
1473
+ if (D3D_ActivateRenderer(renderer) < 0) {
1474
+ return -1;
1475
+ }
1476
+
1477
+ minx = dstrect->x - 0.5f;
1478
+ miny = dstrect->y - 0.5f;
1479
+ maxx = dstrect->x + dstrect->w - 0.5f;
1480
+ maxy = dstrect->y + dstrect->h - 0.5f;
1481
+
1482
+ minu = (float) srcrect->x / texture->w;
1483
+ maxu = (float) (srcrect->x + srcrect->w) / texture->w;
1484
+ minv = (float) srcrect->y / texture->h;
1485
+ maxv = (float) (srcrect->y + srcrect->h) / texture->h;
1486
+
1487
+ color = D3DCOLOR_ARGB(texture->a, texture->r, texture->g, texture->b);
1488
+
1489
+ vertices[0].x = minx;
1490
+ vertices[0].y = miny;
1491
+ vertices[0].z = 0.0f;
1492
+ vertices[0].color = color;
1493
+ vertices[0].u = minu;
1494
+ vertices[0].v = minv;
1495
+
1496
+ vertices[1].x = maxx;
1497
+ vertices[1].y = miny;
1498
+ vertices[1].z = 0.0f;
1499
+ vertices[1].color = color;
1500
+ vertices[1].u = maxu;
1501
+ vertices[1].v = minv;
1502
+
1503
+ vertices[2].x = maxx;
1504
+ vertices[2].y = maxy;
1505
+ vertices[2].z = 0.0f;
1506
+ vertices[2].color = color;
1507
+ vertices[2].u = maxu;
1508
+ vertices[2].v = maxv;
1509
+
1510
+ vertices[3].x = minx;
1511
+ vertices[3].y = maxy;
1512
+ vertices[3].z = 0.0f;
1513
+ vertices[3].color = color;
1514
+ vertices[3].u = minu;
1515
+ vertices[3].v = maxv;
1516
+
1517
+ D3D_SetBlendMode(data, texture->blendMode);
1518
+
1519
+ if (D3D_RenderSetupTextureState(renderer, texture, &shader) < 0) {
1520
+ return -1;
1521
+ }
1522
+
1523
+ if (shader) {
1524
+ result = IDirect3DDevice9_SetPixelShader(data->device, shader);
1525
+ if (FAILED(result)) {
1526
+ return D3D_SetError("SetShader()", result);
1527
+ }
1528
+ }
1529
+ result = IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_TRIANGLEFAN, 2,
1530
+ vertices, sizeof(*vertices));
1531
+ if (FAILED(result)) {
1532
+ D3D_SetError("DrawPrimitiveUP()", result);
1533
+ }
1534
+ if (shader) {
1535
+ IDirect3DDevice9_SetPixelShader(data->device, NULL);
1536
+ }
1537
+ return FAILED(result) ? -1 : 0;
1538
+ }
1539
+
1540
+
1541
+ static int
1542
+ D3D_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture,
1543
+ const SDL_Rect * srcrect, const SDL_FRect * dstrect,
1544
+ const double angle, const SDL_FPoint * center, const SDL_RendererFlip flip)
1545
+ {
1546
+ D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
1547
+ LPDIRECT3DPIXELSHADER9 shader = NULL;
1548
+ float minx, miny, maxx, maxy;
1549
+ float minu, maxu, minv, maxv;
1550
+ float centerx, centery;
1551
+ DWORD color;
1552
+ Vertex vertices[4];
1553
+ Float4X4 modelMatrix;
1554
+ HRESULT result;
1555
+
1556
+ if (D3D_ActivateRenderer(renderer) < 0) {
1557
+ return -1;
1558
+ }
1559
+
1560
+ centerx = center->x;
1561
+ centery = center->y;
1562
+
1563
+ minx = -centerx;
1564
+ maxx = dstrect->w - centerx;
1565
+ miny = -centery;
1566
+ maxy = dstrect->h - centery;
1567
+
1568
+ minu = (float) srcrect->x / texture->w;
1569
+ maxu = (float) (srcrect->x + srcrect->w) / texture->w;
1570
+ minv = (float) srcrect->y / texture->h;
1571
+ maxv = (float) (srcrect->y + srcrect->h) / texture->h;
1572
+
1573
+ if (flip & SDL_FLIP_HORIZONTAL) {
1574
+ float tmp = maxu;
1575
+ maxu = minu;
1576
+ minu = tmp;
1577
+ }
1578
+ if (flip & SDL_FLIP_VERTICAL) {
1579
+ float tmp = maxv;
1580
+ maxv = minv;
1581
+ minv = tmp;
1582
+ }
1583
+
1584
+ color = D3DCOLOR_ARGB(texture->a, texture->r, texture->g, texture->b);
1585
+
1586
+ vertices[0].x = minx;
1587
+ vertices[0].y = miny;
1588
+ vertices[0].z = 0.0f;
1589
+ vertices[0].color = color;
1590
+ vertices[0].u = minu;
1591
+ vertices[0].v = minv;
1592
+
1593
+ vertices[1].x = maxx;
1594
+ vertices[1].y = miny;
1595
+ vertices[1].z = 0.0f;
1596
+ vertices[1].color = color;
1597
+ vertices[1].u = maxu;
1598
+ vertices[1].v = minv;
1599
+
1600
+ vertices[2].x = maxx;
1601
+ vertices[2].y = maxy;
1602
+ vertices[2].z = 0.0f;
1603
+ vertices[2].color = color;
1604
+ vertices[2].u = maxu;
1605
+ vertices[2].v = maxv;
1606
+
1607
+ vertices[3].x = minx;
1608
+ vertices[3].y = maxy;
1609
+ vertices[3].z = 0.0f;
1610
+ vertices[3].color = color;
1611
+ vertices[3].u = minu;
1612
+ vertices[3].v = maxv;
1613
+
1614
+ D3D_SetBlendMode(data, texture->blendMode);
1615
+
1616
+ if (D3D_RenderSetupTextureState(renderer, texture, &shader) < 0) {
1617
+ return -1;
1618
+ }
1619
+
1620
+ /* Rotate and translate */
1621
+ modelMatrix = MatrixMultiply(
1622
+ MatrixRotationZ((float)(M_PI * (float) angle / 180.0f)),
1623
+ MatrixTranslation(dstrect->x + center->x - 0.5f, dstrect->y + center->y - 0.5f, 0));
1624
+ IDirect3DDevice9_SetTransform(data->device, D3DTS_VIEW, (D3DMATRIX*)&modelMatrix);
1625
+
1626
+ if (shader) {
1627
+ result = IDirect3DDevice9_SetPixelShader(data->device, shader);
1628
+ if (FAILED(result)) {
1629
+ D3D_SetError("SetShader()", result);
1630
+ goto done;
1631
+ }
1632
+ }
1633
+ result = IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_TRIANGLEFAN, 2,
1634
+ vertices, sizeof(*vertices));
1635
+ if (FAILED(result)) {
1636
+ D3D_SetError("DrawPrimitiveUP()", result);
1637
+ }
1638
+ done:
1639
+ if (shader) {
1640
+ IDirect3DDevice9_SetPixelShader(data->device, NULL);
1641
+ }
1642
+
1643
+ modelMatrix = MatrixIdentity();
1644
+ IDirect3DDevice9_SetTransform(data->device, D3DTS_VIEW, (D3DMATRIX*)&modelMatrix);
1645
+
1646
+ return FAILED(result) ? -1 : 0;
1647
+ }
1648
+
1649
+ static int
1650
+ D3D_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
1651
+ Uint32 format, void * pixels, int pitch)
1652
+ {
1653
+ D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
1654
+ D3DSURFACE_DESC desc;
1655
+ LPDIRECT3DSURFACE9 backBuffer;
1656
+ LPDIRECT3DSURFACE9 surface;
1657
+ RECT d3drect;
1658
+ D3DLOCKED_RECT locked;
1659
+ HRESULT result;
1660
+
1661
+ if (data->currentRenderTarget) {
1662
+ backBuffer = data->currentRenderTarget;
1663
+ } else {
1664
+ backBuffer = data->defaultRenderTarget;
1665
+ }
1666
+
1667
+ result = IDirect3DSurface9_GetDesc(backBuffer, &desc);
1668
+ if (FAILED(result)) {
1669
+ IDirect3DSurface9_Release(backBuffer);
1670
+ return D3D_SetError("GetDesc()", result);
1671
+ }
1672
+
1673
+ result = IDirect3DDevice9_CreateOffscreenPlainSurface(data->device, desc.Width, desc.Height, desc.Format, D3DPOOL_SYSTEMMEM, &surface, NULL);
1674
+ if (FAILED(result)) {
1675
+ IDirect3DSurface9_Release(backBuffer);
1676
+ return D3D_SetError("CreateOffscreenPlainSurface()", result);
1677
+ }
1678
+
1679
+ result = IDirect3DDevice9_GetRenderTargetData(data->device, backBuffer, surface);
1680
+ if (FAILED(result)) {
1681
+ IDirect3DSurface9_Release(surface);
1682
+ IDirect3DSurface9_Release(backBuffer);
1683
+ return D3D_SetError("GetRenderTargetData()", result);
1684
+ }
1685
+
1686
+ d3drect.left = rect->x;
1687
+ d3drect.right = rect->x + rect->w;
1688
+ d3drect.top = rect->y;
1689
+ d3drect.bottom = rect->y + rect->h;
1690
+
1691
+ result = IDirect3DSurface9_LockRect(surface, &locked, &d3drect, D3DLOCK_READONLY);
1692
+ if (FAILED(result)) {
1693
+ IDirect3DSurface9_Release(surface);
1694
+ IDirect3DSurface9_Release(backBuffer);
1695
+ return D3D_SetError("LockRect()", result);
1696
+ }
1697
+
1698
+ SDL_ConvertPixels(rect->w, rect->h,
1699
+ D3DFMTToPixelFormat(desc.Format), locked.pBits, locked.Pitch,
1700
+ format, pixels, pitch);
1701
+
1702
+ IDirect3DSurface9_UnlockRect(surface);
1703
+
1704
+ IDirect3DSurface9_Release(surface);
1705
+
1706
+ return 0;
1707
+ }
1708
+
1709
+ static void
1710
+ D3D_RenderPresent(SDL_Renderer * renderer)
1711
+ {
1712
+ D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
1713
+ HRESULT result;
1714
+
1715
+ if (!data->beginScene) {
1716
+ IDirect3DDevice9_EndScene(data->device);
1717
+ data->beginScene = SDL_TRUE;
1718
+ }
1719
+
1720
+ result = IDirect3DDevice9_TestCooperativeLevel(data->device);
1721
+ if (result == D3DERR_DEVICELOST) {
1722
+ /* We'll reset later */
1723
+ return;
1724
+ }
1725
+ if (result == D3DERR_DEVICENOTRESET) {
1726
+ D3D_Reset(renderer);
1727
+ }
1728
+ result = IDirect3DDevice9_Present(data->device, NULL, NULL, NULL, NULL);
1729
+ if (FAILED(result)) {
1730
+ D3D_SetError("Present()", result);
1731
+ }
1732
+ }
1733
+
1734
+ static void
1735
+ D3D_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture)
1736
+ {
1737
+ D3D_TextureData *data = (D3D_TextureData *) texture->driverdata;
1738
+
1739
+ if (!data) {
1740
+ return;
1741
+ }
1742
+ D3D_DestroyTextureRep(&data->texture);
1743
+ D3D_DestroyTextureRep(&data->utexture);
1744
+ D3D_DestroyTextureRep(&data->vtexture);
1745
+ SDL_free(data->pixels);
1746
+ SDL_free(data);
1747
+ texture->driverdata = NULL;
1748
+ }
1749
+
1750
+ static void
1751
+ D3D_DestroyRenderer(SDL_Renderer * renderer)
1752
+ {
1753
+ D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
1754
+
1755
+ if (data) {
1756
+ int i;
1757
+
1758
+ /* Release the render target */
1759
+ if (data->defaultRenderTarget) {
1760
+ IDirect3DSurface9_Release(data->defaultRenderTarget);
1761
+ data->defaultRenderTarget = NULL;
1762
+ }
1763
+ if (data->currentRenderTarget != NULL) {
1764
+ IDirect3DSurface9_Release(data->currentRenderTarget);
1765
+ data->currentRenderTarget = NULL;
1766
+ }
1767
+ for (i = 0; i < SDL_arraysize(data->shaders); ++i) {
1768
+ if (data->shaders[i]) {
1769
+ IDirect3DPixelShader9_Release(data->shaders[i]);
1770
+ data->shaders[i] = NULL;
1771
+ }
1772
+ }
1773
+ if (data->device) {
1774
+ IDirect3DDevice9_Release(data->device);
1775
+ data->device = NULL;
1776
+ }
1777
+ if (data->d3d) {
1778
+ IDirect3D9_Release(data->d3d);
1779
+ SDL_UnloadObject(data->d3dDLL);
1780
+ }
1781
+ SDL_free(data);
1782
+ }
1783
+ SDL_free(renderer);
1784
+ }
1785
+ #endif /* SDL_VIDEO_RENDER_D3D && !SDL_RENDER_DISABLED */
1786
+
1787
+ #ifdef __WIN32__
1788
+ /* This function needs to always exist on Windows, for the Dynamic API. */
1789
+ IDirect3DDevice9 *
1790
+ SDL_RenderGetD3D9Device(SDL_Renderer * renderer)
1791
+ {
1792
+ IDirect3DDevice9 *device = NULL;
1793
+
1794
+ #if SDL_VIDEO_RENDER_D3D && !SDL_RENDER_DISABLED
1795
+ D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
1796
+
1797
+ /* Make sure that this is a D3D renderer */
1798
+ if (renderer->DestroyRenderer != D3D_DestroyRenderer) {
1799
+ SDL_SetError("Renderer is not a D3D renderer");
1800
+ return NULL;
1801
+ }
1802
+
1803
+ device = data->device;
1804
+ if (device) {
1805
+ IDirect3DDevice9_AddRef(device);
1806
+ }
1807
+ #endif /* SDL_VIDEO_RENDER_D3D && !SDL_RENDER_DISABLED */
1808
+
1809
+ return device;
1810
+ }
1811
+ #endif /* __WIN32__ */
1812
+
1813
+ /* vi: set ts=4 sw=4 expandtab: */