gosu 1.1.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/COPYING +1 -1
- 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 +83 -7
- data/dependencies/SDL_sound/SDL_sound.h +4 -4
- data/dependencies/SDL_sound/SDL_sound_aiff.c +9 -12
- data/dependencies/SDL_sound/SDL_sound_au.c +7 -7
- data/dependencies/SDL_sound/SDL_sound_coreaudio.c +3 -3
- data/dependencies/SDL_sound/SDL_sound_flac.c +1 -1
- data/dependencies/SDL_sound/SDL_sound_internal.h +17 -10
- data/dependencies/SDL_sound/SDL_sound_modplug.c +25 -27
- data/dependencies/SDL_sound/SDL_sound_mp3.c +5 -17
- data/dependencies/SDL_sound/SDL_sound_raw.c +11 -11
- data/dependencies/SDL_sound/SDL_sound_shn.c +8 -7
- data/dependencies/SDL_sound/SDL_sound_voc.c +6 -4
- data/dependencies/SDL_sound/SDL_sound_vorbis.c +6 -11
- data/dependencies/SDL_sound/SDL_sound_wav.c +35 -29
- data/dependencies/SDL_sound/dr_flac.h +618 -220
- data/dependencies/SDL_sound/dr_mp3.h +263 -94
- data/dependencies/SDL_sound/libmodplug/fastmix.c +58 -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 +11 -7
- data/dependencies/SDL_sound/libmodplug/load_ams.c +65 -22
- 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 +45 -49
- data/dependencies/SDL_sound/libmodplug/load_mdl.c +80 -53
- data/dependencies/SDL_sound/libmodplug/load_med.c +20 -12
- data/dependencies/SDL_sound/libmodplug/load_mod.c +40 -15
- data/dependencies/SDL_sound/libmodplug/load_mt2.c +29 -17
- data/dependencies/SDL_sound/libmodplug/load_okt.c +12 -8
- data/dependencies/SDL_sound/libmodplug/load_psm.c +101 -78
- 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 +2 -2
- 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 +24 -18
- data/dependencies/SDL_sound/libmodplug/sndfile.c +55 -156
- 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 +508 -325
- 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 +4594 -0
- data/ext/gosu/extconf.rb +33 -30
- data/include/Gosu/Audio.hpp +70 -85
- data/include/Gosu/Color.hpp +63 -107
- data/include/Gosu/Font.hpp +44 -50
- data/include/Gosu/Fwd.hpp +1 -1
- data/include/Gosu/Graphics.hpp +64 -75
- data/include/Gosu/GraphicsBase.hpp +32 -39
- 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 +4 -16
- data/include/Gosu/Platform.hpp +1 -51
- data/include/Gosu/Text.hpp +37 -40
- data/include/Gosu/TextInput.hpp +34 -40
- data/include/Gosu/Utility.hpp +10 -8
- data/include/Gosu/Version.hpp +1 -1
- data/include/Gosu/Window.hpp +73 -70
- data/lib/SDL2.dll +0 -0
- data/lib/gosu/compat.rb +28 -37
- data/lib/gosu/swig_patches.rb +31 -3
- data/lib/gosu.rb +2 -2
- data/lib64/SDL2.dll +0 -0
- data/rdoc/gosu.rb +9 -1
- data/src/Audio.cpp +86 -86
- data/src/AudioFile.hpp +6 -6
- data/src/AudioFileAudioToolbox.cpp +1 -1
- data/src/AudioFileSDLSound.cpp +1 -1
- data/src/AudioImpl.hpp +5 -5
- data/src/Bitmap.cpp +13 -13
- data/src/BitmapIO.cpp +0 -20
- data/src/BlockAllocator.cpp +2 -1
- data/src/Channel.cpp +22 -20
- data/src/Color.cpp +62 -55
- data/src/EmptyImageData.hpp +16 -18
- data/src/FileUnix.cpp +1 -1
- data/src/FileWin.cpp +1 -1
- data/src/Font.cpp +52 -57
- data/src/GosuViewController.cpp +2 -0
- data/src/Graphics.cpp +135 -143
- data/src/Image.cpp +42 -42
- data/src/Input.cpp +1 -1
- data/src/InputUIKit.cpp +1 -1
- data/src/LargeImageData.cpp +120 -113
- data/src/LargeImageData.hpp +18 -16
- data/src/Log.hpp +6 -6
- data/src/Macro.cpp +124 -169
- data/src/Macro.hpp +11 -11
- data/src/Math.cpp +8 -1
- data/src/RenderState.hpp +5 -5
- data/src/Resolution.cpp +114 -61
- data/src/RubyGosu.cxx +470 -501
- data/src/RubyGosu.h +3 -2
- data/src/TexChunk.cpp +50 -41
- data/src/TexChunk.hpp +22 -22
- data/src/Text.cpp +58 -59
- data/src/TextBuilder.cpp +60 -57
- data/src/TextBuilder.hpp +20 -20
- data/src/TextInput.cpp +127 -135
- data/src/TrueTypeFont.cpp +108 -108
- data/src/TrueTypeFont.hpp +39 -38
- data/src/TrueTypeFontApple.cpp +27 -23
- data/src/TrueTypeFontUnix.cpp +21 -26
- data/src/TrueTypeFontWin.cpp +30 -30
- data/src/Utility.cpp +82 -23
- data/src/WinUtility.hpp +2 -1
- data/src/Window.cpp +103 -86
- data/src/WindowUIKit.cpp +48 -51
- metadata +8 -20
- 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
- data/src/UtilityApple.cpp +0 -16
- data/src/UtilityWin.cpp +0 -17
@@ -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
|
@@ -112,90 +112,283 @@ typedef enum
|
|
112
112
|
|
113
113
|
|
114
114
|
/**
|
115
|
-
*
|
115
|
+
* Set the priority of all log categories.
|
116
|
+
*
|
117
|
+
* \param priority the SDL_LogPriority to assign
|
118
|
+
*
|
119
|
+
* \since This function is available since SDL 2.0.0.
|
120
|
+
*
|
121
|
+
* \sa SDL_LogSetPriority
|
116
122
|
*/
|
117
123
|
extern DECLSPEC void SDLCALL SDL_LogSetAllPriority(SDL_LogPriority priority);
|
118
124
|
|
119
125
|
/**
|
120
|
-
*
|
126
|
+
* Set the priority of a particular log category.
|
127
|
+
*
|
128
|
+
* \param category the category to assign a priority to
|
129
|
+
* \param priority the SDL_LogPriority to assign
|
130
|
+
*
|
131
|
+
* \since This function is available since SDL 2.0.0.
|
132
|
+
*
|
133
|
+
* \sa SDL_LogGetPriority
|
134
|
+
* \sa SDL_LogSetAllPriority
|
121
135
|
*/
|
122
136
|
extern DECLSPEC void SDLCALL SDL_LogSetPriority(int category,
|
123
137
|
SDL_LogPriority priority);
|
124
138
|
|
125
139
|
/**
|
126
|
-
*
|
140
|
+
* Get the priority of a particular log category.
|
141
|
+
*
|
142
|
+
* \param category the category to query
|
143
|
+
* \returns the SDL_LogPriority for the requested category
|
144
|
+
*
|
145
|
+
* \since This function is available since SDL 2.0.0.
|
146
|
+
*
|
147
|
+
* \sa SDL_LogSetPriority
|
127
148
|
*/
|
128
149
|
extern DECLSPEC SDL_LogPriority SDLCALL SDL_LogGetPriority(int category);
|
129
150
|
|
130
151
|
/**
|
131
|
-
*
|
152
|
+
* Reset all priorities to default.
|
132
153
|
*
|
133
|
-
*
|
154
|
+
* This is called by SDL_Quit().
|
155
|
+
*
|
156
|
+
* \since This function is available since SDL 2.0.0.
|
157
|
+
*
|
158
|
+
* \sa SDL_LogSetAllPriority
|
159
|
+
* \sa SDL_LogSetPriority
|
134
160
|
*/
|
135
161
|
extern DECLSPEC void SDLCALL SDL_LogResetPriorities(void);
|
136
162
|
|
137
163
|
/**
|
138
|
-
*
|
164
|
+
* Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO.
|
165
|
+
*
|
166
|
+
* = * \param fmt a printf() style message format string
|
167
|
+
*
|
168
|
+
* \param ... additional parameters matching % tokens in the `fmt` string, if
|
169
|
+
* any
|
170
|
+
*
|
171
|
+
* \since This function is available since SDL 2.0.0.
|
172
|
+
*
|
173
|
+
* \sa SDL_LogCritical
|
174
|
+
* \sa SDL_LogDebug
|
175
|
+
* \sa SDL_LogError
|
176
|
+
* \sa SDL_LogInfo
|
177
|
+
* \sa SDL_LogMessage
|
178
|
+
* \sa SDL_LogMessageV
|
179
|
+
* \sa SDL_LogVerbose
|
180
|
+
* \sa SDL_LogWarn
|
139
181
|
*/
|
140
182
|
extern DECLSPEC void SDLCALL SDL_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
|
141
183
|
|
142
184
|
/**
|
143
|
-
*
|
185
|
+
* Log a message with SDL_LOG_PRIORITY_VERBOSE.
|
186
|
+
*
|
187
|
+
* \param category the category of the message
|
188
|
+
* \param fmt a printf() style message format string
|
189
|
+
* \param ... additional parameters matching % tokens in the **fmt** string,
|
190
|
+
* if any
|
191
|
+
*
|
192
|
+
* \since This function is available since SDL 2.0.0.
|
193
|
+
*
|
194
|
+
* \sa SDL_Log
|
195
|
+
* \sa SDL_LogCritical
|
196
|
+
* \sa SDL_LogDebug
|
197
|
+
* \sa SDL_LogError
|
198
|
+
* \sa SDL_LogInfo
|
199
|
+
* \sa SDL_LogMessage
|
200
|
+
* \sa SDL_LogMessageV
|
201
|
+
* \sa SDL_LogWarn
|
144
202
|
*/
|
145
203
|
extern DECLSPEC void SDLCALL SDL_LogVerbose(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
146
204
|
|
147
205
|
/**
|
148
|
-
*
|
206
|
+
* Log a message with SDL_LOG_PRIORITY_DEBUG.
|
207
|
+
*
|
208
|
+
* \param category the category of the message
|
209
|
+
* \param fmt a printf() style message format string
|
210
|
+
* \param ... additional parameters matching % tokens in the **fmt** string,
|
211
|
+
* if any
|
212
|
+
*
|
213
|
+
* \since This function is available since SDL 2.0.0.
|
214
|
+
*
|
215
|
+
* \sa SDL_Log
|
216
|
+
* \sa SDL_LogCritical
|
217
|
+
* \sa SDL_LogError
|
218
|
+
* \sa SDL_LogInfo
|
219
|
+
* \sa SDL_LogMessage
|
220
|
+
* \sa SDL_LogMessageV
|
221
|
+
* \sa SDL_LogVerbose
|
222
|
+
* \sa SDL_LogWarn
|
149
223
|
*/
|
150
224
|
extern DECLSPEC void SDLCALL SDL_LogDebug(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
151
225
|
|
152
226
|
/**
|
153
|
-
*
|
227
|
+
* Log a message with SDL_LOG_PRIORITY_INFO.
|
228
|
+
*
|
229
|
+
* \param category the category of the message
|
230
|
+
* \param fmt a printf() style message format string
|
231
|
+
* \param ... additional parameters matching % tokens in the **fmt** string,
|
232
|
+
* if any
|
233
|
+
*
|
234
|
+
* \since This function is available since SDL 2.0.0.
|
235
|
+
*
|
236
|
+
* \sa SDL_Log
|
237
|
+
* \sa SDL_LogCritical
|
238
|
+
* \sa SDL_LogDebug
|
239
|
+
* \sa SDL_LogError
|
240
|
+
* \sa SDL_LogMessage
|
241
|
+
* \sa SDL_LogMessageV
|
242
|
+
* \sa SDL_LogVerbose
|
243
|
+
* \sa SDL_LogWarn
|
154
244
|
*/
|
155
245
|
extern DECLSPEC void SDLCALL SDL_LogInfo(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
156
246
|
|
157
247
|
/**
|
158
|
-
*
|
248
|
+
* Log a message with SDL_LOG_PRIORITY_WARN.
|
249
|
+
*
|
250
|
+
* \param category the category of the message
|
251
|
+
* \param fmt a printf() style message format string
|
252
|
+
* \param ... additional parameters matching % tokens in the **fmt** string,
|
253
|
+
* if any
|
254
|
+
*
|
255
|
+
* \since This function is available since SDL 2.0.0.
|
256
|
+
*
|
257
|
+
* \sa SDL_Log
|
258
|
+
* \sa SDL_LogCritical
|
259
|
+
* \sa SDL_LogDebug
|
260
|
+
* \sa SDL_LogError
|
261
|
+
* \sa SDL_LogInfo
|
262
|
+
* \sa SDL_LogMessage
|
263
|
+
* \sa SDL_LogMessageV
|
264
|
+
* \sa SDL_LogVerbose
|
159
265
|
*/
|
160
266
|
extern DECLSPEC void SDLCALL SDL_LogWarn(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
161
267
|
|
162
268
|
/**
|
163
|
-
*
|
269
|
+
* Log a message with SDL_LOG_PRIORITY_ERROR.
|
270
|
+
*
|
271
|
+
* \param category the category of the message
|
272
|
+
* \param fmt a printf() style message format string
|
273
|
+
* \param ... additional parameters matching % tokens in the **fmt** string,
|
274
|
+
* if any
|
275
|
+
*
|
276
|
+
* \since This function is available since SDL 2.0.0.
|
277
|
+
*
|
278
|
+
* \sa SDL_Log
|
279
|
+
* \sa SDL_LogCritical
|
280
|
+
* \sa SDL_LogDebug
|
281
|
+
* \sa SDL_LogInfo
|
282
|
+
* \sa SDL_LogMessage
|
283
|
+
* \sa SDL_LogMessageV
|
284
|
+
* \sa SDL_LogVerbose
|
285
|
+
* \sa SDL_LogWarn
|
164
286
|
*/
|
165
287
|
extern DECLSPEC void SDLCALL SDL_LogError(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
166
288
|
|
167
289
|
/**
|
168
|
-
*
|
290
|
+
* Log a message with SDL_LOG_PRIORITY_CRITICAL.
|
291
|
+
*
|
292
|
+
* \param category the category of the message
|
293
|
+
* \param fmt a printf() style message format string
|
294
|
+
* \param ... additional parameters matching % tokens in the **fmt** string,
|
295
|
+
* if any
|
296
|
+
*
|
297
|
+
* \since This function is available since SDL 2.0.0.
|
298
|
+
*
|
299
|
+
* \sa SDL_Log
|
300
|
+
* \sa SDL_LogDebug
|
301
|
+
* \sa SDL_LogError
|
302
|
+
* \sa SDL_LogInfo
|
303
|
+
* \sa SDL_LogMessage
|
304
|
+
* \sa SDL_LogMessageV
|
305
|
+
* \sa SDL_LogVerbose
|
306
|
+
* \sa SDL_LogWarn
|
169
307
|
*/
|
170
308
|
extern DECLSPEC void SDLCALL SDL_LogCritical(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
171
309
|
|
172
310
|
/**
|
173
|
-
*
|
311
|
+
* Log a message with the specified category and priority.
|
312
|
+
*
|
313
|
+
* \param category the category of the message
|
314
|
+
* \param priority the priority of the message
|
315
|
+
* \param fmt a printf() style message format string
|
316
|
+
* \param ... additional parameters matching % tokens in the **fmt** string,
|
317
|
+
* if any
|
318
|
+
*
|
319
|
+
* \since This function is available since SDL 2.0.0.
|
320
|
+
*
|
321
|
+
* \sa SDL_Log
|
322
|
+
* \sa SDL_LogCritical
|
323
|
+
* \sa SDL_LogDebug
|
324
|
+
* \sa SDL_LogError
|
325
|
+
* \sa SDL_LogInfo
|
326
|
+
* \sa SDL_LogMessageV
|
327
|
+
* \sa SDL_LogVerbose
|
328
|
+
* \sa SDL_LogWarn
|
174
329
|
*/
|
175
330
|
extern DECLSPEC void SDLCALL SDL_LogMessage(int category,
|
176
331
|
SDL_LogPriority priority,
|
177
332
|
SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(3);
|
178
333
|
|
179
334
|
/**
|
180
|
-
*
|
335
|
+
* Log a message with the specified category and priority.
|
336
|
+
*
|
337
|
+
* \param category the category of the message
|
338
|
+
* \param priority the priority of the message
|
339
|
+
* \param fmt a printf() style message format string
|
340
|
+
* \param ap a variable argument list
|
341
|
+
*
|
342
|
+
* \since This function is available since SDL 2.0.0.
|
343
|
+
*
|
344
|
+
* \sa SDL_Log
|
345
|
+
* \sa SDL_LogCritical
|
346
|
+
* \sa SDL_LogDebug
|
347
|
+
* \sa SDL_LogError
|
348
|
+
* \sa SDL_LogInfo
|
349
|
+
* \sa SDL_LogMessage
|
350
|
+
* \sa SDL_LogVerbose
|
351
|
+
* \sa SDL_LogWarn
|
181
352
|
*/
|
182
353
|
extern DECLSPEC void SDLCALL SDL_LogMessageV(int category,
|
183
354
|
SDL_LogPriority priority,
|
184
355
|
const char *fmt, va_list ap);
|
185
356
|
|
186
357
|
/**
|
187
|
-
*
|
358
|
+
* The prototype for the log output callback function.
|
359
|
+
*
|
360
|
+
* This function is called by SDL when there is new text to be logged.
|
361
|
+
*
|
362
|
+
* \param userdata what was passed as `userdata` to SDL_LogSetOutputFunction()
|
363
|
+
* \param category the category of the message
|
364
|
+
* \param priority the priority of the message
|
365
|
+
* \param message the message being output
|
188
366
|
*/
|
189
367
|
typedef void (SDLCALL *SDL_LogOutputFunction)(void *userdata, int category, SDL_LogPriority priority, const char *message);
|
190
368
|
|
191
369
|
/**
|
192
|
-
*
|
370
|
+
* Get the current log output function.
|
371
|
+
*
|
372
|
+
* \param callback an SDL_LogOutputFunction filled in with the current log
|
373
|
+
* callback
|
374
|
+
* \param userdata a pointer filled in with the pointer that is passed to
|
375
|
+
* `callback`
|
376
|
+
*
|
377
|
+
* \since This function is available since SDL 2.0.0.
|
378
|
+
*
|
379
|
+
* \sa SDL_LogSetOutputFunction
|
193
380
|
*/
|
194
381
|
extern DECLSPEC void SDLCALL SDL_LogGetOutputFunction(SDL_LogOutputFunction *callback, void **userdata);
|
195
382
|
|
196
383
|
/**
|
197
|
-
*
|
198
|
-
*
|
384
|
+
* Replace the default log output function with one of your own.
|
385
|
+
*
|
386
|
+
* \param callback an SDL_LogOutputFunction to call instead of the default
|
387
|
+
* \param userdata a pointer that is passed to `callback`
|
388
|
+
*
|
389
|
+
* \since This function is available since SDL 2.0.0.
|
390
|
+
*
|
391
|
+
* \sa SDL_LogGetOutputFunction
|
199
392
|
*/
|
200
393
|
extern DECLSPEC void SDLCALL SDL_LogSetOutputFunction(SDL_LogOutputFunction callback, void *userdata);
|
201
394
|
|
@@ -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
|
@@ -83,6 +83,15 @@
|
|
83
83
|
*/
|
84
84
|
#define SDL_MAIN_NEEDED
|
85
85
|
|
86
|
+
#elif defined(__PSP__)
|
87
|
+
/* On PSP SDL provides a main function that sets the module info,
|
88
|
+
activates the GPU and starts the thread required to be able to exit
|
89
|
+
the software.
|
90
|
+
|
91
|
+
If you provide this yourself, you may define SDL_MAIN_HANDLED
|
92
|
+
*/
|
93
|
+
#define SDL_MAIN_AVAILABLE
|
94
|
+
|
86
95
|
#endif
|
87
96
|
#endif /* SDL_MAIN_HANDLED */
|
88
97
|
|
@@ -122,20 +131,62 @@ extern SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[]);
|
|
122
131
|
|
123
132
|
|
124
133
|
/**
|
125
|
-
*
|
126
|
-
*
|
134
|
+
* Circumvent failure of SDL_Init() when not using SDL_main() as an entry
|
135
|
+
* point.
|
136
|
+
*
|
137
|
+
* This function is defined in SDL_main.h, along with the preprocessor rule to
|
138
|
+
* redefine main() as SDL_main(). Thus to ensure that your main() function
|
139
|
+
* will not be changed it is necessary to define SDL_MAIN_HANDLED before
|
140
|
+
* including SDL.h.
|
127
141
|
*
|
128
|
-
*
|
129
|
-
*
|
142
|
+
* \since This function is available since SDL 2.0.0.
|
143
|
+
*
|
144
|
+
* \sa SDL_Init
|
130
145
|
*/
|
131
146
|
extern DECLSPEC void SDLCALL SDL_SetMainReady(void);
|
132
147
|
|
133
148
|
#ifdef __WIN32__
|
134
149
|
|
135
150
|
/**
|
136
|
-
*
|
151
|
+
* Register a win32 window class for SDL's use.
|
152
|
+
*
|
153
|
+
* This can be called to set the application window class at startup. It is
|
154
|
+
* safe to call this multiple times, as long as every call is eventually
|
155
|
+
* paired with a call to SDL_UnregisterApp, but a second registration attempt
|
156
|
+
* while a previous registration is still active will be ignored, other than
|
157
|
+
* to increment a counter.
|
158
|
+
*
|
159
|
+
* Most applications do not need to, and should not, call this directly; SDL
|
160
|
+
* will call it when initializing the video subsystem.
|
161
|
+
*
|
162
|
+
* \param name the window class name, in UTF-8 encoding. If NULL, SDL
|
163
|
+
* currently uses "SDL_app" but this isn't guaranteed.
|
164
|
+
* \param style the value to use in WNDCLASSEX::style. If `name` is NULL, SDL
|
165
|
+
* currently uses `(CS_BYTEALIGNCLIENT | CS_OWNDC)` regardless of
|
166
|
+
* what is specified here.
|
167
|
+
* \param hInst the HINSTANCE to use in WNDCLASSEX::hInstance. If zero, SDL
|
168
|
+
* will use `GetModuleHandle(NULL)` instead.
|
169
|
+
* \returns 0 on success, -1 on error. SDL_GetError() may have details.
|
170
|
+
*
|
171
|
+
* \since This function is available since SDL 2.0.2.
|
172
|
+
*/
|
173
|
+
extern DECLSPEC int SDLCALL SDL_RegisterApp(const char *name, Uint32 style, void *hInst);
|
174
|
+
|
175
|
+
/**
|
176
|
+
* Deregister the win32 window class from an SDL_RegisterApp call.
|
177
|
+
*
|
178
|
+
* This can be called to undo the effects of SDL_RegisterApp.
|
179
|
+
*
|
180
|
+
* Most applications do not need to, and should not, call this directly; SDL
|
181
|
+
* will call it when deinitializing the video subsystem.
|
182
|
+
*
|
183
|
+
* It is safe to call this multiple times, as long as every call is eventually
|
184
|
+
* paired with a prior call to SDL_RegisterApp. The window class will only be
|
185
|
+
* deregistered when the registration counter in SDL_RegisterApp decrements to
|
186
|
+
* zero through calls to this function.
|
187
|
+
*
|
188
|
+
* \since This function is available since SDL 2.0.2.
|
137
189
|
*/
|
138
|
-
extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst);
|
139
190
|
extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
|
140
191
|
|
141
192
|
#endif /* __WIN32__ */
|
@@ -144,12 +195,14 @@ extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
|
|
144
195
|
#ifdef __WINRT__
|
145
196
|
|
146
197
|
/**
|
147
|
-
*
|
198
|
+
* Initialize and launch an SDL/WinRT application.
|
148
199
|
*
|
149
|
-
*
|
150
|
-
*
|
151
|
-
*
|
152
|
-
*
|
200
|
+
* \param mainFunction the SDL app's C-style main(), an SDL_main_func
|
201
|
+
* \param reserved reserved for future use; should be NULL
|
202
|
+
* \returns 0 on success or -1 on failure; call SDL_GetError() to retrieve
|
203
|
+
* more information on the failure.
|
204
|
+
*
|
205
|
+
* \since This function is available since SDL 2.0.3.
|
153
206
|
*/
|
154
207
|
extern DECLSPEC int SDLCALL SDL_WinRTRunApp(SDL_main_func mainFunction, void * reserved);
|
155
208
|
|
@@ -158,12 +211,14 @@ extern DECLSPEC int SDLCALL SDL_WinRTRunApp(SDL_main_func mainFunction, void * r
|
|
158
211
|
#if defined(__IPHONEOS__)
|
159
212
|
|
160
213
|
/**
|
161
|
-
*
|
214
|
+
* Initializes and launches an SDL application.
|
215
|
+
*
|
216
|
+
* \param argc The argc parameter from the application's main() function
|
217
|
+
* \param argv The argv parameter from the application's main() function
|
218
|
+
* \param mainFunction The SDL app's C-style main(), an SDL_main_func
|
219
|
+
* \return the return value from mainFunction
|
162
220
|
*
|
163
|
-
*
|
164
|
-
* \param argv The argv parameter from the application's main() function
|
165
|
-
* \param mainFunction The SDL app's C-style main().
|
166
|
-
* \return the return value from mainFunction
|
221
|
+
* \since This function is available since SDL 2.0.10.
|
167
222
|
*/
|
168
223
|
extern DECLSPEC int SDLCALL SDL_UIKitRunApp(int argc, char *argv[], SDL_main_func mainFunction);
|
169
224
|
|
@@ -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
|
@@ -32,7 +32,7 @@ extern "C" {
|
|
32
32
|
#endif
|
33
33
|
|
34
34
|
/**
|
35
|
-
*
|
35
|
+
* SDL_MessageBox flags. If supported will display warning icon, etc.
|
36
36
|
*/
|
37
37
|
typedef enum
|
38
38
|
{
|
@@ -44,7 +44,7 @@ typedef enum
|
|
44
44
|
} SDL_MessageBoxFlags;
|
45
45
|
|
46
46
|
/**
|
47
|
-
*
|
47
|
+
* Flags for SDL_MessageBoxButtonData.
|
48
48
|
*/
|
49
49
|
typedef enum
|
50
50
|
{
|
@@ -53,7 +53,7 @@ typedef enum
|
|
53
53
|
} SDL_MessageBoxButtonFlags;
|
54
54
|
|
55
55
|
/**
|
56
|
-
*
|
56
|
+
* Individual button data.
|
57
57
|
*/
|
58
58
|
typedef struct
|
59
59
|
{
|
@@ -63,7 +63,7 @@ typedef struct
|
|
63
63
|
} SDL_MessageBoxButtonData;
|
64
64
|
|
65
65
|
/**
|
66
|
-
*
|
66
|
+
* RGB value used in a message box color scheme
|
67
67
|
*/
|
68
68
|
typedef struct
|
69
69
|
{
|
@@ -81,7 +81,7 @@ typedef enum
|
|
81
81
|
} SDL_MessageBoxColorType;
|
82
82
|
|
83
83
|
/**
|
84
|
-
*
|
84
|
+
* A set of colors to use for message box dialogs
|
85
85
|
*/
|
86
86
|
typedef struct
|
87
87
|
{
|
@@ -89,7 +89,7 @@ typedef struct
|
|
89
89
|
} SDL_MessageBoxColorScheme;
|
90
90
|
|
91
91
|
/**
|
92
|
-
*
|
92
|
+
* MessageBox structure containing title, text, window, etc.
|
93
93
|
*/
|
94
94
|
typedef struct
|
95
95
|
{
|
@@ -105,32 +105,79 @@ typedef struct
|
|
105
105
|
} SDL_MessageBoxData;
|
106
106
|
|
107
107
|
/**
|
108
|
-
*
|
108
|
+
* Create a modal message box.
|
109
109
|
*
|
110
|
-
*
|
111
|
-
*
|
110
|
+
* If your needs aren't complex, it might be easier to use
|
111
|
+
* SDL_ShowSimpleMessageBox.
|
112
112
|
*
|
113
|
-
*
|
114
|
-
*
|
113
|
+
* This function should be called on the thread that created the parent
|
114
|
+
* window, or on the main thread if the messagebox has no parent. It will
|
115
|
+
* block execution of that thread until the user clicks a button or closes the
|
116
|
+
* messagebox.
|
115
117
|
*
|
116
|
-
*
|
117
|
-
*
|
118
|
-
*
|
119
|
-
*
|
118
|
+
* This function may be called at any time, even before SDL_Init(). This makes
|
119
|
+
* it useful for reporting errors like a failure to create a renderer or
|
120
|
+
* OpenGL context.
|
121
|
+
*
|
122
|
+
* On X11, SDL rolls its own dialog box with X11 primitives instead of a
|
123
|
+
* formal toolkit like GTK+ or Qt.
|
124
|
+
*
|
125
|
+
* Note that if SDL_Init() would fail because there isn't any available video
|
126
|
+
* target, this function is likely to fail for the same reasons. If this is a
|
127
|
+
* concern, check the return value from this function and fall back to writing
|
128
|
+
* to stderr if you can.
|
129
|
+
*
|
130
|
+
* \param messageboxdata the SDL_MessageBoxData structure with title, text and
|
131
|
+
* other options
|
132
|
+
* \param buttonid the pointer to which user id of hit button should be copied
|
133
|
+
* \returns 0 on success or a negative error code on failure; call
|
134
|
+
* SDL_GetError() for more information.
|
135
|
+
*
|
136
|
+
* \since This function is available since SDL 2.0.0.
|
137
|
+
*
|
138
|
+
* \sa SDL_ShowSimpleMessageBox
|
120
139
|
*/
|
121
140
|
extern DECLSPEC int SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid);
|
122
141
|
|
123
142
|
/**
|
124
|
-
*
|
143
|
+
* Display a simple modal message box.
|
144
|
+
*
|
145
|
+
* If your needs aren't complex, this function is preferred over
|
146
|
+
* SDL_ShowMessageBox.
|
147
|
+
*
|
148
|
+
* `flags` may be any of the following:
|
149
|
+
*
|
150
|
+
* - `SDL_MESSAGEBOX_ERROR`: error dialog
|
151
|
+
* - `SDL_MESSAGEBOX_WARNING`: warning dialog
|
152
|
+
* - `SDL_MESSAGEBOX_INFORMATION`: informational dialog
|
153
|
+
*
|
154
|
+
* This function should be called on the thread that created the parent
|
155
|
+
* window, or on the main thread if the messagebox has no parent. It will
|
156
|
+
* block execution of that thread until the user clicks a button or closes the
|
157
|
+
* messagebox.
|
158
|
+
*
|
159
|
+
* This function may be called at any time, even before SDL_Init(). This makes
|
160
|
+
* it useful for reporting errors like a failure to create a renderer or
|
161
|
+
* OpenGL context.
|
162
|
+
*
|
163
|
+
* On X11, SDL rolls its own dialog box with X11 primitives instead of a
|
164
|
+
* formal toolkit like GTK+ or Qt.
|
165
|
+
*
|
166
|
+
* Note that if SDL_Init() would fail because there isn't any available video
|
167
|
+
* target, this function is likely to fail for the same reasons. If this is a
|
168
|
+
* concern, check the return value from this function and fall back to writing
|
169
|
+
* to stderr if you can.
|
125
170
|
*
|
126
|
-
*
|
127
|
-
*
|
128
|
-
*
|
129
|
-
*
|
171
|
+
* \param flags an SDL_MessageBoxFlags value
|
172
|
+
* \param title UTF-8 title text
|
173
|
+
* \param message UTF-8 message text
|
174
|
+
* \param window the parent window, or NULL for no parent
|
175
|
+
* \returns 0 on success or a negative error code on failure; call
|
176
|
+
* SDL_GetError() for more information.
|
130
177
|
*
|
131
|
-
*
|
178
|
+
* \since This function is available since SDL 2.0.0.
|
132
179
|
*
|
133
|
-
*
|
180
|
+
* \sa SDL_ShowMessageBox
|
134
181
|
*/
|
135
182
|
extern DECLSPEC int SDLCALL SDL_ShowSimpleMessageBox(Uint32 flags, const char *title, const char *message, SDL_Window *window);
|
136
183
|
|