ruby2d 0.8.1 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (192) hide show
  1. checksums.yaml +4 -4
  2. data/assets/README.md +20 -7
  3. data/assets/include/SDL2/SDL.h +135 -0
  4. data/assets/include/SDL2/SDL_assert.h +291 -0
  5. data/assets/include/SDL2/SDL_atomic.h +277 -0
  6. data/assets/include/SDL2/SDL_audio.h +826 -0
  7. data/assets/include/SDL2/SDL_bits.h +112 -0
  8. data/assets/include/SDL2/SDL_blendmode.h +120 -0
  9. data/assets/include/SDL2/SDL_clipboard.h +71 -0
  10. data/assets/include/SDL2/SDL_config.h +421 -0
  11. data/assets/include/SDL2/SDL_cpuinfo.h +188 -0
  12. data/assets/include/SDL2/SDL_egl.h +1673 -0
  13. data/assets/include/SDL2/SDL_endian.h +260 -0
  14. data/assets/include/SDL2/SDL_error.h +76 -0
  15. data/assets/include/SDL2/SDL_events.h +788 -0
  16. data/assets/include/SDL2/SDL_filesystem.h +136 -0
  17. data/assets/include/SDL2/SDL_gamecontroller.h +390 -0
  18. data/assets/include/SDL2/SDL_gesture.h +87 -0
  19. data/assets/include/SDL2/SDL_haptic.h +1238 -0
  20. data/assets/include/SDL2/SDL_hints.h +1135 -0
  21. data/assets/include/SDL2/SDL_image.h +161 -0
  22. data/assets/include/SDL2/SDL_joystick.h +408 -0
  23. data/assets/include/SDL2/SDL_keyboard.h +217 -0
  24. data/assets/include/SDL2/SDL_keycode.h +349 -0
  25. data/assets/include/SDL2/SDL_loadso.h +81 -0
  26. data/assets/include/SDL2/SDL_log.h +211 -0
  27. data/assets/include/SDL2/SDL_main.h +168 -0
  28. data/assets/include/SDL2/SDL_messagebox.h +144 -0
  29. data/assets/include/SDL2/SDL_mixer.h +651 -0
  30. data/assets/include/SDL2/SDL_mouse.h +302 -0
  31. data/assets/include/SDL2/SDL_mutex.h +251 -0
  32. data/assets/include/SDL2/SDL_name.h +33 -0
  33. data/assets/include/SDL2/SDL_opengl.h +2183 -0
  34. data/assets/include/SDL2/SDL_opengl_glext.h +11177 -0
  35. data/assets/include/SDL2/SDL_opengles.h +39 -0
  36. data/assets/include/SDL2/SDL_opengles2.h +52 -0
  37. data/assets/include/SDL2/SDL_opengles2_gl2.h +621 -0
  38. data/assets/include/SDL2/SDL_opengles2_gl2ext.h +2050 -0
  39. data/assets/include/SDL2/SDL_opengles2_gl2platform.h +30 -0
  40. data/assets/include/SDL2/SDL_opengles2_khrplatform.h +282 -0
  41. data/assets/include/SDL2/SDL_pixels.h +470 -0
  42. data/assets/include/SDL2/SDL_platform.h +198 -0
  43. data/assets/include/SDL2/SDL_power.h +75 -0
  44. data/assets/include/SDL2/SDL_quit.h +58 -0
  45. data/assets/include/SDL2/SDL_rect.h +148 -0
  46. data/assets/include/SDL2/SDL_render.h +931 -0
  47. data/assets/include/SDL2/SDL_revision.h +2 -0
  48. data/assets/include/SDL2/SDL_rwops.h +254 -0
  49. data/assets/include/SDL2/SDL_scancode.h +413 -0
  50. data/assets/include/SDL2/SDL_sensor.h +251 -0
  51. data/assets/include/SDL2/SDL_shape.h +144 -0
  52. data/assets/include/SDL2/SDL_stdinc.h +607 -0
  53. data/assets/include/SDL2/SDL_surface.h +553 -0
  54. data/assets/include/SDL2/SDL_system.h +279 -0
  55. data/assets/include/SDL2/SDL_syswm.h +324 -0
  56. data/assets/include/SDL2/SDL_test.h +69 -0
  57. data/assets/include/SDL2/SDL_test_assert.h +105 -0
  58. data/assets/include/SDL2/SDL_test_common.h +188 -0
  59. data/assets/include/SDL2/SDL_test_compare.h +69 -0
  60. data/assets/include/SDL2/SDL_test_crc32.h +124 -0
  61. data/assets/include/SDL2/SDL_test_font.h +81 -0
  62. data/assets/include/SDL2/SDL_test_fuzzer.h +384 -0
  63. data/assets/include/SDL2/SDL_test_harness.h +134 -0
  64. data/assets/include/SDL2/SDL_test_images.h +78 -0
  65. data/assets/include/SDL2/SDL_test_log.h +67 -0
  66. data/assets/include/SDL2/SDL_test_md5.h +129 -0
  67. data/assets/include/SDL2/SDL_test_memory.h +63 -0
  68. data/assets/include/SDL2/SDL_test_random.h +115 -0
  69. data/assets/include/SDL2/SDL_thread.h +343 -0
  70. data/assets/include/SDL2/SDL_timer.h +115 -0
  71. data/assets/include/SDL2/SDL_touch.h +86 -0
  72. data/assets/include/SDL2/SDL_ttf.h +294 -0
  73. data/assets/include/SDL2/SDL_types.h +29 -0
  74. data/assets/include/SDL2/SDL_version.h +162 -0
  75. data/assets/include/SDL2/SDL_video.h +1276 -0
  76. data/assets/include/SDL2/SDL_vulkan.h +278 -0
  77. data/assets/include/SDL2/begin_code.h +167 -0
  78. data/assets/include/SDL2/close_code.h +37 -0
  79. data/assets/include/glew.h +23686 -0
  80. data/assets/include/simple2d.h +735 -0
  81. data/assets/ios/MRuby.framework/Headers/mrbconf.h +3 -5
  82. data/assets/ios/MRuby.framework/Headers/mruby.h +35 -32
  83. data/assets/ios/MRuby.framework/Headers/mruby/array.h +1 -0
  84. data/assets/ios/MRuby.framework/Headers/mruby/boxing_word.h +9 -1
  85. data/assets/ios/MRuby.framework/Headers/mruby/class.h +14 -11
  86. data/assets/ios/MRuby.framework/Headers/mruby/common.h +5 -0
  87. data/assets/ios/MRuby.framework/Headers/mruby/compile.h +4 -3
  88. data/assets/ios/MRuby.framework/Headers/mruby/debug.h +3 -2
  89. data/assets/ios/MRuby.framework/Headers/mruby/dump.h +2 -2
  90. data/assets/ios/MRuby.framework/Headers/mruby/hash.h +38 -5
  91. data/assets/ios/MRuby.framework/Headers/mruby/irep.h +17 -4
  92. data/assets/ios/MRuby.framework/Headers/mruby/object.h +4 -5
  93. data/assets/ios/MRuby.framework/Headers/mruby/opcode.h +47 -139
  94. data/assets/ios/MRuby.framework/Headers/mruby/ops.h +117 -0
  95. data/assets/ios/MRuby.framework/Headers/mruby/proc.h +4 -4
  96. data/assets/ios/MRuby.framework/Headers/mruby/string.h +11 -7
  97. data/assets/ios/MRuby.framework/Headers/mruby/throw.h +4 -4
  98. data/assets/ios/MRuby.framework/Headers/mruby/variable.h +2 -4
  99. data/assets/ios/MRuby.framework/Headers/mruby/version.h +6 -6
  100. data/assets/ios/MRuby.framework/MRuby +0 -0
  101. data/assets/ios/MyApp.xcodeproj/project.pbxproj +24 -18
  102. data/assets/ios/MyApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  103. data/assets/ios/main.c +1 -1
  104. data/assets/macos/lib/libFLAC.a +0 -0
  105. data/assets/macos/lib/libSDL2.a +0 -0
  106. data/assets/macos/lib/libSDL2_image.a +0 -0
  107. data/assets/macos/lib/libSDL2_mixer.a +0 -0
  108. data/assets/macos/lib/libSDL2_ttf.a +0 -0
  109. data/assets/macos/lib/libfreetype.a +0 -0
  110. data/assets/macos/lib/libjpeg.a +0 -0
  111. data/assets/macos/lib/libmpg123.a +0 -0
  112. data/assets/macos/lib/libogg.a +0 -0
  113. data/assets/macos/lib/libpng16.a +0 -0
  114. data/assets/macos/lib/libsimple2d.a +0 -0
  115. data/assets/macos/lib/libtiff.a +0 -0
  116. data/assets/macos/lib/libvorbis.a +0 -0
  117. data/assets/macos/lib/libvorbisfile.a +0 -0
  118. data/assets/macos/lib/libwebp.a +0 -0
  119. data/assets/mingw/bin/SDL2.dll +0 -0
  120. data/assets/mingw/bin/SDL2_image.dll +0 -0
  121. data/assets/mingw/bin/SDL2_mixer.dll +0 -0
  122. data/assets/mingw/bin/SDL2_ttf.dll +0 -0
  123. data/assets/mingw/bin/glew32.dll +0 -0
  124. data/assets/mingw/bin/libFLAC-8.dll +0 -0
  125. data/assets/mingw/bin/libfreetype-6.dll +0 -0
  126. data/assets/mingw/bin/libjpeg-9.dll +0 -0
  127. data/assets/mingw/bin/libmodplug-1.dll +0 -0
  128. data/assets/mingw/bin/libmpg123-0.dll +0 -0
  129. data/assets/mingw/bin/libogg-0.dll +0 -0
  130. data/assets/mingw/bin/libopus-0.dll +0 -0
  131. data/assets/mingw/bin/libopusfile-0.dll +0 -0
  132. data/assets/mingw/bin/libpng16-16.dll +0 -0
  133. data/assets/mingw/bin/libtiff-5.dll +0 -0
  134. data/assets/mingw/bin/libvorbis-0.dll +0 -0
  135. data/assets/mingw/bin/libvorbisfile-3.dll +0 -0
  136. data/assets/mingw/bin/libwebp-7.dll +0 -0
  137. data/assets/mingw/bin/zlib1.dll +0 -0
  138. data/assets/mingw/lib/libSDL2.a +0 -0
  139. data/assets/mingw/lib/libSDL2.dll.a +0 -0
  140. data/assets/mingw/lib/libSDL2_image.a +0 -0
  141. data/assets/mingw/lib/libSDL2_image.dll.a +0 -0
  142. data/assets/mingw/lib/libSDL2_mixer.a +0 -0
  143. data/assets/mingw/lib/libSDL2_mixer.dll.a +0 -0
  144. data/assets/mingw/lib/libSDL2_test.a +0 -0
  145. data/assets/mingw/lib/libSDL2_ttf.a +0 -0
  146. data/assets/mingw/lib/libSDL2_ttf.dll.a +0 -0
  147. data/assets/mingw/lib/libSDL2main.a +0 -0
  148. data/assets/mingw/lib/libglew32.a +0 -0
  149. data/assets/mingw/lib/libglew32.dll.a +0 -0
  150. data/assets/mingw/lib/libsimple2d.a +0 -0
  151. data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/Contents.json +4 -0
  152. data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/Contents.json +4 -0
  153. data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json +4 -0
  154. data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/Contents.json +4 -0
  155. data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/Contents.json +4 -0
  156. data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json +4 -0
  157. data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json +4 -0
  158. data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json +4 -0
  159. data/assets/tvos/Assets.xcassets/LaunchImage.launchimage/Contents.json +7 -0
  160. data/assets/tvos/MRuby.framework/Headers/mrbconf.h +3 -5
  161. data/assets/tvos/MRuby.framework/Headers/mruby.h +35 -32
  162. data/assets/tvos/MRuby.framework/Headers/mruby/array.h +1 -0
  163. data/assets/tvos/MRuby.framework/Headers/mruby/boxing_word.h +9 -1
  164. data/assets/tvos/MRuby.framework/Headers/mruby/class.h +14 -11
  165. data/assets/tvos/MRuby.framework/Headers/mruby/common.h +5 -0
  166. data/assets/tvos/MRuby.framework/Headers/mruby/compile.h +4 -3
  167. data/assets/tvos/MRuby.framework/Headers/mruby/debug.h +3 -2
  168. data/assets/tvos/MRuby.framework/Headers/mruby/dump.h +2 -2
  169. data/assets/tvos/MRuby.framework/Headers/mruby/hash.h +38 -5
  170. data/assets/tvos/MRuby.framework/Headers/mruby/irep.h +17 -4
  171. data/assets/tvos/MRuby.framework/Headers/mruby/object.h +4 -5
  172. data/assets/tvos/MRuby.framework/Headers/mruby/opcode.h +47 -139
  173. data/assets/tvos/MRuby.framework/Headers/mruby/ops.h +117 -0
  174. data/assets/tvos/MRuby.framework/Headers/mruby/proc.h +4 -4
  175. data/assets/tvos/MRuby.framework/Headers/mruby/string.h +11 -7
  176. data/assets/tvos/MRuby.framework/Headers/mruby/throw.h +4 -4
  177. data/assets/tvos/MRuby.framework/Headers/mruby/variable.h +2 -4
  178. data/assets/tvos/MRuby.framework/Headers/mruby/version.h +6 -6
  179. data/assets/tvos/MRuby.framework/MRuby +0 -0
  180. data/assets/tvos/MyApp.xcodeproj/project.pbxproj +25 -19
  181. data/assets/tvos/MyApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  182. data/assets/tvos/main.c +1 -1
  183. data/ext/ruby2d/extconf.rb +59 -50
  184. data/ext/ruby2d/ruby2d.c +0 -1
  185. data/lib/ruby2d.rb +1 -7
  186. data/lib/ruby2d/cli/launch.rb +1 -1
  187. data/lib/ruby2d/font.rb +32 -7
  188. data/lib/ruby2d/version.rb +1 -1
  189. metadata +132 -6
  190. data/assets/opal.js +0 -21637
  191. data/assets/simple2d.js +0 -1379
  192. data/assets/template.html +0 -18
