Skip to content
Permalink
Browse files

Merged Ryan's SDL-gui-backend branch.

Adds three APIs, and implements them on X11, Cocoa, and Windows:

- SDL_CaptureMouse()
- SDL_GetGlobalMouseState()
- SDL_SetWindowHitTest()
  • Loading branch information
icculus committed Jun 25, 2014
2 parents 8436956 + 704d9bd commit b29740b88fae87b8b4e9bb2f395f7ea6f925e0d7
Showing with 30,353 additions and 26,648 deletions.
  1. +21 −0 .hgignore
  2. +1 −1 Android.mk
  3. +12 −2 CMakeLists.txt
  4. +21 −6 Makefile.in
  5. +3 −0 README-linux.txt
  6. +104 −0 README-nacl.txt
  7. +1 −0 README-platforms.txt
  8. +4 −6 VisualC.html
  9. +1,402 −1,394 VisualC/SDL/SDL_VS2008.vcproj
  10. +480 −693 VisualC/SDL/SDL_VS2010.vcxproj
  11. +484 −484 VisualC/SDL/SDL_VS2012.vcxproj
  12. +9 −11 VisualC/SDL/SDL_VS2013.vcxproj
  13. +78 −113 VisualC/SDL_VS2008.sln
  14. +0 −218 VisualC/SDL_VS2010EE.sln
  15. +0 −257 VisualC/SDL_VS2012EE.sln
  16. +424 −424 VisualC/SDLmain/SDLmain_VS2008.vcproj
  17. +8 −7 VisualC/SDLmain/SDLmain_VS2010.vcxproj
  18. +167 −167 VisualC/SDLmain/SDLmain_VS2012.vcxproj
  19. +4 −4 VisualC/SDLmain/SDLmain_VS2013.vcxproj
  20. +480 −480 VisualC/SDLtest/SDLtest_VS2008.vcproj
  21. +192 −191 VisualC/SDLtest/SDLtest_VS2010.vcxproj
  22. +195 −195 VisualC/SDLtest/SDLtest_VS2012.vcxproj
  23. +4 −4 VisualC/SDLtest/SDLtest_VS2013.vcxproj
  24. +18 −8 VisualC/tests/checkkeys/checkkeys_VS2008.vcproj
  25. +241 −231 VisualC/tests/checkkeys/checkkeys_VS2010.vcxproj
  26. +29 −15 VisualC/tests/checkkeys/checkkeys_VS2012.vcxproj
  27. +28 −14 VisualC/tests/checkkeys/checkkeys_VS2013.vcxproj
  28. +42 −8 VisualC/tests/loopwave/loopwave_VS2008.vcproj
  29. +226 −235 VisualC/tests/loopwave/loopwave_VS2010.vcxproj
  30. +30 −35 VisualC/tests/loopwave/loopwave_VS2012.vcxproj
  31. +29 −34 VisualC/tests/loopwave/loopwave_VS2013.vcxproj
  32. +18 −8 VisualC/tests/testatomic/testatomic_VS2008.vcproj
  33. +11 −33 VisualC/tests/testatomic/testatomic_VS2010.vcxproj
  34. +7 −29 VisualC/tests/testatomic/testatomic_VS2012.vcxproj
  35. +7 −29 VisualC/tests/testatomic/testatomic_VS2013.vcxproj
  36. +29 −12 VisualC/tests/testautomation/testautomation_VS2008.vcproj
  37. +194 −216 VisualC/tests/testautomation/testautomation_vs2010.vcxproj
  38. +16 −32 VisualC/tests/testautomation/testautomation_vs2012.vcxproj
  39. +15 −31 VisualC/tests/testautomation/testautomation_vs2013.vcxproj
  40. +25 −8 VisualC/tests/testdraw2/testdraw2_VS2008.vcproj
  41. +212 −234 VisualC/tests/testdraw2/testdraw2_VS2010.vcxproj
  42. +16 −32 VisualC/tests/testdraw2/testdraw2_VS2012.vcxproj
  43. +15 −31 VisualC/tests/testdraw2/testdraw2_VS2013.vcxproj
  44. +18 −8 VisualC/tests/testfile/testfile_VS2008.vcproj
  45. +209 −231 VisualC/tests/testfile/testfile_VS2010.vcxproj
  46. +14 −32 VisualC/tests/testfile/testfile_VS2012.vcxproj
  47. +13 −31 VisualC/tests/testfile/testfile_VS2013.vcxproj
  48. +253 −227 VisualC/tests/testgamecontroller/testgamecontroller_VS2010.vcxproj
  49. +58 −32 VisualC/tests/testgamecontroller/testgamecontroller_VS2012.vcxproj
  50. +57 −43 VisualC/tests/testgamecontroller/testgamecontroller_VS2013.vcxproj
  51. +18 −8 VisualC/tests/testgesture/testgesture_VS2008.vcproj
  52. +209 −227 VisualC/tests/testgesture/testgesture_VS2010.vcxproj
  53. +14 −32 VisualC/tests/testgesture/testgesture_VS2012.vcxproj
  54. +14 −32 VisualC/tests/testgesture/testgesture_VS2013.vcxproj
  55. +25 −8 VisualC/tests/testgl2/testgl2_VS2008.vcproj
  56. +216 −238 VisualC/tests/testgl2/testgl2_VS2010.vcxproj
  57. +16 −32 VisualC/tests/testgl2/testgl2_VS2012.vcxproj
  58. +15 −31 VisualC/tests/testgl2/testgl2_VS2013.vcxproj
  59. +217 −207 VisualC/tests/testgles2/testgles2_VS2008.vcproj
  60. +216 −238 VisualC/tests/testgles2/testgles2_VS2010.vcxproj
  61. +220 −236 VisualC/tests/testgles2/testgles2_VS2012.vcxproj
  62. +219 −235 VisualC/tests/testgles2/testgles2_VS2013.vcxproj
  63. +18 −8 VisualC/tests/testjoystick/testjoystick_VS2008.vcproj
  64. +209 −227 VisualC/tests/testjoystick/testjoystick_VS2010.vcxproj
  65. +14 −32 VisualC/tests/testjoystick/testjoystick_VS2012.vcxproj
  66. +13 −31 VisualC/tests/testjoystick/testjoystick_VS2013.vcxproj
  67. +42 −8 VisualC/tests/testoverlay2/testoverlay2_VS2008.vcproj
  68. +31 −36 VisualC/tests/testoverlay2/testoverlay2_VS2010.vcxproj
  69. +31 −36 VisualC/tests/testoverlay2/testoverlay2_VS2012.vcxproj
  70. +30 −35 VisualC/tests/testoverlay2/testoverlay2_VS2013.vcxproj
  71. +18 −8 VisualC/tests/testplatform/testplatform_VS2008.vcproj
  72. +227 −250 VisualC/tests/testplatform/testplatform_VS2010.vcxproj
  73. +15 −33 VisualC/tests/testplatform/testplatform_VS2012.vcxproj
  74. +14 −32 VisualC/tests/testplatform/testplatform_VS2013.vcxproj
  75. +18 −8 VisualC/tests/testpower/testpower_VS2008.vcproj
  76. +209 −234 VisualC/tests/testpower/testpower_VS2010.vcxproj
  77. +14 −32 VisualC/tests/testpower/testpower_VS2012.vcxproj
  78. +13 −31 VisualC/tests/testpower/testpower_VS2013.vcxproj
  79. +73 −8 VisualC/tests/testrendertarget/testrendertarget_VS2008.vcproj
  80. +40 −41 VisualC/tests/testrendertarget/testrendertarget_VS2010.vcxproj
  81. +40 −40 VisualC/tests/testrendertarget/testrendertarget_VS2012.vcxproj
  82. +36 −36 VisualC/tests/testrendertarget/testrendertarget_VS2013.vcxproj
  83. +19 −9 VisualC/tests/testrumble/testrumble_VS2008.vcproj
  84. +209 −234 VisualC/tests/testrumble/testrumble_VS2010.vcxproj
  85. +14 −32 VisualC/tests/testrumble/testrumble_VS2012.vcxproj
  86. +13 −31 VisualC/tests/testrumble/testrumble_VS2013.vcxproj
  87. +73 −8 VisualC/tests/testscale/testscale_VS2008.vcproj
  88. +40 −40 VisualC/tests/testscale/testscale_VS2010.vcxproj
  89. +40 −40 VisualC/tests/testscale/testscale_VS2012.vcxproj
  90. +36 −36 VisualC/tests/testscale/testscale_VS2013.vcxproj
  91. +18 −8 VisualC/tests/testshape/testshape_VS2008.vcproj
  92. +209 −231 VisualC/tests/testshape/testshape_VS2010.vcxproj
  93. +14 −32 VisualC/tests/testshape/testshape_VS2012.vcxproj
  94. +13 −31 VisualC/tests/testshape/testshape_VS2013.vcxproj
  95. +49 −8 VisualC/tests/testsprite2/testsprite2_VS2008.vcproj
  96. +228 −238 VisualC/tests/testsprite2/testsprite2_VS2010.vcxproj
  97. +32 −36 VisualC/tests/testsprite2/testsprite2_VS2012.vcxproj
  98. +31 −35 VisualC/tests/testsprite2/testsprite2_VS2013.vcxproj
  99. +15 −31 VisualC/visualtest/unittest/testquit/testquit_VS2012.vcxproj
  100. +57 −61 VisualC/visualtest/visualtest_VS2012.vcxproj
  101. +1 −0 WhatsNew.txt
  102. +0 −8 Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj
  103. +41 −9 Xcode/SDL/SDL.xcodeproj/project.pbxproj
  104. +64 −156 Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj
  105. +115 −14 android-project/src/org/libsdl/app/SDLActivity.java
  106. +27 −0 build-scripts/config.sub
  107. +57 −0 build-scripts/nacl-buildbot.sh
  108. +105 −0 build-scripts/naclbuild.sh
  109. +18 −0 cmake_uninstall.cmake.in
  110. +220 −10 configure
  111. +120 −10 configure.in
  112. +1 −0 debian/control
  113. +1 −1 include/SDL_assert.h
  114. +3 −0 include/SDL_config.h.cmake
  115. +7 −0 include/SDL_config.h.in
  116. +3 −0 include/SDL_config_android.h
  117. +5 −1 include/SDL_config_iphoneos.h
  118. +3 −0 include/SDL_config_macosx.h
  119. +3 −0 include/SDL_config_pandora.h
  120. +3 −0 include/SDL_config_psp.h
  121. +3 −0 include/SDL_config_windows.h
  122. +3 −0 include/SDL_config_winrt.h
  123. +3 −0 include/SDL_config_wiz.h
  124. +1 −1 include/SDL_error.h
  125. +42 −0 include/SDL_hints.h
  126. +8 −8 include/SDL_log.h
  127. +9 −0 include/SDL_main.h
  128. +10 −0 include/SDL_mouse.h
  129. +4 −11,045 include/SDL_opengl.h
  130. +11,167 −0 include/SDL_opengl_glext.h
  131. +5 −2,746 include/SDL_opengles2.h
  132. +621 −0 include/SDL_opengles2_gl2.h
  133. +2,050 −0 include/SDL_opengles2_gl2ext.h
  134. +30 −0 include/SDL_opengles2_gl2platform.h
  135. +282 −0 include/SDL_opengles2_khrplatform.h
  136. +18 −1 include/SDL_platform.h
  137. +0 −1 include/SDL_rwops.h
  138. +80 −12 include/SDL_stdinc.h
  139. +0 −1 include/SDL_system.h
  140. +16 −2 include/SDL_syswm.h
  141. +3 −3 include/SDL_test_assert.h
  142. +2 −2 include/SDL_test_log.h
  143. +8 −0 include/begin_code.h
  144. +2 −1 premake/README-ios.txt
  145. +2 −0 src/SDL.c
  146. +1 −1 src/SDL_error.c
  147. +12 −11 src/SDL_log.c
  148. +8 −1 src/audio/SDL_audio.c
  149. +100 −100 src/audio/SDL_audiotypecvt.c
  150. +7 −6 src/audio/SDL_wave.c
  151. +1 −0 src/audio/SDL_wave.h
  152. +147 −0 src/audio/nacl/SDL_naclaudio.c
  153. +41 −0 src/audio/nacl/SDL_naclaudio.h
  154. +2 −1 src/audio/sdlgenaudiocvt.pl
  155. +20 −15 src/audio/sndio/SDL_sndioaudio.c
  156. +16 −1 src/core/android/SDL_android.c
  157. +236 −0 src/core/linux/SDL_dbus.c
  158. +79 −0 src/core/linux/SDL_dbus.h
  159. +593 −0 src/core/linux/SDL_ibus.c
  160. +58 −0 src/core/linux/SDL_ibus.h
  161. +7 −7 src/dynapi/SDL_dynapi.c
  162. +1 −1 src/dynapi/SDL_dynapi.h
  163. +5 −0 src/dynapi/SDL_dynapi_overrides.h
  164. +25 −21 src/dynapi/SDL_dynapi_procs.h
  165. +2 −16 src/events/SDL_events.c
  166. +2 −1 src/events/SDL_gesture.c
  167. +26 −38 src/events/SDL_mouse.c
  168. +4 −1 src/events/SDL_mouse_c.h
  169. +4 −0 src/file/SDL_rwops.c
  170. +16 −19 src/{joystick/iphoneos/SDLUIAccelerationDelegate.h → filesystem/nacl/SDL_sysfilesystem.c}
  171. +1 −1 src/filesystem/unix/SDL_sysfilesystem.c
  172. +4 −4 src/haptic/darwin/SDL_syshaptic.c
  173. +2 −0 src/haptic/linux/SDL_syshaptic.c
  174. +1 −1 src/joystick/SDL_gamecontroller.c
  175. +3 −2 src/joystick/SDL_gamecontrollerdb.h
  176. +59 −85 src/joystick/SDL_joystick.c
  177. +0 −3 src/joystick/SDL_joystick_c.h
  178. +4 −8 src/joystick/SDL_sysjoystick.h
  179. +0 −5 src/joystick/android/SDL_sysjoystick.c
  180. +0 −5 src/joystick/bsd/SDL_sysjoystick.c
  181. +1 −6 src/joystick/darwin/SDL_sysjoystick.c
  182. +0 −5 src/joystick/dummy/SDL_sysjoystick.c
  183. +0 −5 src/joystick/haiku/SDL_haikujoystick.cc
  184. +0 −141 src/joystick/iphoneos/SDLUIAccelerationDelegate.m
  185. +64 −27 src/joystick/iphoneos/SDL_sysjoystick.m
  186. +0 −9 src/joystick/linux/SDL_sysjoystick.c
  187. +0 −5 src/joystick/psp/SDL_sysjoystick.c
  188. +331 −353 src/joystick/windows/SDL_dxjoystick.c
  189. +42 −6 src/joystick/windows/SDL_dxjoystick_c.h
  190. +0 −5 src/joystick/windows/SDL_mmjoystick.c
  191. +0 −8 src/joystick/winrt/SDL_xinputjoystick.c
  192. +118 −0 src/libm/k_tan.c
  193. +1 −0 src/libm/math_libm.h
  194. +1 −0 src/libm/math_private.h
  195. +67 −0 src/libm/s_tan.c
  196. +93 −0 src/main/nacl/SDL_nacl_main.c
  197. +2 −2 src/power/SDL_power.c
  198. +221 −175 src/render/direct3d/SDL_render_d3d.c
  199. +23 −15 src/render/opengl/SDL_render_gl.c
  200. +22 −15 src/render/opengles/SDL_render_gles.c
  201. +2 −2 src/render/opengles2/SDL_gles2funcs.h
  202. +279 −89 src/render/opengles2/SDL_render_gles2.c
  203. +45 −0 src/render/opengles2/SDL_shaders_gles2.c
  204. +2 −1 src/render/opengles2/SDL_shaders_gles2.h
  205. +6 −6 src/render/software/SDL_render_sw.c
  206. +2 −1 src/stdlib/SDL_iconv.c
  207. +30 −0 src/stdlib/SDL_stdlib.c
  208. +18 −12 src/stdlib/SDL_string.c
  209. +5 −5 src/test/SDL_test_assert.c
  210. +0 −2 src/test/SDL_test_common.c
  211. +1 −1 src/test/SDL_test_harness.c
  212. +2 −2 src/test/SDL_test_log.c
  213. +3 −3 src/thread/SDL_thread.c
  214. +2 −0 src/thread/pthread/SDL_sysmutex.c
  215. +1 −1 src/thread/pthread/SDL_syssem.c
  216. +11 −1 src/thread/pthread/SDL_systhread.c
  217. +7 −0 src/timer/unix/SDL_systimer.c
  218. +288 −285 src/video/SDL_RLEaccel.c
  219. +9 −9 src/video/SDL_blit.h
  220. +2 −2 src/video/SDL_blit_A.c
  221. +5 −4 src/video/SDL_egl.c
  222. +3 −0 src/video/SDL_sysvideo.h
  223. +96 −73 src/video/SDL_video.c
  224. +1 −0 src/video/android/SDL_androidvideo.c
  225. +20 −1 src/video/android/SDL_androidwindow.c
  226. +1 −0 src/video/android/SDL_androidwindow.h
  227. +4 −0 src/video/cocoa/SDL_cocoakeyboard.m
  228. +1 −1 src/video/cocoa/SDL_cocoamessagebox.m
  229. +3 −3 src/video/cocoa/SDL_cocoamodes.m
  230. +38 −1 src/video/cocoa/SDL_cocoamouse.m
  231. +42 −11 src/video/cocoa/SDL_cocoawindow.m
  232. +4 −4 src/video/mir/SDL_mirevents.c
  233. +7 −0 src/video/mir/SDL_mirmouse.c
  234. +432 −0 src/video/nacl/SDL_naclevents.c
  235. +30 −0 src/video/nacl/SDL_naclevents_c.h
  236. +24 −0 src/video/nacl/SDL_naclglue.c
  237. +171 −0 src/video/nacl/SDL_naclopengles.c
  238. +38 −0 src/video/nacl/SDL_naclopengles.h
  239. +183 −0 src/video/nacl/SDL_naclvideo.c
  240. +67 −0 src/video/nacl/SDL_naclvideo.h
  241. +79 −0 src/video/nacl/SDL_naclwindow.c
  242. +32 −0 src/video/nacl/SDL_naclwindow.h
  243. +9 −0 src/video/raspberry/SDL_rpimouse.c
  244. +0 −2 src/video/uikit/SDL_uikitmodes.h
  245. +33 −92 src/video/uikit/SDL_uikitmodes.m
  246. +1 −1 src/video/uikit/SDL_uikitopenglview.h
  247. +3 −8 src/video/uikit/SDL_uikitopenglview.m
  248. +6 −8 src/video/uikit/SDL_uikitview.m
  249. +23 −23 src/video/uikit/SDL_uikitwindow.m
  250. +7 −1 src/video/wayland/SDL_waylandmouse.c
  251. +1 −1 src/video/wayland/SDL_waylandtouch.c
  252. +106 −106 src/video/windows/SDL_windowsevents.c
  253. +5 −3 src/video/windows/SDL_windowsmodes.c
  254. +12 −1 src/video/windows/SDL_windowsmouse.c
  255. +2 −0 src/video/windows/SDL_windowsopengles.c
  256. +76 −22 src/video/windows/SDL_windowsvideo.c
  257. +2 −0 src/video/windows/SDL_windowsvideo.h
  258. +18 −15 src/video/windows/SDL_windowswindow.c
  259. +3 −2 src/video/windows/SDL_windowswindow.h
  260. +5 −5 src/video/windows/wmmsg.h
  261. +124 −7 src/video/x11/SDL_x11events.c
  262. +36 −0 src/video/x11/SDL_x11keyboard.c
  263. +3 −0 src/video/x11/SDL_x11keyboard.h
  264. +4 −1 src/video/x11/SDL_x11modes.c
  265. +10 −0 src/video/x11/SDL_x11mouse.c
  266. +24 −15 src/video/x11/SDL_x11opengl.c
  267. +6 −217 src/video/x11/SDL_x11video.c
  268. +2 −10 src/video/x11/SDL_x11video.h
  269. +2 −1 src/video/x11/SDL_x11window.c
  270. +1 −1 src/video/x11/edid-parse.c
  271. +1 −1 test/controllermap.c
  272. +2 −2 test/loopwave.c
  273. +63 −0 test/nacl/Makefile
  274. +40 −0 test/nacl/background.js
  275. +469 −0 test/nacl/common.js
  276. +21 −0 test/nacl/index.html
  277. +22 −0 test/nacl/manifest.json
  278. +1 −0 test/testatomic.c
  279. +4 −4 test/testautomation_audio.c
  280. +5 −27 test/testgesture.c
  281. +25 −21 test/testgles2.c
  282. +3 −1 test/testmultiaudio.c
