gosu 1.3.0 → 1.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/dependencies/SDL/include/SDL.h +108 -14
- data/dependencies/SDL/include/SDL_assert.h +81 -50
- data/dependencies/SDL/include/SDL_atomic.h +135 -35
- data/dependencies/SDL/include/SDL_audio.h +960 -355
- data/dependencies/SDL/include/SDL_bits.h +11 -6
- data/dependencies/SDL/include/SDL_blendmode.h +91 -14
- data/dependencies/SDL/include/SDL_clipboard.h +30 -7
- data/dependencies/SDL/include/SDL_config.h +277 -27
- data/dependencies/SDL/include/SDL_config_android.h +13 -38
- data/dependencies/SDL/include/SDL_config_iphoneos.h +21 -62
- data/dependencies/SDL/include/SDL_config_macosx.h +23 -92
- data/dependencies/SDL/include/SDL_config_minimal.h +1 -4
- data/dependencies/SDL/include/SDL_config_pandora.h +15 -22
- data/dependencies/SDL/include/SDL_config_psp.h +16 -37
- data/dependencies/SDL/include/SDL_config_windows.h +28 -91
- data/dependencies/SDL/include/SDL_config_winrt.h +33 -61
- data/dependencies/SDL/include/SDL_config_wiz.h +28 -56
- data/dependencies/SDL/include/SDL_copying.h +1 -1
- data/dependencies/SDL/include/SDL_cpuinfo.h +331 -71
- data/dependencies/SDL/include/SDL_egl.h +906 -280
- data/dependencies/SDL/include/SDL_endian.h +101 -47
- data/dependencies/SDL/include/SDL_error.h +70 -19
- data/dependencies/SDL/include/SDL_events.h +387 -79
- data/dependencies/SDL/include/SDL_filesystem.h +73 -64
- data/dependencies/SDL/include/SDL_gamecontroller.h +585 -125
- data/dependencies/SDL/include/SDL_gesture.h +36 -6
- data/dependencies/SDL/include/SDL_haptic.h +304 -210
- data/dependencies/SDL/include/SDL_hidapi.h +451 -0
- data/dependencies/SDL/include/SDL_hints.h +1286 -897
- data/dependencies/SDL/include/SDL_joystick.h +577 -130
- data/dependencies/SDL/include/SDL_keyboard.h +162 -63
- data/dependencies/SDL/include/SDL_keycode.h +7 -5
- data/dependencies/SDL/include/SDL_loadso.h +42 -8
- data/dependencies/SDL/include/SDL_locale.h +34 -32
- data/dependencies/SDL/include/SDL_log.h +212 -19
- data/dependencies/SDL/include/SDL_main.h +72 -17
- data/dependencies/SDL/include/SDL_messagebox.h +70 -23
- data/dependencies/SDL/include/SDL_metal.h +27 -32
- data/dependencies/SDL/include/SDL_misc.h +19 -15
- data/dependencies/SDL/include/SDL_mouse.h +262 -110
- data/dependencies/SDL/include/SDL_mutex.h +286 -66
- data/dependencies/SDL/include/SDL_name.h +1 -1
- data/dependencies/SDL/include/SDL_opengl.h +1 -1
- data/dependencies/SDL/include/SDL_opengles.h +1 -1
- data/dependencies/SDL/include/SDL_opengles2.h +2 -2
- data/dependencies/SDL/include/SDL_pixels.h +199 -34
- data/dependencies/SDL/include/SDL_platform.h +39 -2
- data/dependencies/SDL/include/SDL_power.h +23 -10
- data/dependencies/SDL/include/SDL_quit.h +1 -1
- data/dependencies/SDL/include/SDL_rect.h +78 -28
- data/dependencies/SDL/include/SDL_render.h +1204 -472
- data/dependencies/SDL/include/SDL_revision.h +2 -2
- data/dependencies/SDL/include/SDL_rwops.h +605 -33
- data/dependencies/SDL/include/SDL_scancode.h +1 -1
- data/dependencies/SDL/include/SDL_sensor.h +76 -42
- data/dependencies/SDL/include/SDL_shape.h +38 -27
- data/dependencies/SDL/include/SDL_stdinc.h +96 -24
- data/dependencies/SDL/include/SDL_surface.h +571 -139
- data/dependencies/SDL/include/SDL_system.h +339 -101
- data/dependencies/SDL/include/SDL_syswm.h +50 -20
- data/dependencies/SDL/include/SDL_test.h +1 -1
- data/dependencies/SDL/include/SDL_test_assert.h +2 -2
- data/dependencies/SDL/include/SDL_test_common.h +23 -6
- data/dependencies/SDL/include/SDL_test_compare.h +1 -1
- data/dependencies/SDL/include/SDL_test_crc32.h +1 -1
- data/dependencies/SDL/include/SDL_test_font.h +3 -3
- data/dependencies/SDL/include/SDL_test_fuzzer.h +28 -26
- data/dependencies/SDL/include/SDL_test_harness.h +6 -6
- data/dependencies/SDL/include/SDL_test_images.h +1 -1
- data/dependencies/SDL/include/SDL_test_log.h +1 -1
- data/dependencies/SDL/include/SDL_test_md5.h +1 -1
- data/dependencies/SDL/include/SDL_test_memory.h +1 -1
- data/dependencies/SDL/include/SDL_test_random.h +2 -2
- data/dependencies/SDL/include/SDL_thread.h +226 -128
- data/dependencies/SDL/include/SDL_timer.h +129 -22
- data/dependencies/SDL/include/SDL_touch.h +48 -8
- data/dependencies/SDL/include/SDL_types.h +1 -1
- data/dependencies/SDL/include/SDL_version.h +72 -46
- data/dependencies/SDL/include/SDL_video.h +1266 -460
- data/dependencies/SDL/include/SDL_vulkan.h +100 -161
- data/dependencies/SDL/include/begin_code.h +22 -1
- data/dependencies/SDL/include/close_code.h +1 -1
- data/dependencies/SDL/lib/x64/libSDL2.dll.a +0 -0
- data/dependencies/SDL/lib/x86/libSDL2.dll.a +0 -0
- data/dependencies/SDL_sound/SDL_sound.c +104 -70
- data/dependencies/SDL_sound/SDL_sound.h +6 -6
- data/dependencies/SDL_sound/SDL_sound_aiff.c +32 -32
- data/dependencies/SDL_sound/SDL_sound_au.c +14 -14
- data/dependencies/SDL_sound/SDL_sound_coreaudio.c +6 -7
- data/dependencies/SDL_sound/SDL_sound_flac.c +28 -30
- data/dependencies/SDL_sound/SDL_sound_internal.h +21 -14
- data/dependencies/SDL_sound/SDL_sound_modplug.c +26 -28
- data/dependencies/SDL_sound/SDL_sound_mp3.c +20 -36
- data/dependencies/SDL_sound/SDL_sound_raw.c +15 -16
- data/dependencies/SDL_sound/SDL_sound_shn.c +11 -10
- data/dependencies/SDL_sound/SDL_sound_voc.c +20 -18
- data/dependencies/SDL_sound/SDL_sound_vorbis.c +11 -9
- data/dependencies/SDL_sound/SDL_sound_wav.c +49 -43
- data/dependencies/SDL_sound/dr_flac.h +10925 -4466
- data/dependencies/SDL_sound/dr_mp3.h +2802 -844
- data/dependencies/SDL_sound/libmodplug/fastmix.c +63 -64
- data/dependencies/SDL_sound/libmodplug/libmodplug.h +25 -103
- data/dependencies/SDL_sound/libmodplug/load_669.c +14 -17
- data/dependencies/SDL_sound/libmodplug/load_amf.c +12 -7
- data/dependencies/SDL_sound/libmodplug/load_ams.c +103 -44
- data/dependencies/SDL_sound/libmodplug/load_dbm.c +8 -4
- data/dependencies/SDL_sound/libmodplug/load_dmf.c +55 -25
- data/dependencies/SDL_sound/libmodplug/load_far.c +9 -13
- data/dependencies/SDL_sound/libmodplug/load_gdm.c +448 -0
- data/dependencies/SDL_sound/libmodplug/load_it.c +61 -61
- data/dependencies/SDL_sound/libmodplug/load_mdl.c +94 -58
- data/dependencies/SDL_sound/libmodplug/load_med.c +20 -11
- data/dependencies/SDL_sound/libmodplug/load_mod.c +40 -15
- data/dependencies/SDL_sound/libmodplug/load_mt2.c +50 -19
- data/dependencies/SDL_sound/libmodplug/load_okt.c +59 -28
- data/dependencies/SDL_sound/libmodplug/load_psm.c +104 -79
- data/dependencies/SDL_sound/libmodplug/load_ptm.c +18 -17
- data/dependencies/SDL_sound/libmodplug/load_s3m.c +9 -7
- data/dependencies/SDL_sound/libmodplug/load_stm.c +3 -2
- data/dependencies/SDL_sound/libmodplug/load_ult.c +4 -3
- data/dependencies/SDL_sound/libmodplug/load_umx.c +315 -35
- data/dependencies/SDL_sound/libmodplug/load_xm.c +25 -21
- data/dependencies/SDL_sound/libmodplug/mmcmp.c +295 -149
- data/dependencies/SDL_sound/libmodplug/modplug.c +7 -123
- data/dependencies/SDL_sound/libmodplug/modplug.h +32 -29
- data/dependencies/SDL_sound/libmodplug/snd_dsp.c +0 -1
- data/dependencies/SDL_sound/libmodplug/snd_flt.c +2 -2
- data/dependencies/SDL_sound/libmodplug/snd_fx.c +32 -19
- data/dependencies/SDL_sound/libmodplug/sndfile.c +76 -160
- data/dependencies/SDL_sound/libmodplug/sndmix.c +7 -12
- data/dependencies/SDL_sound/libmodplug/tables.h +10 -15
- data/dependencies/SDL_sound/stb_vorbis.h +504 -329
- data/dependencies/{al_soft → mojoAL}/AL/al.h +38 -30
- data/dependencies/{al_soft → mojoAL}/AL/alc.h +27 -56
- data/dependencies/mojoAL/mojoal.c +4848 -0
- data/dependencies/stb/stb_image.h +208 -73
- data/dependencies/stb/stb_image_write.h +57 -23
- data/dependencies/stb/stb_truetype.h +345 -279
- data/dependencies/utf8proc/utf8proc.c +37 -18
- data/dependencies/utf8proc/utf8proc.h +17 -5
- data/dependencies/utf8proc/utf8proc_data.h +12012 -10089
- data/ext/gosu/extconf.rb +29 -30
- data/include/Gosu/Audio.hpp +70 -85
- data/include/Gosu/Buttons.hpp +103 -103
- data/include/Gosu/Color.hpp +19 -11
- data/include/Gosu/Directories.hpp +31 -24
- data/include/Gosu/Font.hpp +42 -44
- data/include/Gosu/Gosu.hpp +5 -8
- data/include/Gosu/Graphics.hpp +58 -71
- data/include/Gosu/GraphicsBase.hpp +26 -33
- data/include/Gosu/IO.hpp +0 -3
- data/include/Gosu/Image.hpp +56 -62
- data/include/Gosu/ImageData.hpp +23 -27
- data/include/Gosu/Inspection.hpp +1 -4
- data/include/Gosu/Math.hpp +0 -3
- data/include/Gosu/TextInput.hpp +34 -40
- data/include/Gosu/Timing.hpp +2 -8
- data/include/Gosu/Version.hpp +2 -2
- data/include/Gosu/Window.hpp +71 -70
- data/lib/SDL2.dll +0 -0
- data/lib/gosu/compat.rb +24 -37
- data/lib/gosu.rb +2 -2
- data/lib64/SDL2.dll +0 -0
- data/src/Audio.cpp +88 -86
- data/src/AudioFile.hpp +6 -6
- data/src/AudioFileAudioToolbox.cpp +1 -1
- data/src/AudioFileSDLSound.cpp +1 -1
- data/src/AudioImpl.cpp +0 -7
- data/src/AudioImpl.hpp +6 -8
- data/src/BitmapIO.cpp +23 -22
- data/src/BlockAllocator.cpp +2 -1
- data/src/Channel.cpp +22 -20
- data/src/Color.cpp +12 -9
- data/src/DirectoriesApple.cpp +25 -24
- data/src/DirectoriesUnix.cpp +14 -12
- data/src/DirectoriesWin.cpp +26 -30
- data/src/EmptyImageData.hpp +15 -17
- data/src/FileUnix.cpp +1 -1
- data/src/FileWin.cpp +1 -1
- data/src/Font.cpp +59 -54
- data/src/Graphics.cpp +135 -143
- data/src/Image.cpp +41 -47
- data/src/Input.cpp +1 -1
- data/src/InputUIKit.cpp +1 -1
- data/src/LargeImageData.cpp +108 -101
- data/src/LargeImageData.hpp +17 -15
- data/src/Log.hpp +6 -6
- data/src/Macro.cpp +35 -37
- data/src/Macro.hpp +11 -11
- data/src/Math.cpp +8 -1
- data/src/Resolution.cpp +12 -7
- data/src/RubyGosu.cxx +11 -39
- data/src/TexChunk.cpp +50 -41
- data/src/TexChunk.hpp +22 -22
- data/src/Text.cpp +37 -37
- data/src/TextBuilder.cpp +60 -57
- data/src/TextBuilder.hpp +20 -20
- data/src/TextInput.cpp +127 -135
- data/src/TimingApple.cpp +1 -7
- data/src/TimingUnix.cpp +0 -6
- data/src/TimingWin.cpp +0 -6
- data/src/TrueTypeFont.cpp +107 -107
- data/src/TrueTypeFont.hpp +39 -38
- data/src/TrueTypeFontApple.cpp +19 -22
- data/src/TrueTypeFontUnix.cpp +21 -26
- data/src/TrueTypeFontWin.cpp +30 -30
- data/src/Window.cpp +97 -87
- data/src/WindowUIKit.cpp +46 -49
- metadata +7 -17
- data/dependencies/SDL/include/SDL_config_os2.h +0 -188
- data/dependencies/SDL_sound/libmodplug/load_abc.c +0 -4725
- data/dependencies/SDL_sound/libmodplug/load_mid.c +0 -1405
- data/dependencies/SDL_sound/libmodplug/load_pat.c +0 -1143
- data/dependencies/SDL_sound/libmodplug/load_pat.h +0 -25
- data/dependencies/al_soft/AL/alext.h +0 -585
- data/dependencies/al_soft/AL/efx-creative.h +0 -3
- data/dependencies/al_soft/AL/efx-presets.h +0 -402
- data/dependencies/al_soft/AL/efx.h +0 -762
- data/dependencies/al_soft/x64/libOpenAL32.dll.a +0 -0
- data/dependencies/al_soft/x86/libOpenAL32.dll.a +0 -0
- data/lib/OpenAL32.dll +0 -0
- data/lib64/OpenAL32.dll +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
Simple DirectMedia Layer
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
4
4
|
|
5
5
|
This software is provided 'as-is', without any express or implied
|
6
6
|
warranty. In no event will the authors be held liable for any damages
|
@@ -43,33 +43,82 @@ extern "C" {
|
|
43
43
|
/* Platform specific functions for Windows */
|
44
44
|
#ifdef __WIN32__
|
45
45
|
|
46
|
-
/**
|
47
|
-
\brief Set a function that is called for every windows message, before TranslateMessage()
|
48
|
-
*/
|
49
46
|
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
47
|
|
52
48
|
/**
|
53
|
-
|
49
|
+
* Set a callback for every Windows message, run before TranslateMessage().
|
50
|
+
*
|
51
|
+
* \param callback The SDL_WindowsMessageHook function to call.
|
52
|
+
* \param userdata a pointer to pass to every iteration of `callback`
|
53
|
+
*
|
54
|
+
* \since This function is available since SDL 2.0.4.
|
55
|
+
*/
|
56
|
+
extern DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata);
|
54
57
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
+
/**
|
59
|
+
* Get the D3D9 adapter index that matches the specified display index.
|
60
|
+
*
|
61
|
+
* The returned adapter index can be passed to `IDirect3D9::CreateDevice` and
|
62
|
+
* controls on which monitor a full screen application will appear.
|
63
|
+
*
|
64
|
+
* \param displayIndex the display index for which to get the D3D9 adapter
|
65
|
+
* index
|
66
|
+
* \returns the D3D9 adapter index on success or a negative error code on
|
67
|
+
* failure; call SDL_GetError() for more information.
|
68
|
+
*
|
69
|
+
* \since This function is available since SDL 2.0.1.
|
70
|
+
*/
|
58
71
|
extern DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex( int displayIndex );
|
59
72
|
|
60
73
|
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
74
|
|
64
|
-
|
75
|
+
/**
|
76
|
+
* Get the D3D9 device associated with a renderer.
|
77
|
+
*
|
78
|
+
* Once you are done using the device, you should release it to avoid a
|
79
|
+
* resource leak.
|
80
|
+
*
|
81
|
+
* \param renderer the renderer from which to get the associated D3D device
|
82
|
+
* \returns the D3D9 device associated with given renderer or NULL if it is
|
83
|
+
* not a D3D9 renderer; call SDL_GetError() for more information.
|
84
|
+
*
|
85
|
+
* \since This function is available since SDL 2.0.1.
|
65
86
|
*/
|
66
87
|
extern DECLSPEC IDirect3DDevice9* SDLCALL SDL_RenderGetD3D9Device(SDL_Renderer * renderer);
|
67
88
|
|
89
|
+
typedef struct ID3D11Device ID3D11Device;
|
90
|
+
|
68
91
|
/**
|
69
|
-
|
92
|
+
* Get the D3D11 device associated with a renderer.
|
93
|
+
*
|
94
|
+
* Once you are done using the device, you should release it to avoid a
|
95
|
+
* resource leak.
|
96
|
+
*
|
97
|
+
* \param renderer the renderer from which to get the associated D3D11 device
|
98
|
+
* \returns the D3D11 device associated with given renderer or NULL if it is
|
99
|
+
* not a D3D11 renderer; call SDL_GetError() for more information.
|
100
|
+
*
|
101
|
+
* \since This function is available since SDL 2.0.16.
|
102
|
+
*/
|
103
|
+
extern DECLSPEC ID3D11Device* SDLCALL SDL_RenderGetD3D11Device(SDL_Renderer * renderer);
|
70
104
|
|
71
|
-
|
72
|
-
|
105
|
+
/**
|
106
|
+
* Get the DXGI Adapter and Output indices for the specified display index.
|
107
|
+
*
|
108
|
+
* The DXGI Adapter and Output indices can be passed to `EnumAdapters` and
|
109
|
+
* `EnumOutputs` respectively to get the objects required to create a DX10 or
|
110
|
+
* DX11 device and swap chain.
|
111
|
+
*
|
112
|
+
* Before SDL 2.0.4 this function did not return a value. Since SDL 2.0.4 it
|
113
|
+
* returns an SDL_bool.
|
114
|
+
*
|
115
|
+
* \param displayIndex the display index for which to get both indices
|
116
|
+
* \param adapterIndex a pointer to be filled in with the adapter index
|
117
|
+
* \param outputIndex a pointer to be filled in with the output index
|
118
|
+
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
119
|
+
* for more information.
|
120
|
+
*
|
121
|
+
* \since This function is available since SDL 2.0.2.
|
73
122
|
*/
|
74
123
|
extern DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo( int displayIndex, int *adapterIndex, int *outputIndex );
|
75
124
|
|
@@ -80,11 +129,32 @@ extern DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo( int displayIndex, int *a
|
|
80
129
|
#ifdef __LINUX__
|
81
130
|
|
82
131
|
/**
|
83
|
-
|
84
|
-
|
85
|
-
|
132
|
+
* Sets the UNIX nice value for a thread.
|
133
|
+
*
|
134
|
+
* This uses setpriority() if possible, and RealtimeKit if available.
|
135
|
+
*
|
136
|
+
* \param threadID the Unix thread ID to change priority of.
|
137
|
+
* \param priority The new, Unix-specific, priority value.
|
138
|
+
* \returns 0 on success, or -1 on error.
|
139
|
+
*
|
140
|
+
* \since This function is available since SDL 2.0.9.
|
86
141
|
*/
|
87
142
|
extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int priority);
|
143
|
+
|
144
|
+
/**
|
145
|
+
* Sets the priority (not nice level) and scheduling policy for a thread.
|
146
|
+
*
|
147
|
+
* This uses setpriority() if possible, and RealtimeKit if available.
|
148
|
+
*
|
149
|
+
* \param threadID The Unix thread ID to change priority of.
|
150
|
+
* \param sdlPriority The new SDL_ThreadPriority value.
|
151
|
+
* \param schedPolicy The new scheduling policy (SCHED_FIFO, SCHED_RR,
|
152
|
+
* SCHED_OTHER, etc...)
|
153
|
+
* \returns 0 on success, or -1 on error.
|
154
|
+
*
|
155
|
+
* \since This function is available since SDL 2.0.18.
|
156
|
+
*/
|
157
|
+
extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy);
|
88
158
|
|
89
159
|
#endif /* __LINUX__ */
|
90
160
|
|
@@ -92,9 +162,57 @@ extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int prio
|
|
92
162
|
#ifdef __IPHONEOS__
|
93
163
|
|
94
164
|
#define SDL_iOSSetAnimationCallback(window, interval, callback, callbackParam) SDL_iPhoneSetAnimationCallback(window, interval, callback, callbackParam)
|
165
|
+
|
166
|
+
/**
|
167
|
+
* Use this function to set the animation callback on Apple iOS.
|
168
|
+
*
|
169
|
+
* The function prototype for `callback` is:
|
170
|
+
*
|
171
|
+
* ```c
|
172
|
+
* void callback(void* callbackParam);
|
173
|
+
* ```
|
174
|
+
*
|
175
|
+
* Where its parameter, `callbackParam`, is what was passed as `callbackParam`
|
176
|
+
* to SDL_iPhoneSetAnimationCallback().
|
177
|
+
*
|
178
|
+
* This function is only available on Apple iOS.
|
179
|
+
*
|
180
|
+
* For more information see:
|
181
|
+
* [README-ios.md](https://hg.libsdl.org/SDL/file/default/docs/README-ios.md)
|
182
|
+
*
|
183
|
+
* This functions is also accessible using the macro
|
184
|
+
* SDL_iOSSetAnimationCallback() since SDL 2.0.4.
|
185
|
+
*
|
186
|
+
* \param window the window for which the animation callback should be set
|
187
|
+
* \param interval the number of frames after which **callback** will be
|
188
|
+
* called
|
189
|
+
* \param callback the function to call for every frame.
|
190
|
+
* \param callbackParam a pointer that is passed to `callback`.
|
191
|
+
* \returns 0 on success or a negative error code on failure; call
|
192
|
+
* SDL_GetError() for more information.
|
193
|
+
*
|
194
|
+
* \since This function is available since SDL 2.0.0.
|
195
|
+
*
|
196
|
+
* \sa SDL_iPhoneSetEventPump
|
197
|
+
*/
|
95
198
|
extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam);
|
96
199
|
|
97
200
|
#define SDL_iOSSetEventPump(enabled) SDL_iPhoneSetEventPump(enabled)
|
201
|
+
|
202
|
+
/**
|
203
|
+
* Use this function to enable or disable the SDL event pump on Apple iOS.
|
204
|
+
*
|
205
|
+
* This function is only available on Apple iOS.
|
206
|
+
*
|
207
|
+
* This functions is also accessible using the macro SDL_iOSSetEventPump()
|
208
|
+
* since SDL 2.0.4.
|
209
|
+
*
|
210
|
+
* \param enabled SDL_TRUE to enable the event pump, SDL_FALSE to disable it
|
211
|
+
*
|
212
|
+
* \since This function is available since SDL 2.0.0.
|
213
|
+
*
|
214
|
+
* \sa SDL_iPhoneSetAnimationCallback
|
215
|
+
*/
|
98
216
|
extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled);
|
99
217
|
|
100
218
|
#endif /* __IPHONEOS__ */
|
@@ -104,66 +222,109 @@ extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled);
|
|
104
222
|
#ifdef __ANDROID__
|
105
223
|
|
106
224
|
/**
|
107
|
-
|
108
|
-
|
109
|
-
|
225
|
+
* Get the Android Java Native Interface Environment of the current thread.
|
226
|
+
*
|
227
|
+
* This is the JNIEnv one needs to access the Java virtual machine from native
|
228
|
+
* code, and is needed for many Android APIs to be usable from C.
|
229
|
+
*
|
230
|
+
* The prototype of the function in SDL's code actually declare a void* return
|
231
|
+
* type, even if the implementation returns a pointer to a JNIEnv. The
|
232
|
+
* rationale being that the SDL headers can avoid including jni.h.
|
233
|
+
*
|
234
|
+
* \returns a pointer to Java native interface object (JNIEnv) to which the
|
235
|
+
* current thread is attached, or 0 on error.
|
236
|
+
*
|
237
|
+
* \since This function is available since SDL 2.0.0.
|
238
|
+
*
|
239
|
+
* \sa SDL_AndroidGetActivity
|
110
240
|
*/
|
111
241
|
extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv(void);
|
112
242
|
|
113
243
|
/**
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
244
|
+
* Retrieve the Java instance of the Android activity class.
|
245
|
+
*
|
246
|
+
* The prototype of the function in SDL's code actually declares a void*
|
247
|
+
* return type, even if the implementation returns a jobject. The rationale
|
248
|
+
* being that the SDL headers can avoid including jni.h.
|
249
|
+
*
|
250
|
+
* The jobject returned by the function is a local reference and must be
|
251
|
+
* released by the caller. See the PushLocalFrame() and PopLocalFrame() or
|
252
|
+
* DeleteLocalRef() functions of the Java native interface:
|
253
|
+
*
|
254
|
+
* https://docs.oracle.com/javase/1.5.0/docs/guide/jni/spec/functions.html
|
255
|
+
*
|
256
|
+
* \returns the jobject representing the instance of the Activity class of the
|
257
|
+
* Android application, or NULL on error.
|
258
|
+
*
|
259
|
+
* \since This function is available since SDL 2.0.0.
|
260
|
+
*
|
261
|
+
* \sa SDL_AndroidGetJNIEnv
|
120
262
|
*/
|
121
263
|
extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity(void);
|
122
264
|
|
123
265
|
/**
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
266
|
+
* Query Android API level of the current device.
|
267
|
+
*
|
268
|
+
* - API level 31: Android 12
|
269
|
+
* - API level 30: Android 11
|
270
|
+
* - API level 29: Android 10
|
271
|
+
* - API level 28: Android 9
|
272
|
+
* - API level 27: Android 8.1
|
273
|
+
* - API level 26: Android 8.0
|
274
|
+
* - API level 25: Android 7.1
|
275
|
+
* - API level 24: Android 7.0
|
276
|
+
* - API level 23: Android 6.0
|
277
|
+
* - API level 22: Android 5.1
|
278
|
+
* - API level 21: Android 5.0
|
279
|
+
* - API level 20: Android 4.4W
|
280
|
+
* - API level 19: Android 4.4
|
281
|
+
* - API level 18: Android 4.3
|
282
|
+
* - API level 17: Android 4.2
|
283
|
+
* - API level 16: Android 4.1
|
284
|
+
* - API level 15: Android 4.0.3
|
285
|
+
* - API level 14: Android 4.0
|
286
|
+
* - API level 13: Android 3.2
|
287
|
+
* - API level 12: Android 3.1
|
288
|
+
* - API level 11: Android 3.0
|
289
|
+
* - API level 10: Android 2.3.3
|
290
|
+
*
|
291
|
+
* \returns the Android API level.
|
292
|
+
*
|
293
|
+
* \since This function is available since SDL 2.0.12.
|
147
294
|
*/
|
148
295
|
extern DECLSPEC int SDLCALL SDL_GetAndroidSDKVersion(void);
|
149
296
|
|
150
297
|
/**
|
151
|
-
|
298
|
+
* Query if the application is running on Android TV.
|
299
|
+
*
|
300
|
+
* \returns SDL_TRUE if this is Android TV, SDL_FALSE otherwise.
|
301
|
+
*
|
302
|
+
* \since This function is available since SDL 2.0.8.
|
152
303
|
*/
|
153
304
|
extern DECLSPEC SDL_bool SDLCALL SDL_IsAndroidTV(void);
|
154
305
|
|
155
306
|
/**
|
156
|
-
|
307
|
+
* Query if the application is running on a Chromebook.
|
308
|
+
*
|
309
|
+
* \returns SDL_TRUE if this is a Chromebook, SDL_FALSE otherwise.
|
310
|
+
*
|
311
|
+
* \since This function is available since SDL 2.0.9.
|
157
312
|
*/
|
158
313
|
extern DECLSPEC SDL_bool SDLCALL SDL_IsChromebook(void);
|
159
314
|
|
160
315
|
/**
|
161
|
-
|
316
|
+
* Query if the application is running on a Samsung DeX docking station.
|
317
|
+
*
|
318
|
+
* \returns SDL_TRUE if this is a DeX docking station, SDL_FALSE otherwise.
|
319
|
+
*
|
320
|
+
* \since This function is available since SDL 2.0.9.
|
162
321
|
*/
|
163
322
|
extern DECLSPEC SDL_bool SDLCALL SDL_IsDeXMode(void);
|
164
323
|
|
165
324
|
/**
|
166
|
-
|
325
|
+
* Trigger the Android system back button behavior.
|
326
|
+
*
|
327
|
+
* \since This function is available since SDL 2.0.9.
|
167
328
|
*/
|
168
329
|
extern DECLSPEC void SDLCALL SDL_AndroidBackButton(void);
|
169
330
|
|
@@ -175,38 +336,95 @@ extern DECLSPEC void SDLCALL SDL_AndroidBackButton(void);
|
|
175
336
|
#define SDL_ANDROID_EXTERNAL_STORAGE_WRITE 0x02
|
176
337
|
|
177
338
|
/**
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
339
|
+
* Get the path used for internal storage for this application.
|
340
|
+
*
|
341
|
+
* This path is unique to your application and cannot be written to by other
|
342
|
+
* applications.
|
343
|
+
*
|
344
|
+
* Your internal storage path is typically:
|
345
|
+
* `/data/data/your.app.package/files`.
|
346
|
+
*
|
347
|
+
* \returns the path used for internal storage or NULL on failure; call
|
348
|
+
* SDL_GetError() for more information.
|
349
|
+
*
|
350
|
+
* \since This function is available since SDL 2.0.0.
|
351
|
+
*
|
352
|
+
* \sa SDL_AndroidGetExternalStorageState
|
182
353
|
*/
|
183
354
|
extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath(void);
|
184
355
|
|
185
356
|
/**
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
357
|
+
* Get the current state of external storage.
|
358
|
+
*
|
359
|
+
* The current state of external storage, a bitmask of these values:
|
360
|
+
* `SDL_ANDROID_EXTERNAL_STORAGE_READ`, `SDL_ANDROID_EXTERNAL_STORAGE_WRITE`.
|
361
|
+
*
|
362
|
+
* If external storage is currently unavailable, this will return 0.
|
363
|
+
*
|
364
|
+
* \returns the current state of external storage on success or 0 on failure;
|
365
|
+
* call SDL_GetError() for more information.
|
366
|
+
*
|
367
|
+
* \since This function is available since SDL 2.0.0.
|
368
|
+
*
|
369
|
+
* \sa SDL_AndroidGetExternalStoragePath
|
370
|
+
*/
|
192
371
|
extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(void);
|
193
372
|
|
194
373
|
/**
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
374
|
+
* Get the path used for external storage for this application.
|
375
|
+
*
|
376
|
+
* This path is unique to your application, but is public and can be written
|
377
|
+
* to by other applications.
|
378
|
+
*
|
379
|
+
* Your external storage path is typically:
|
380
|
+
* `/storage/sdcard0/Android/data/your.app.package/files`.
|
381
|
+
*
|
382
|
+
* \returns the path used for external storage for this application on success
|
383
|
+
* or NULL on failure; call SDL_GetError() for more information.
|
384
|
+
*
|
385
|
+
* \since This function is available since SDL 2.0.0.
|
386
|
+
*
|
387
|
+
* \sa SDL_AndroidGetExternalStorageState
|
199
388
|
*/
|
200
389
|
extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(void);
|
201
390
|
|
202
391
|
/**
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
392
|
+
* Request permissions at runtime.
|
393
|
+
*
|
394
|
+
* This blocks the calling thread until the permission is granted or denied.
|
395
|
+
*
|
396
|
+
* \param permission The permission to request.
|
397
|
+
* \returns SDL_TRUE if the permission was granted, SDL_FALSE otherwise.
|
398
|
+
*
|
399
|
+
* \since This function is available since SDL 2.0.14.
|
207
400
|
*/
|
208
401
|
extern DECLSPEC SDL_bool SDLCALL SDL_AndroidRequestPermission(const char *permission);
|
209
402
|
|
403
|
+
/**
|
404
|
+
* Shows an Android toast notification.
|
405
|
+
*
|
406
|
+
* Toasts are a sort of lightweight notification that are unique to Android.
|
407
|
+
*
|
408
|
+
* https://developer.android.com/guide/topics/ui/notifiers/toasts
|
409
|
+
*
|
410
|
+
* Shows toast in UI thread.
|
411
|
+
*
|
412
|
+
* For the `gravity` parameter, choose a value from here, or -1 if you don't
|
413
|
+
* have a preference:
|
414
|
+
*
|
415
|
+
* https://developer.android.com/reference/android/view/Gravity
|
416
|
+
*
|
417
|
+
* \param message text message to be shown
|
418
|
+
* \param duration 0=short, 1=long
|
419
|
+
* \param gravity where the notification should appear on the screen.
|
420
|
+
* \param xoffset set this parameter only when gravity >=0
|
421
|
+
* \param yoffset set this parameter only when gravity >=0
|
422
|
+
* \returns 0 if success, -1 if any error occurs.
|
423
|
+
*
|
424
|
+
* \since This function is available since SDL 2.0.16.
|
425
|
+
*/
|
426
|
+
extern DECLSPEC int SDLCALL SDL_AndroidShowToast(const char* message, int duration, int gravity, int xoffset, int yoffset);
|
427
|
+
|
210
428
|
#endif /* __ANDROID__ */
|
211
429
|
|
212
430
|
/* Platform specific functions for WinRT */
|
@@ -256,50 +474,70 @@ typedef enum
|
|
256
474
|
|
257
475
|
|
258
476
|
/**
|
259
|
-
*
|
260
|
-
*
|
261
|
-
*
|
262
|
-
*
|
263
|
-
*
|
264
|
-
*
|
265
|
-
*
|
266
|
-
*
|
267
|
-
*
|
268
|
-
*
|
269
|
-
*
|
270
|
-
*
|
271
|
-
*
|
477
|
+
* Retrieve a WinRT defined path on the local file system.
|
478
|
+
*
|
479
|
+
* Not all paths are available on all versions of Windows. This is especially
|
480
|
+
* true on Windows Phone. Check the documentation for the given SDL_WinRT_Path
|
481
|
+
* for more information on which path types are supported where.
|
482
|
+
*
|
483
|
+
* Documentation on most app-specific path types on WinRT can be found on
|
484
|
+
* MSDN, at the URL:
|
485
|
+
*
|
486
|
+
* https://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
|
487
|
+
*
|
488
|
+
* \param pathType the type of path to retrieve, one of SDL_WinRT_Path
|
489
|
+
* \returns a UCS-2 string (16-bit, wide-char) containing the path, or NULL if
|
490
|
+
* the path is not available for any reason; call SDL_GetError() for
|
491
|
+
* more information.
|
492
|
+
*
|
493
|
+
* \since This function is available since SDL 2.0.3.
|
494
|
+
*
|
495
|
+
* \sa SDL_WinRTGetFSPathUTF8
|
272
496
|
*/
|
273
497
|
extern DECLSPEC const wchar_t * SDLCALL SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path pathType);
|
274
498
|
|
275
499
|
/**
|
276
|
-
*
|
277
|
-
*
|
278
|
-
*
|
279
|
-
*
|
280
|
-
*
|
281
|
-
*
|
282
|
-
*
|
283
|
-
*
|
284
|
-
*
|
285
|
-
*
|
286
|
-
*
|
287
|
-
*
|
288
|
-
*
|
500
|
+
* Retrieve a WinRT defined path on the local file system.
|
501
|
+
*
|
502
|
+
* Not all paths are available on all versions of Windows. This is especially
|
503
|
+
* true on Windows Phone. Check the documentation for the given SDL_WinRT_Path
|
504
|
+
* for more information on which path types are supported where.
|
505
|
+
*
|
506
|
+
* Documentation on most app-specific path types on WinRT can be found on
|
507
|
+
* MSDN, at the URL:
|
508
|
+
*
|
509
|
+
* https://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
|
510
|
+
*
|
511
|
+
* \param pathType the type of path to retrieve, one of SDL_WinRT_Path
|
512
|
+
* \returns a UTF-8 string (8-bit, multi-byte) containing the path, or NULL if
|
513
|
+
* the path is not available for any reason; call SDL_GetError() for
|
514
|
+
* more information.
|
515
|
+
*
|
516
|
+
* \since This function is available since SDL 2.0.3.
|
517
|
+
*
|
518
|
+
* \sa SDL_WinRTGetFSPathUNICODE
|
289
519
|
*/
|
290
520
|
extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathType);
|
291
521
|
|
292
522
|
/**
|
293
|
-
*
|
523
|
+
* Detects the device family of WinRT plattform at runtime.
|
294
524
|
*
|
295
|
-
*
|
525
|
+
* \returns a value from the SDL_WinRT_DeviceFamily enum.
|
526
|
+
*
|
527
|
+
* \since This function is available since SDL 2.0.8.
|
296
528
|
*/
|
297
529
|
extern DECLSPEC SDL_WinRT_DeviceFamily SDLCALL SDL_WinRTGetDeviceFamily();
|
298
530
|
|
299
531
|
#endif /* __WINRT__ */
|
300
532
|
|
301
533
|
/**
|
302
|
-
|
534
|
+
* Query if the current device is a tablet.
|
535
|
+
*
|
536
|
+
* If SDL can't determine this, it will return SDL_FALSE.
|
537
|
+
*
|
538
|
+
* \returns SDL_TRUE if the device is a tablet, SDL_FALSE otherwise.
|
539
|
+
*
|
540
|
+
* \since This function is available since SDL 2.0.9.
|
303
541
|
*/
|
304
542
|
extern DECLSPEC SDL_bool SDLCALL SDL_IsTablet(void);
|
305
543
|
|