@@ -0,0 +1,279 @@
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
+
22
+ /**
23
+ * \file SDL_system.h
24
+ *
25
+ * Include file for platform specific SDL API functions
26
+ */
27
+
28
+ #ifndef SDL_system_h_
29
+ #define SDL_system_h_
30
+
31
+ #include "SDL_stdinc.h"
32
+ #include "SDL_keyboard.h"
33
+ #include "SDL_render.h"
34
+ #include "SDL_video.h"
35
+
36
+ #include "begin_code.h"
37
+ /* Set up for C function definitions, even when using C++ */
38
+ #ifdef __cplusplus
39
+ extern "C" {
40
+ #endif
41
+
42
+
43
+ /* Platform specific functions for Windows */
44
+ #ifdef __WIN32__
45
+
46
+ /**
47
+ \brief Set a function that is called for every windows message, before TranslateMessage()
48
+ */
49
+ typedef void (SDLCALL * SDL_WindowsMessageHook)(void *userdata, void *hWnd, unsigned int message, Uint64 wParam, Sint64 lParam);
50
+ extern DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata);
51
+
52
+ /**
53
+ \brief Returns the D3D9 adapter index that matches the specified display index.
54
+
55
+ This adapter index can be passed to IDirect3D9::CreateDevice and controls
56
+ on which monitor a full screen application will appear.
57
+ */
58
+ extern DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex( int displayIndex );
59
+
60
+ typedef struct IDirect3DDevice9 IDirect3DDevice9;
61
+ /**
62
+ \brief Returns the D3D device associated with a renderer, or NULL if it's not a D3D renderer.
63
+
64
+ Once you are done using the device, you should release it to avoid a resource leak.
65
+ */
66
+ extern DECLSPEC IDirect3DDevice9* SDLCALL SDL_RenderGetD3D9Device(SDL_Renderer * renderer);
67
+
68
+ /**
69
+ \brief Returns the DXGI Adapter and Output indices for the specified display index.
70
+
71
+ These can be passed to EnumAdapters and EnumOutputs respectively to get the objects
72
+ required to create a DX10 or DX11 device and swap chain.
73
+ */
74
+ extern DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo( int displayIndex, int *adapterIndex, int *outputIndex );
75
+
76
+ #endif /* __WIN32__ */
77
+
78
+
79
+ /* Platform specific functions for Linux */
80
+ #ifdef __LINUX__
81
+
82
+ /**
83
+ \brief Sets the UNIX nice value for a thread, using setpriority() if possible, and RealtimeKit if available.
84
+
85
+ \return 0 on success, or -1 on error.
86
+ */
87
+ extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int priority);
88
+
89
+ #endif /* __LINUX__ */
90
+
91
+ /* Platform specific functions for iOS */
92
+ #if defined(__IPHONEOS__) && __IPHONEOS__
93
+
94
+ #define SDL_iOSSetAnimationCallback(window, interval, callback, callbackParam) SDL_iPhoneSetAnimationCallback(window, interval, callback, callbackParam)
95
+ extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam);
96
+
97
+ #define SDL_iOSSetEventPump(enabled) SDL_iPhoneSetEventPump(enabled)
98
+ extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled);
99
+
100
+ #endif /* __IPHONEOS__ */
101
+
102
+
103
+ /* Platform specific functions for Android */
104
+ #if defined(__ANDROID__) && __ANDROID__
105
+
106
+ /**
107
+ \brief Get the JNI environment for the current thread
108
+
109
+ This returns JNIEnv*, but the prototype is void* so we don't need jni.h
110
+ */
111
+ extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv(void);
112
+
113
+ /**
114
+ \brief Get the SDL Activity object for the application
115
+
116
+ This returns jobject, but the prototype is void* so we don't need jni.h
117
+ The jobject returned by SDL_AndroidGetActivity is a local reference.
118
+ It is the caller's responsibility to properly release it
119
+ (using env->Push/PopLocalFrame or manually with env->DeleteLocalRef)
120
+ */
121
+ extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity(void);
122
+
123
+ /**
124
+ \brief Return true if the application is running on Android TV
125
+ */
126
+ extern DECLSPEC SDL_bool SDLCALL SDL_IsAndroidTV(void);
127
+
128
+ /**
129
+ \brief Return true if the application is running on a Chromebook
130
+ */
131
+ extern DECLSPEC SDL_bool SDLCALL SDL_IsChromebook(void);
132
+
133
+ /**
134
+ \brief Return true is the application is running on a Samsung DeX docking station
135
+ */
136
+ extern DECLSPEC SDL_bool SDLCALL SDL_IsDeXMode(void);
137
+
138
+ /**
139
+ \brief Trigger the Android system back button behavior.
140
+ */
141
+ extern DECLSPEC void SDLCALL SDL_AndroidBackButton(void);
142
+
143
+ /**
144
+ See the official Android developer guide for more information:
145
+ http://developer.android.com/guide/topics/data/data-storage.html
146
+ */
147
+ #define SDL_ANDROID_EXTERNAL_STORAGE_READ 0x01
148
+ #define SDL_ANDROID_EXTERNAL_STORAGE_WRITE 0x02
149
+
150
+ /**
151
+ \brief Get the path used for internal storage for this application.
152
+
153
+ This path is unique to your application and cannot be written to
154
+ by other applications.
155
+ */
156
+ extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath(void);
157
+
158
+ /**
159
+ \brief Get the current state of external storage, a bitmask of these values:
160
+ SDL_ANDROID_EXTERNAL_STORAGE_READ
161
+ SDL_ANDROID_EXTERNAL_STORAGE_WRITE
162
+
163
+ If external storage is currently unavailable, this will return 0.
164
+ */
165
+ extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(void);
166
+
167
+ /**
168
+ \brief Get the path used for external storage for this application.
169
+
170
+ This path is unique to your application, but is public and can be
171
+ written to by other applications.
172
+ */
173
+ extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(void);
174
+
175
+ #endif /* __ANDROID__ */
176
+
177
+ /* Platform specific functions for WinRT */
178
+ #if defined(__WINRT__) && __WINRT__
179
+
180
+ /**
181
+ * \brief WinRT / Windows Phone path types
182
+ */
183
+ typedef enum
184
+ {
185
+ /** \brief The installed app's root directory.
186
+ Files here are likely to be read-only. */
187
+ SDL_WINRT_PATH_INSTALLED_LOCATION,
188
+
189
+ /** \brief The app's local data store. Files may be written here */
190
+ SDL_WINRT_PATH_LOCAL_FOLDER,
191
+
192
+ /** \brief The app's roaming data store. Unsupported on Windows Phone.
193
+ Files written here may be copied to other machines via a network
194
+ connection.
195
+ */
196
+ SDL_WINRT_PATH_ROAMING_FOLDER,
197
+
198
+ /** \brief The app's temporary data store. Unsupported on Windows Phone.
199
+ Files written here may be deleted at any time. */
200
+ SDL_WINRT_PATH_TEMP_FOLDER
201
+ } SDL_WinRT_Path;
202
+
203
+
204
+ /**
205
+ * \brief WinRT Device Family
206
+ */
207
+ typedef enum
208
+ {
209
+ /** \brief Unknown family */
210
+ SDL_WINRT_DEVICEFAMILY_UNKNOWN,
211
+
212
+ /** \brief Desktop family*/
213
+ SDL_WINRT_DEVICEFAMILY_DESKTOP,
214
+
215
+ /** \brief Mobile family (for example smartphone) */
216
+ SDL_WINRT_DEVICEFAMILY_MOBILE,
217
+
218
+ /** \brief XBox family */
219
+ SDL_WINRT_DEVICEFAMILY_XBOX,
220
+ } SDL_WinRT_DeviceFamily;
221
+
222
+
223
+ /**
224
+ * \brief Retrieves a WinRT defined path on the local file system
225
+ *
226
+ * \note Documentation on most app-specific path types on WinRT
227
+ * can be found on MSDN, at the URL:
228
+ * http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
229
+ *
230
+ * \param pathType The type of path to retrieve.
231
+ * \return A UCS-2 string (16-bit, wide-char) containing the path, or NULL
232
+ * if the path is not available for any reason. Not all paths are
233
+ * available on all versions of Windows. This is especially true on
234
+ * Windows Phone. Check the documentation for the given
235
+ * SDL_WinRT_Path for more information on which path types are
236
+ * supported where.
237
+ */
238
+ extern DECLSPEC const wchar_t * SDLCALL SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path pathType);
239
+
240
+ /**
241
+ * \brief Retrieves a WinRT defined path on the local file system
242
+ *
243
+ * \note Documentation on most app-specific path types on WinRT
244
+ * can be found on MSDN, at the URL:
245
+ * http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
246
+ *
247
+ * \param pathType The type of path to retrieve.
248
+ * \return A UTF-8 string (8-bit, multi-byte) containing the path, or NULL
249
+ * if the path is not available for any reason. Not all paths are
250
+ * available on all versions of Windows. This is especially true on
251
+ * Windows Phone. Check the documentation for the given
252
+ * SDL_WinRT_Path for more information on which path types are
253
+ * supported where.
254
+ */
255
+ extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathType);
256
+
257
+ /**
258
+ * \brief Detects the device family of WinRT plattform on runtime
259
+ *
260
+ * \return Device family
261
+ */
262
+ extern DECLSPEC SDL_WinRT_DeviceFamily SDLCALL SDL_WinRTGetDeviceFamily();
263
+
264
+ #endif /* __WINRT__ */
265
+
266
+ /**
267
+ \brief Return true if the current device is a tablet.
268
+ */
269
+ extern DECLSPEC SDL_bool SDLCALL SDL_IsTablet(void);
270
+
271
+ /* Ends C function definitions when using C++ */
272
+ #ifdef __cplusplus
273
+ }
274
+ #endif
275
+ #include "close_code.h"
276
+
277
+ #endif /* SDL_system_h_ */
278
+
279
+ /* vi: set ts=4 sw=4 expandtab: */
@@ -0,0 +1,324 @@
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
+
22
+ /**
23
+ * \file SDL_syswm.h
24
+ *
25
+ * Include file for SDL custom system window manager hooks.
26
+ */
27
+
28
+ #ifndef SDL_syswm_h_
29
+ #define SDL_syswm_h_
30
+
31
+ #include "SDL_stdinc.h"
32
+ #include "SDL_error.h"
33
+ #include "SDL_video.h"
34
+ #include "SDL_version.h"
35
+
36
+ /**
37
+ * \file SDL_syswm.h
38
+ *
39
+ * Your application has access to a special type of event ::SDL_SYSWMEVENT,
40
+ * which contains window-manager specific information and arrives whenever
41
+ * an unhandled window event occurs. This event is ignored by default, but
42
+ * you can enable it with SDL_EventState().
43
+ */
44
+ #ifdef SDL_PROTOTYPES_ONLY
45
+ struct SDL_SysWMinfo;
46
+ #else
47
+
48
+ #if defined(SDL_VIDEO_DRIVER_WINDOWS)
49
+ #ifndef WIN32_LEAN_AND_MEAN
50
+ #define WIN32_LEAN_AND_MEAN
51
+ #endif
52
+ #include <windows.h>
53
+ #endif
54
+
55
+ #if defined(SDL_VIDEO_DRIVER_WINRT)
56
+ #include <Inspectable.h>
57
+ #endif
58
+
59
+ /* This is the structure for custom window manager events */
60
+ #if defined(SDL_VIDEO_DRIVER_X11)
61
+ #if defined(__APPLE__) && defined(__MACH__)
62
+ /* conflicts with Quickdraw.h */
63
+ #define Cursor X11Cursor
64
+ #endif
65
+
66
+ #include <X11/Xlib.h>
67
+ #include <X11/Xatom.h>
68
+
69
+ #if defined(__APPLE__) && defined(__MACH__)
70
+ /* matches the re-define above */
71
+ #undef Cursor
72
+ #endif
73
+
74
+ #endif /* defined(SDL_VIDEO_DRIVER_X11) */
75
+
76
+ #if defined(SDL_VIDEO_DRIVER_DIRECTFB)
77
+ #include <directfb.h>
78
+ #endif
79
+
80
+ #if defined(SDL_VIDEO_DRIVER_COCOA)
81
+ #ifdef __OBJC__
82
+ @class NSWindow;
83
+ #else
84
+ typedef struct _NSWindow NSWindow;
85
+ #endif
86
+ #endif
87
+
88
+ #if defined(SDL_VIDEO_DRIVER_UIKIT)
89
+ #ifdef __OBJC__
90
+ #include <UIKit/UIKit.h>
91
+ #else
92
+ typedef struct _UIWindow UIWindow;
93
+ typedef struct _UIViewController UIViewController;
94
+ #endif
95
+ typedef Uint32 GLuint;
96
+ #endif
97
+
98
+ #if defined(SDL_VIDEO_DRIVER_ANDROID)
99
+ typedef struct ANativeWindow ANativeWindow;
100
+ typedef void *EGLSurface;
101
+ #endif
102
+
103
+ #if defined(SDL_VIDEO_DRIVER_VIVANTE)
104
+ #include "SDL_egl.h"
105
+ #endif
106
+
107
+ #include "begin_code.h"
108
+ /* Set up for C function definitions, even when using C++ */
109
+ #ifdef __cplusplus
110
+ extern "C" {
111
+ #endif
112
+
113
+ /**
114
+ * These are the various supported windowing subsystems
115
+ */
116
+ typedef enum
117
+ {
118
+ SDL_SYSWM_UNKNOWN,
119
+ SDL_SYSWM_WINDOWS,
120
+ SDL_SYSWM_X11,
121
+ SDL_SYSWM_DIRECTFB,
122
+ SDL_SYSWM_COCOA,
123
+ SDL_SYSWM_UIKIT,
124
+ SDL_SYSWM_WAYLAND,
125
+ SDL_SYSWM_MIR,
126
+ SDL_SYSWM_WINRT,
127
+ SDL_SYSWM_ANDROID,
128
+ SDL_SYSWM_VIVANTE,
129
+ SDL_SYSWM_OS2
130
+ } SDL_SYSWM_TYPE;
131
+
132
+ /**
133
+ * The custom event structure.
134
+ */
135
+ struct SDL_SysWMmsg
136
+ {
137
+ SDL_version version;
138
+ SDL_SYSWM_TYPE subsystem;
139
+ union
140
+ {
141
+ #if defined(SDL_VIDEO_DRIVER_WINDOWS)
142
+ struct {
143
+ HWND hwnd; /**< The window for the message */
144
+ UINT msg; /**< The type of message */
145
+ WPARAM wParam; /**< WORD message parameter */
146
+ LPARAM lParam; /**< LONG message parameter */
147
+ } win;
148
+ #endif
149
+ #if defined(SDL_VIDEO_DRIVER_X11)
150
+ struct {
151
+ XEvent event;
152
+ } x11;
153
+ #endif
154
+ #if defined(SDL_VIDEO_DRIVER_DIRECTFB)
155
+ struct {
156
+ DFBEvent event;
157
+ } dfb;
158
+ #endif
159
+ #if defined(SDL_VIDEO_DRIVER_COCOA)
160
+ struct
161
+ {
162
+ /* Latest version of Xcode clang complains about empty structs in C v. C++:
163
+ error: empty struct has size 0 in C, size 1 in C++
164
+ */
165
+ int dummy;
166
+ /* No Cocoa window events yet */
167
+ } cocoa;
168
+ #endif
169
+ #if defined(SDL_VIDEO_DRIVER_UIKIT)
170
+ struct
171
+ {
172
+ int dummy;
173
+ /* No UIKit window events yet */
174
+ } uikit;
175
+ #endif
176
+ #if defined(SDL_VIDEO_DRIVER_VIVANTE)
177
+ struct
178
+ {
179
+ int dummy;
180
+ /* No Vivante window events yet */
181
+ } vivante;
182
+ #endif
183
+ /* Can't have an empty union */
184
+ int dummy;
185
+ } msg;
186
+ };
187
+
188
+ /**
189
+ * The custom window manager information structure.
190
+ *
191
+ * When this structure is returned, it holds information about which
192
+ * low level system it is using, and will be one of SDL_SYSWM_TYPE.
193
+ */
194
+ struct SDL_SysWMinfo
195
+ {
196
+ SDL_version version;
197
+ SDL_SYSWM_TYPE subsystem;
198
+ union
199
+ {
200
+ #if defined(SDL_VIDEO_DRIVER_WINDOWS)
201
+ struct
202
+ {
203
+ HWND window; /**< The window handle */
204
+ HDC hdc; /**< The window device context */
205
+ HINSTANCE hinstance; /**< The instance handle */
206
+ } win;
207
+ #endif
208
+ #if defined(SDL_VIDEO_DRIVER_WINRT)
209
+ struct
210
+ {
211
+ IInspectable * window; /**< The WinRT CoreWindow */
212
+ } winrt;
213
+ #endif
214
+ #if defined(SDL_VIDEO_DRIVER_X11)
215
+ struct
216
+ {
217
+ Display *display; /**< The X11 display */
218
+ Window window; /**< The X11 window */
219
+ } x11;
220
+ #endif
221
+ #if defined(SDL_VIDEO_DRIVER_DIRECTFB)
222
+ struct
223
+ {
224
+ IDirectFB *dfb; /**< The directfb main interface */
225
+ IDirectFBWindow *window; /**< The directfb window handle */
226
+ IDirectFBSurface *surface; /**< The directfb client surface */
227
+ } dfb;
228
+ #endif
229
+ #if defined(SDL_VIDEO_DRIVER_COCOA)
230
+ struct
231
+ {
232
+ #if defined(__OBJC__) && defined(__has_feature) && __has_feature(objc_arc)
233
+ NSWindow __unsafe_unretained *window; /**< The Cocoa window */
234
+ #else
235
+ NSWindow *window; /**< The Cocoa window */
236
+ #endif
237
+ } cocoa;
238
+ #endif
239
+ #if defined(SDL_VIDEO_DRIVER_UIKIT)
240
+ struct
241
+ {
242
+ #if defined(__OBJC__) && defined(__has_feature) && __has_feature(objc_arc)
243
+ UIWindow __unsafe_unretained *window; /**< The UIKit window */
244
+ #else
245
+ UIWindow *window; /**< The UIKit window */
246
+ #endif
247
+ GLuint framebuffer; /**< The GL view's Framebuffer Object. It must be bound when rendering to the screen using GL. */
248
+ GLuint colorbuffer; /**< The GL view's color Renderbuffer Object. It must be bound when SDL_GL_SwapWindow is called. */
249
+ GLuint resolveFramebuffer; /**< The Framebuffer Object which holds the resolve color Renderbuffer, when MSAA is used. */
250
+ } uikit;
251
+ #endif
252
+ #if defined(SDL_VIDEO_DRIVER_WAYLAND)
253
+ struct
254
+ {
255
+ struct wl_display *display; /**< Wayland display */
256
+ struct wl_surface *surface; /**< Wayland surface */
257
+ struct wl_shell_surface *shell_surface; /**< Wayland shell_surface (window manager handle) */
258
+ } wl;
259
+ #endif
260
+ #if defined(SDL_VIDEO_DRIVER_MIR)
261
+ struct
262
+ {
263
+ struct MirConnection *connection; /**< Mir display server connection */
264
+ struct MirSurface *surface; /**< Mir surface */
265
+ } mir;
266
+ #endif
267
+
268
+ #if defined(SDL_VIDEO_DRIVER_ANDROID)
269
+ struct
270
+ {
271
+ ANativeWindow *window;
272
+ EGLSurface surface;
273
+ } android;
274
+ #endif
275
+
276
+ #if defined(SDL_VIDEO_DRIVER_VIVANTE)
277
+ struct
278
+ {
279
+ EGLNativeDisplayType display;
280
+ EGLNativeWindowType window;
281
+ } vivante;
282
+ #endif
283
+
284
+ /* Make sure this union is always 64 bytes (8 64-bit pointers). */
285
+ /* Be careful not to overflow this if you add a new target! */
286
+ Uint8 dummy[64];
287
+ } info;
288
+ };
289
+
290
+ #endif /* SDL_PROTOTYPES_ONLY */
291
+
292
+ typedef struct SDL_SysWMinfo SDL_SysWMinfo;
293
+
294
+ /* Function prototypes */
295
+ /**
296
+ * \brief This function allows access to driver-dependent window information.
297
+ *
298
+ * \param window The window about which information is being requested
299
+ * \param info This structure must be initialized with the SDL version, and is
300
+ * then filled in with information about the given window.
301
+ *
302
+ * \return SDL_TRUE if the function is implemented and the version member of
303
+ * the \c info struct is valid, SDL_FALSE otherwise.
304
+ *
305
+ * You typically use this function like this:
306
+ * \code
307
+ * SDL_SysWMinfo info;
308
+ * SDL_VERSION(&info.version);
309
+ * if ( SDL_GetWindowWMInfo(window, &info) ) { ... }
310
+ * \endcode
311
+ */
312
+ extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_Window * window,
313
+ SDL_SysWMinfo * info);
314
+
315
+
316
+ /* Ends C function definitions when using C++ */
317
+ #ifdef __cplusplus
318
+ }
319
+ #endif
320
+ #include "close_code.h"
321
+
322
+ #endif /* SDL_syswm_h_ */
323
+
324
+ /* vi: set ts=4 sw=4 expandtab: */