@@ -39,6 +39,27 @@ Release
*.ncb
*.suo
*.sdf
VisualC/tests/loopwave/sample.wav
VisualC/tests/testautomation/CompareSurfaces0001_Reference.bmp
VisualC/tests/testautomation/CompareSurfaces0001_TestOutput.bmp
VisualC/tests/testgamecontroller/axis.bmp
VisualC/tests/testgamecontroller/button.bmp
VisualC/tests/testgamecontroller/controllermap.bmp
VisualC/tests/testoverlay2/moose.dat
VisualC/tests/testrendertarget/icon.bmp
VisualC/tests/testrendertarget/sample.bmp
VisualC/tests/testscale/icon.bmp
VisualC/tests/testscale/sample.bmp
VisualC/tests/testsprite2/icon.bmp
VisualC/visualtest/icon.bmp
VisualC/visualtest/testquit.actions
VisualC/visualtest/testquit.config
VisualC/visualtest/testquit.exe
VisualC/visualtest/testquit.parameters
VisualC/visualtest/testsprite2.exe
VisualC/visualtest/testsprite2_sample.actions
VisualC/visualtest/testsprite2_sample.config
VisualC/visualtest/testsprite2_sample.parameters

# for Android
android-project/local.properties
@@ -61,7 +61,7 @@ LOCAL_MODULE := SDL2_static

LOCAL_MODULE_FILENAME := libSDL2

LOCAL_SRC_FILES += $(LOCAL_PATH)/src/main/android/SDL_android_main.c
LOCAL_SRC_FILES += $(subst $(LOCAL_PATH)/,,$(LOCAL_PATH)/src/main/android/SDL_android_main.c)

LOCAL_LDLIBS :=
LOCAL_EXPORT_LDLIBS := -Wl,--undefined=Java_org_libsdl_app_SDLActivity_nativeInit -ldl -lGLESv1_CM -lGLESv2 -llog -landroid
@@ -334,6 +334,7 @@ if(USE_GCC OR USE_CLANG)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-multichar")
endif()
endif()
#check_c_compiler_flag(-Wshadow HAVE_GCC_WSHADOW)
endif()

if(ASSEMBLY)
@@ -494,7 +495,7 @@ if(LIBC)
strlen _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa
_ultoa strtol strtoul strtoll strtod atoi atof strcmp strncmp
_stricmp _strnicmp sscanf atan atan2 acos asin ceil copysign cos
cosf fabs floor log pow scalbn sin sinf sqrt)
cosf fabs floor log pow scalbn sin sinf sqrt sqrtf tan tanf)
string(TOUPPER ${_FN} _UPPER)
set(HAVE_${_UPPER} 1)
endforeach()
@@ -541,7 +542,7 @@ if(LIBC)
set(CMAKE_REQUIRED_LIBRARIES m)
foreach(_FN
atan atan2 ceil copysign cos cosf fabs floor log pow scalbn sin
sinf sqrt)
sinf sqrt sqrtf tan tanf)
string(TOUPPER ${_FN} _UPPER)
set(_HAVEVAR "HAVE_${_UPPER}")
check_function_exists("${_FN}" ${_HAVEVAR})
@@ -1308,3 +1309,12 @@ else()
install(TARGETS SDL2 RUNTIME DESTINATION bin)
endif()

##### Uninstall target #####

configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)

add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
@@ -42,15 +42,25 @@ SDLTEST_OBJECTS = @SDLTEST_OBJECTS@
SRC_DIST = *.txt acinclude Android.mk autogen.sh android-project build-scripts cmake configure configure.in debian include Makefile.* sdl2-config.in sdl2.m4 sdl2.pc.in SDL2.spec.in src test VisualC.html VisualC Xcode Xcode-iOS
GEN_DIST = SDL2.spec

ifneq ($V,1)
RUN_CMD_AR = @echo " AR " $@;
RUN_CMD_CC = @echo " CC " $@;
RUN_CMD_CXX = @echo " CXX " $@;
RUN_CMD_LTLINK = @echo " LTLINK" $@;
RUN_CMD_RANLIB = @echo " RANLIB" $@;
LIBTOOL += --quiet
endif

HDRS = \
SDL.h \
SDL_assert.h \
SDL_atomic.h \
SDL_audio.h \
SDL_bits.h \
SDL_bits.h \
SDL_blendmode.h \
SDL_clipboard.h \
SDL_cpuinfo.h \
SDL_egl.h \
SDL_endian.h \
SDL_error.h \
SDL_events.h \
@@ -70,8 +80,13 @@ HDRS = \
SDL_mutex.h \
SDL_name.h \
SDL_opengl.h \
SDL_opengl_glext.h \
SDL_opengles.h \
SDL_opengles2_gl2ext.h \
SDL_opengles2_gl2.h \
SDL_opengles2_gl2platform.h \
SDL_opengles2.h \
SDL_opengles2_khrplatform.h \
SDL_pixels.h \
SDL_platform.h \
SDL_power.h \
@@ -123,15 +138,15 @@ update-revision:
.PHONY: all update-revision install install-bin install-hdrs install-lib install-data uninstall uninstall-bin uninstall-hdrs uninstall-lib uninstall-data clean distclean dist $(OBJECTS:.lo=.d)

$(objects)/$(TARGET): $(OBJECTS) $(VERSION_OBJECTS)
$(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ $(OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
$(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ $(OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)

$(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS)
$(AR) cru $@ $(SDLMAIN_OBJECTS)
$(RANLIB) $@
$(RUN_CMD_AR)$(AR) cru $@ $(SDLMAIN_OBJECTS)
$(RUN_CMD_RANLIB)$(RANLIB) $@

$(objects)/$(SDLTEST_TARGET): $(SDLTEST_OBJECTS)
$(AR) cru $@ $(SDLTEST_OBJECTS)
$(RANLIB) $@
$(RUN_CMD_AR)$(AR) cru $@ $(SDLTEST_OBJECTS)
$(RUN_CMD_RANLIB)$(RANLIB) $@

install: all install-bin install-hdrs install-lib install-data
install-bin:
@@ -22,6 +22,9 @@ libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxxf86vm-dev \
libxss-dev libgl1-mesa-dev libesd0-dev libdbus-1-dev libudev-dev \
libgles1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev

Ubuntu 14.04 can also add "libwayland-dev libmirclient-dev libxkbcommon-dev"
to that command line for Wayland and Mir support.

NOTES:
- This includes all the audio targets except arts, because Ubuntu pulled the
artsc0-dev package, but in theory SDL still supports it.
@@ -0,0 +1,104 @@
================================================================================
Simple DirectMedia Layer for Native Client
================================================================================

Requirements:

* Native Client SDK (https://developer.chrome.com/native-client),
(tested with Pepper version 33 or higher).

The SDL backend for Chrome's Native Client has been tested only with the PNaCl
toolchain, which generates binaries designed to run on ARM and x86_32/64
platforms. This does not mean it won't work with the other toolchains!

================================================================================
Building SDL for NaCl
================================================================================

Set up the right environment variables (see naclbuild.sh), then configure SDL with:

configure --host=pnacl --prefix some/install/destination

Then "make".

As an example of how to create a deployable app a Makefile project is provided
in test/nacl/Makefile, which includes some monkey patching of the common.mk file
provided by NaCl, without which linking properly to SDL won't work (the search
path can't be modified externally, so the linker won't find SDL's binaries unless
you dump them into the SDK path, which is inconvenient).
Also provided in test/nacl is the required support file, such as index.html,
manifest.json, etc.
SDL apps for NaCl run on a worker thread using the ppapi_simple infrastructure.
This allows for blocking calls on all the relevant systems (OpenGL ES, filesystem),
hiding the asynchronous nature of the browser behind the scenes...which is not the
same as making it disappear!


================================================================================
Running tests
================================================================================

Due to the nature of NaCl programs, building and running SDL tests is not as
straightforward as one would hope. The script naclbuild.sh in build-scripts
automates the process and should serve as a guide for users of SDL trying to build
their own applications.

Basic usage:

./naclbuild.sh path/to/pepper/toolchain (i.e. ~/naclsdk/pepper_35)

This will build testgles2.c by default.

If you want to build a different test, for example testrendercopyex.c:

SOURCES=~/sdl/SDL/test/testrendercopyex.c ./naclbuild.sh ~/naclsdk/pepper_35

Once the build finishes, you have to serve the contents with a web server (the
script will give you instructions on how to do that with Python).

================================================================================
RWops and nacl_io
================================================================================

SDL_RWops work transparently with nacl_io. Two functions control the mount points:

int mount(const char* source, const char* target,
const char* filesystemtype,
unsigned long mountflags, const void *data);
int umount(const char *target);

For convenience, SDL will by default mount an httpfs tree at / before calling
the app's main function. Such setting can be overridden by calling:

umount("/");

And then mounting a different filesystem at /

It's important to consider that the asynchronous nature of file operations on a
browser is hidden from the application, effectively providing the developer with
a set of blocking file operations just like you get in a regular desktop
environment, which eases the job of porting to Native Client, but also introduces
a set of challenges of its own, in particular when big file sizes and slow
connections are involved.

For more information on how nacl_io and mount points work, see:

https://developer.chrome.com/native-client/devguide/coding/nacl_io
https://src.chromium.org/chrome/trunk/src/native_client_sdk/src/libraries/nacl_io/nacl_io.h

To be able to save into the directory "/save/" (like backup of game) :

mount("", "/save", "html5fs", 0, "type=PERSISTENT");

And add to manifest.json :

"permissions": [
"unlimitedStorage"
]

================================================================================
TODO - Known Issues
================================================================================
* Testing of all systems with a real application (something other than SDL's tests)
* Key events don't seem to work properly

@@ -25,6 +25,7 @@ Platforms supported by volunteers
Haiku - maintained by Axel Dörfler <axeld@pinc-software.de>
PSP - maintained by 527721088@qq.com
Pandora - maintained by Scott Smith <pickle136@sbcglobal.net>
NaCl - maintained by Gabriel Jacobo <gabomdq@gmail.com>

Platforms that need maintainers
===============================
@@ -22,8 +22,7 @@ <H3>
<P>
There are different solution files for the various
versions of the IDE. Please use the appropiate version
2008, 2010 or 2012; the 2010EE and 2012EE files
should be used with the "Express Edition" releases.
2008, 2010, 2012 or 2013.
</P>
<P>
Build the <CODE>.dll</CODE> and <CODE>.lib</CODE> files.
@@ -111,17 +110,16 @@ <H3>
</H3>
<P>
Now create the basic body of your project. The body of your program should take
the following form: <CODE>
<PRE>
the following form:
<PRE><CODE>
#include "SDL.h"

int main( int argc, char* argv[] )
{
// Body of the program goes here.
return 0;
}
</PRE>
</CODE>
</CODE></PRE>
<P></P>
<H3>
That's it!

0 comments on commit b29740b

Please sign in to comment.