ruby2d 0.9.5 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/include/SDL2/SDL.h +4 -1
- data/assets/include/SDL2/SDL_assert.h +3 -1
- data/assets/include/SDL2/SDL_atomic.h +1 -1
- data/assets/include/SDL2/SDL_audio.h +1 -1
- data/assets/include/SDL2/SDL_bits.h +1 -1
- data/assets/include/SDL2/SDL_blendmode.h +4 -1
- data/assets/include/SDL2/SDL_clipboard.h +1 -1
- data/assets/include/SDL2/SDL_config.h +1 -1
- data/assets/include/SDL2/SDL_config_android.h +7 -3
- data/assets/include/SDL2/SDL_config_iphoneos.h +16 -10
- data/assets/include/SDL2/SDL_config_macosx.h +40 -14
- data/assets/include/SDL2/SDL_config_minimal.h +1 -1
- data/assets/include/SDL2/SDL_config_os2.h +26 -8
- data/assets/include/SDL2/SDL_config_pandora.h +4 -2
- data/assets/include/SDL2/SDL_config_psp.h +2 -1
- data/assets/include/SDL2/SDL_config_windows.h +40 -9
- data/assets/include/SDL2/SDL_config_winrt.h +5 -2
- data/assets/include/SDL2/SDL_config_wiz.h +5 -2
- data/assets/include/SDL2/SDL_copying.h +1 -1
- data/assets/include/SDL2/SDL_cpuinfo.h +32 -3
- data/assets/include/SDL2/SDL_egl.h +4 -1
- data/assets/include/SDL2/SDL_endian.h +6 -3
- data/assets/include/SDL2/SDL_error.h +38 -2
- data/assets/include/SDL2/SDL_events.h +64 -28
- data/assets/include/SDL2/SDL_filesystem.h +1 -1
- data/assets/include/SDL2/SDL_gamecontroller.h +160 -9
- data/assets/include/SDL2/SDL_gesture.h +1 -1
- data/assets/include/SDL2/SDL_haptic.h +10 -1
- data/assets/include/SDL2/SDL_hints.h +316 -4
- data/assets/include/SDL2/SDL_joystick.h +115 -24
- data/assets/include/SDL2/SDL_keyboard.h +1 -1
- data/assets/include/SDL2/SDL_keycode.h +11 -9
- data/assets/include/SDL2/SDL_loadso.h +1 -1
- data/assets/include/SDL2/SDL_locale.h +101 -0
- data/assets/include/SDL2/SDL_log.h +3 -3
- data/assets/include/SDL2/SDL_main.h +1 -1
- data/assets/include/SDL2/SDL_messagebox.h +6 -4
- data/assets/include/SDL2/SDL_metal.h +117 -0
- data/assets/include/SDL2/SDL_misc.h +75 -0
- data/assets/include/SDL2/SDL_mouse.h +1 -1
- data/assets/include/SDL2/SDL_mutex.h +1 -1
- data/assets/include/SDL2/SDL_name.h +1 -1
- data/assets/include/SDL2/SDL_opengl.h +1 -1
- data/assets/include/SDL2/SDL_opengl_glext.h +3 -0
- data/assets/include/SDL2/SDL_opengles.h +1 -1
- data/assets/include/SDL2/SDL_opengles2.h +1 -1
- data/assets/include/SDL2/SDL_pixels.h +25 -16
- data/assets/include/SDL2/SDL_platform.h +1 -1
- data/assets/include/SDL2/SDL_power.h +1 -1
- data/assets/include/SDL2/SDL_quit.h +1 -1
- data/assets/include/SDL2/SDL_rect.h +1 -1
- data/assets/include/SDL2/SDL_render.h +63 -3
- data/assets/include/SDL2/SDL_revision.h +2 -2
- data/assets/include/SDL2/SDL_rwops.h +2 -10
- data/assets/include/SDL2/SDL_scancode.h +1 -1
- data/assets/include/SDL2/SDL_sensor.h +25 -9
- data/assets/include/SDL2/SDL_shape.h +1 -1
- data/assets/include/SDL2/SDL_stdinc.h +44 -4
- data/assets/include/SDL2/SDL_surface.h +11 -2
- data/assets/include/SDL2/SDL_system.h +50 -4
- data/assets/include/SDL2/SDL_syswm.h +29 -2
- data/assets/include/SDL2/SDL_test.h +1 -1
- data/assets/include/SDL2/SDL_test_assert.h +1 -1
- data/assets/include/SDL2/SDL_test_common.h +14 -1
- data/assets/include/SDL2/SDL_test_compare.h +1 -1
- data/assets/include/SDL2/SDL_test_crc32.h +1 -1
- data/assets/include/SDL2/SDL_test_font.h +1 -1
- data/assets/include/SDL2/SDL_test_fuzzer.h +1 -1
- data/assets/include/SDL2/SDL_test_harness.h +1 -1
- data/assets/include/SDL2/SDL_test_images.h +1 -1
- data/assets/include/SDL2/SDL_test_log.h +1 -1
- data/assets/include/SDL2/SDL_test_md5.h +1 -1
- data/assets/include/SDL2/SDL_test_memory.h +1 -1
- data/assets/include/SDL2/SDL_test_random.h +1 -1
- data/assets/include/SDL2/SDL_thread.h +34 -11
- data/assets/include/SDL2/SDL_timer.h +1 -1
- data/assets/include/SDL2/SDL_touch.h +1 -1
- data/assets/include/SDL2/SDL_types.h +1 -1
- data/assets/include/SDL2/SDL_version.h +2 -2
- data/assets/include/SDL2/SDL_video.h +11 -5
- data/assets/include/SDL2/SDL_vulkan.h +6 -8
- data/assets/include/SDL2/begin_code.h +5 -9
- data/assets/include/SDL2/close_code.h +1 -1
- data/assets/macos/lib/libFLAC.a +0 -0
- data/assets/macos/lib/libSDL2.a +0 -0
- data/assets/macos/lib/libSDL2_image.a +0 -0
- data/assets/macos/lib/libSDL2_mixer.a +0 -0
- data/assets/macos/lib/libSDL2_ttf.a +0 -0
- data/assets/macos/lib/libfreetype.a +0 -0
- data/assets/macos/lib/libjpeg.a +0 -0
- data/assets/macos/lib/libmpg123.a +0 -0
- data/assets/macos/lib/libogg.a +0 -0
- data/assets/macos/lib/libpng16.a +0 -0
- data/assets/macos/lib/libtiff.a +0 -0
- data/assets/macos/lib/libvorbis.a +0 -0
- data/assets/macos/lib/libvorbisfile.a +0 -0
- data/assets/macos/lib/libwebp.a +0 -0
- data/assets/mingw/bin/SDL2.dll +0 -0
- data/assets/mingw/lib/libSDL2.a +0 -0
- data/assets/mingw/lib/libSDL2.dll.a +0 -0
- data/assets/mingw/lib/libSDL2_test.a +0 -0
- data/assets/mingw/lib/libSDL2main.a +0 -0
- data/ext/ruby2d/extconf.rb +1 -1
- data/ext/ruby2d/gl.c +17 -0
- data/ext/ruby2d/gl2.c +15 -0
- data/ext/ruby2d/gl3.c +15 -0
- data/ext/ruby2d/gles.c +15 -0
- data/ext/ruby2d/music.c +13 -0
- data/ext/ruby2d/ruby2d.c +306 -168
- data/ext/ruby2d/ruby2d.h +32 -0
- data/ext/ruby2d/sound.c +25 -0
- data/ext/ruby2d/tileset.c +30 -0
- data/lib/ruby2d.rb +4 -1
- data/lib/ruby2d/circle.rb +18 -2
- data/lib/ruby2d/dsl.rb +16 -9
- data/lib/ruby2d/entity.rb +17 -0
- data/lib/ruby2d/font.rb +4 -3
- data/lib/ruby2d/image.rb +24 -1
- data/lib/ruby2d/line.rb +20 -0
- data/lib/ruby2d/music.rb +5 -0
- data/lib/ruby2d/pixel.rb +17 -0
- data/lib/ruby2d/quad.rb +18 -0
- data/lib/ruby2d/rectangle.rb +11 -2
- data/lib/ruby2d/renderable.rb +4 -8
- data/lib/ruby2d/sound.rb +5 -0
- data/lib/ruby2d/sprite.rb +35 -3
- data/lib/ruby2d/square.rb +9 -0
- data/lib/ruby2d/text.rb +22 -1
- data/lib/ruby2d/tileset.rb +69 -0
- data/lib/ruby2d/triangle.rb +16 -0
- data/lib/ruby2d/version.rb +1 -1
- data/lib/ruby2d/window.rb +249 -22
- metadata +10 -3
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
Simple DirectMedia Layer
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2020 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
|
@@ -102,6 +102,8 @@
|
|
102
102
|
#define HAVE_SQRTF 1
|
103
103
|
#define HAVE_TAN 1
|
104
104
|
#define HAVE_TANF 1
|
105
|
+
#define HAVE_TRUNC 1
|
106
|
+
#define HAVE_TRUNCF 1
|
105
107
|
#define HAVE_SIGACTION 1
|
106
108
|
#define HAVE_SETJMP 1
|
107
109
|
#define HAVE_NANOSLEEP 1
|
@@ -110,8 +112,8 @@
|
|
110
112
|
#define SDL_AUDIO_DRIVER_OSS 1
|
111
113
|
|
112
114
|
#define SDL_INPUT_LINUXEV 1
|
113
|
-
#define SDL_INPUT_TSLIB 1
|
114
115
|
#define SDL_JOYSTICK_LINUX 1
|
116
|
+
#define SDL_JOYSTICK_VIRTUAL 1
|
115
117
|
#define SDL_HAPTIC_LINUX 1
|
116
118
|
|
117
119
|
#define SDL_SENSOR_DUMMY 1
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
Simple DirectMedia Layer
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2020 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
|
@@ -136,6 +136,7 @@
|
|
136
136
|
|
137
137
|
/* Enable the PSP joystick driver (src/joystick/psp/\*.c) */
|
138
138
|
#define SDL_JOYSTICK_PSP 1
|
139
|
+
#define SDL_JOYSTICK_VIRTUAL 1
|
139
140
|
|
140
141
|
/* Enable the dummy sensor driver */
|
141
142
|
#define SDL_SENSOR_DUMMY 1
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
Simple DirectMedia Layer
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2020 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
|
@@ -84,7 +84,7 @@ typedef unsigned int uintptr_t;
|
|
84
84
|
#define HAVE_XINPUT_H 1
|
85
85
|
#define HAVE_MMDEVICEAPI_H 1
|
86
86
|
#define HAVE_AUDIOCLIENT_H 1
|
87
|
-
#define
|
87
|
+
#define HAVE_SENSORSAPI_H
|
88
88
|
|
89
89
|
/* This is disabled by default to avoid C runtime dependencies and manifest requirements */
|
90
90
|
#ifdef HAVE_LIBC
|
@@ -118,6 +118,10 @@ typedef unsigned int uintptr_t;
|
|
118
118
|
#define HAVE_STRCHR 1
|
119
119
|
#define HAVE_STRRCHR 1
|
120
120
|
#define HAVE_STRSTR 1
|
121
|
+
/* #undef HAVE_STRTOK_R */
|
122
|
+
#if defined(_MSC_VER)
|
123
|
+
#define HAVE_STRTOK_S 1
|
124
|
+
#endif
|
121
125
|
/* These functions have security warnings, so we won't use them */
|
122
126
|
/* #undef HAVE__LTOA */
|
123
127
|
/* #undef HAVE__ULTOA */
|
@@ -130,6 +134,8 @@ typedef unsigned int uintptr_t;
|
|
130
134
|
#define HAVE_STRNCMP 1
|
131
135
|
#define HAVE__STRICMP 1
|
132
136
|
#define HAVE__STRNICMP 1
|
137
|
+
#define HAVE__WCSICMP 1
|
138
|
+
#define HAVE__WCSNICMP 1
|
133
139
|
#define HAVE_ACOS 1
|
134
140
|
#define HAVE_ACOSF 1
|
135
141
|
#define HAVE_ASIN 1
|
@@ -139,7 +145,7 @@ typedef unsigned int uintptr_t;
|
|
139
145
|
#define HAVE_ATAN2 1
|
140
146
|
#define HAVE_ATAN2F 1
|
141
147
|
#define HAVE_CEILF 1
|
142
|
-
#define HAVE__COPYSIGN
|
148
|
+
#define HAVE__COPYSIGN 1
|
143
149
|
#define HAVE_COS 1
|
144
150
|
#define HAVE_COSF 1
|
145
151
|
#define HAVE_EXP 1
|
@@ -168,7 +174,9 @@ typedef unsigned int uintptr_t;
|
|
168
174
|
#define HAVE_STRTOLL 1
|
169
175
|
#define HAVE_VSSCANF 1
|
170
176
|
#define HAVE_SCALBN 1
|
171
|
-
#define HAVE_SCALBNF
|
177
|
+
#define HAVE_SCALBNF 1
|
178
|
+
#define HAVE_TRUNC 1
|
179
|
+
#define HAVE_TRUNCF 1
|
172
180
|
#endif
|
173
181
|
/* This function is available with at least the VC++ 2008 C runtime library */
|
174
182
|
#if _MSC_VER >= 1400
|
@@ -183,6 +191,20 @@ typedef unsigned int uintptr_t;
|
|
183
191
|
#define HAVE_STDDEF_H 1
|
184
192
|
#endif
|
185
193
|
|
194
|
+
/* Check to see if we have Windows 10 build environment */
|
195
|
+
#if _MSC_VER >= 1911 /* Visual Studio 15.3 */
|
196
|
+
#include <sdkddkver.h>
|
197
|
+
#if _WIN32_WINNT >= 0x0601 /* Windows 7 */
|
198
|
+
#define SDL_WINDOWS7_SDK
|
199
|
+
#endif
|
200
|
+
#if _WIN32_WINNT >= 0x0602 /* Windows 8 */
|
201
|
+
#define SDL_WINDOWS8_SDK
|
202
|
+
#endif
|
203
|
+
#if _WIN32_WINNT >= 0x0A00 /* Windows 10 */
|
204
|
+
#define SDL_WINDOWS10_SDK
|
205
|
+
#endif
|
206
|
+
#endif /* _MSC_VER >= 1911 */
|
207
|
+
|
186
208
|
/* Enable various audio drivers */
|
187
209
|
#define SDL_AUDIO_DRIVER_WASAPI 1
|
188
210
|
#define SDL_AUDIO_DRIVER_DSOUND 1
|
@@ -192,13 +214,20 @@ typedef unsigned int uintptr_t;
|
|
192
214
|
|
193
215
|
/* Enable various input drivers */
|
194
216
|
#define SDL_JOYSTICK_DINPUT 1
|
195
|
-
#define SDL_JOYSTICK_XINPUT 1
|
196
217
|
#define SDL_JOYSTICK_HIDAPI 1
|
218
|
+
#ifndef __WINRT__
|
219
|
+
#define SDL_JOYSTICK_RAWINPUT 1
|
220
|
+
#endif
|
221
|
+
#define SDL_JOYSTICK_VIRTUAL 1
|
222
|
+
#ifdef SDL_WINDOWS10_SDK
|
223
|
+
#define SDL_JOYSTICK_WGI 1
|
224
|
+
#endif
|
225
|
+
#define SDL_JOYSTICK_XINPUT 1
|
197
226
|
#define SDL_HAPTIC_DINPUT 1
|
198
227
|
#define SDL_HAPTIC_XINPUT 1
|
199
228
|
|
200
|
-
/* Enable the
|
201
|
-
#define
|
229
|
+
/* Enable the sensor driver */
|
230
|
+
#define SDL_SENSOR_WINDOWS 1
|
202
231
|
|
203
232
|
/* Enable various shared object loading systems */
|
204
233
|
#define SDL_LOADSO_WINDOWS 1
|
@@ -216,8 +245,8 @@ typedef unsigned int uintptr_t;
|
|
216
245
|
#ifndef SDL_VIDEO_RENDER_D3D
|
217
246
|
#define SDL_VIDEO_RENDER_D3D 1
|
218
247
|
#endif
|
219
|
-
#
|
220
|
-
#define SDL_VIDEO_RENDER_D3D11
|
248
|
+
#ifdef SDL_WINDOWS7_SDK
|
249
|
+
#define SDL_VIDEO_RENDER_D3D11 1
|
221
250
|
#endif
|
222
251
|
|
223
252
|
/* Enable OpenGL support */
|
@@ -255,3 +284,5 @@ typedef unsigned int uintptr_t;
|
|
255
284
|
#endif
|
256
285
|
|
257
286
|
#endif /* SDL_config_windows_h_ */
|
287
|
+
|
288
|
+
/* vi: set ts=4 sw=4 expandtab: */
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
Simple DirectMedia Layer
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2020 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
|
@@ -100,7 +100,6 @@ typedef unsigned int uintptr_t;
|
|
100
100
|
|
101
101
|
#define HAVE_MMDEVICEAPI_H 1
|
102
102
|
#define HAVE_AUDIOCLIENT_H 1
|
103
|
-
#define HAVE_ENDPOINTVOLUME_H 1
|
104
103
|
|
105
104
|
#define HAVE_LIBC 1
|
106
105
|
#define STDC_HEADERS 1
|
@@ -131,6 +130,7 @@ typedef unsigned int uintptr_t;
|
|
131
130
|
#define HAVE_STRCHR 1
|
132
131
|
#define HAVE_STRRCHR 1
|
133
132
|
#define HAVE_STRSTR 1
|
133
|
+
#define HAVE_STRTOK_S 1
|
134
134
|
//#define HAVE_ITOA 1 // TODO, WinRT: consider using _itoa_s instead
|
135
135
|
//#define HAVE__LTOA 1 // TODO, WinRT: consider using _ltoa_s instead
|
136
136
|
//#define HAVE__ULTOA 1 // TODO, WinRT: consider using _ultoa_s instead
|
@@ -181,6 +181,8 @@ typedef unsigned int uintptr_t;
|
|
181
181
|
#define HAVE_SQRTF 1
|
182
182
|
#define HAVE_TAN 1
|
183
183
|
#define HAVE_TANF 1
|
184
|
+
#define HAVE_TRUNC 1
|
185
|
+
#define HAVE_TRUNCF 1
|
184
186
|
#define HAVE__FSEEKI64 1
|
185
187
|
|
186
188
|
/* Enable various audio drivers */
|
@@ -193,6 +195,7 @@ typedef unsigned int uintptr_t;
|
|
193
195
|
#define SDL_JOYSTICK_DISABLED 1
|
194
196
|
#define SDL_HAPTIC_DISABLED 1
|
195
197
|
#else
|
198
|
+
#define SDL_JOYSTICK_VIRTUAL 1
|
196
199
|
#define SDL_JOYSTICK_XINPUT 1
|
197
200
|
#define SDL_HAPTIC_XINPUT 1
|
198
201
|
#endif
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
Simple DirectMedia Layer
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2020 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
|
@@ -67,6 +67,7 @@
|
|
67
67
|
#define HAVE_STRCHR 1
|
68
68
|
#define HAVE_STRRCHR 1
|
69
69
|
#define HAVE_STRSTR 1
|
70
|
+
#define HAVE_STRTOK_R 1
|
70
71
|
#define HAVE_STRTOL 1
|
71
72
|
#define HAVE_STRTOUL 1
|
72
73
|
#define HAVE_STRTOLL 1
|
@@ -116,6 +117,8 @@
|
|
116
117
|
#define HAVE_SQRTF 1
|
117
118
|
#define HAVE_TAN 1
|
118
119
|
#define HAVE_TANF 1
|
120
|
+
#define HAVE_TRUNC 1
|
121
|
+
#define HAVE_TRUNCF 1
|
119
122
|
#define HAVE_SIGACTION 1
|
120
123
|
#define HAVE_SETJMP 1
|
121
124
|
#define HAVE_NANOSLEEP 1
|
@@ -125,8 +128,8 @@
|
|
125
128
|
#define SDL_AUDIO_DRIVER_OSS 1
|
126
129
|
|
127
130
|
#define SDL_INPUT_LINUXEV 1
|
128
|
-
#define SDL_INPUT_TSLIB 1
|
129
131
|
#define SDL_JOYSTICK_LINUX 1
|
132
|
+
#define SDL_JOYSTICK_VIRTUAL 1
|
130
133
|
#define SDL_HAPTIC_LINUX 1
|
131
134
|
|
132
135
|
#define SDL_SENSOR_DUMMY 1
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
Simple DirectMedia Layer
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2020 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
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
Simple DirectMedia Layer
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2020 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
|
@@ -73,8 +73,8 @@
|
|
73
73
|
# define __ARM_NEON 1 /* Set __ARM_NEON so that it can be used elsewhere, at compile time */
|
74
74
|
# endif
|
75
75
|
# if defined (_M_ARM64)
|
76
|
-
# include <
|
77
|
-
# include <
|
76
|
+
# include <arm64intr.h>
|
77
|
+
# include <arm64_neon.h>
|
78
78
|
# define __ARM_NEON 1 /* Set __ARM_NEON so that it can be used elsewhere, at compile time */
|
79
79
|
# endif
|
80
80
|
# endif
|
@@ -186,6 +186,11 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX2(void);
|
|
186
186
|
*/
|
187
187
|
extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX512F(void);
|
188
188
|
|
189
|
+
/**
|
190
|
+
* This function returns true if the CPU has ARM SIMD (ARMv6) features.
|
191
|
+
*/
|
192
|
+
extern DECLSPEC SDL_bool SDLCALL SDL_HasARMSIMD(void);
|
193
|
+
|
189
194
|
/**
|
190
195
|
* This function returns true if the CPU has NEON (ARM SIMD) features.
|
191
196
|
*/
|
@@ -241,10 +246,33 @@ extern DECLSPEC size_t SDLCALL SDL_SIMDGetAlignment(void);
|
|
241
246
|
* \return Pointer to newly-allocated block, NULL if out of memory.
|
242
247
|
*
|
243
248
|
* \sa SDL_SIMDAlignment
|
249
|
+
* \sa SDL_SIMDRealloc
|
244
250
|
* \sa SDL_SIMDFree
|
245
251
|
*/
|
246
252
|
extern DECLSPEC void * SDLCALL SDL_SIMDAlloc(const size_t len);
|
247
253
|
|
254
|
+
/**
|
255
|
+
* \brief Reallocate memory obtained from SDL_SIMDAlloc
|
256
|
+
*
|
257
|
+
* It is not valid to use this function on a pointer from anything but
|
258
|
+
* SDL_SIMDAlloc(). It can't be used on pointers from malloc, realloc,
|
259
|
+
* SDL_malloc, memalign, new[], etc.
|
260
|
+
*
|
261
|
+
* \param mem The pointer obtained from SDL_SIMDAlloc. This function also
|
262
|
+
* accepts NULL, at which point this function is the same as
|
263
|
+
* calling SDL_realloc with a NULL pointer.
|
264
|
+
* \param len The length, in bytes, of the block to allocated. The actual
|
265
|
+
* allocated block might be larger due to padding, etc. Passing 0
|
266
|
+
* will return a non-NULL pointer, assuming the system isn't out of
|
267
|
+
* memory.
|
268
|
+
* \return Pointer to newly-reallocated block, NULL if out of memory.
|
269
|
+
*
|
270
|
+
* \sa SDL_SIMDAlignment
|
271
|
+
* \sa SDL_SIMDAlloc
|
272
|
+
* \sa SDL_SIMDFree
|
273
|
+
*/
|
274
|
+
extern DECLSPEC void * SDLCALL SDL_SIMDRealloc(void *mem, const size_t len);
|
275
|
+
|
248
276
|
/**
|
249
277
|
* \brief Deallocate memory obtained from SDL_SIMDAlloc
|
250
278
|
*
|
@@ -255,6 +283,7 @@ extern DECLSPEC void * SDLCALL SDL_SIMDAlloc(const size_t len);
|
|
255
283
|
* However, SDL_SIMDFree(NULL) is a legal no-op.
|
256
284
|
*
|
257
285
|
* \sa SDL_SIMDAlloc
|
286
|
+
* \sa SDL_SIMDRealloc
|
258
287
|
*/
|
259
288
|
extern DECLSPEC void SDLCALL SDL_SIMDFree(void *ptr);
|
260
289
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
Simple DirectMedia Layer
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2020 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
|
@@ -390,6 +390,9 @@ typedef enum {
|
|
390
390
|
#ifndef WIN32_LEAN_AND_MEAN
|
391
391
|
#define WIN32_LEAN_AND_MEAN 1
|
392
392
|
#endif
|
393
|
+
#ifndef NOMINMAX /* don't define min() and max(). */
|
394
|
+
#define NOMINMAX
|
395
|
+
#endif
|
393
396
|
#include <windows.h>
|
394
397
|
|
395
398
|
#if __WINRT__
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
Simple DirectMedia Layer
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2020 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
|
@@ -42,10 +42,13 @@
|
|
42
42
|
#ifdef __linux__
|
43
43
|
#include <endian.h>
|
44
44
|
#define SDL_BYTEORDER __BYTE_ORDER
|
45
|
-
#
|
45
|
+
#elif defined(__OpenBSD__)
|
46
|
+
#include <endian.h>
|
47
|
+
#define SDL_BYTEORDER BYTE_ORDER
|
48
|
+
#else
|
46
49
|
#if defined(__hppa__) || \
|
47
50
|
defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
|
48
|
-
(defined(__MIPS__) && defined(
|
51
|
+
(defined(__MIPS__) && defined(__MIPSEB__)) || \
|
49
52
|
defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \
|
50
53
|
defined(__sparc__)
|
51
54
|
#define SDL_BYTEORDER SDL_BIG_ENDIAN
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
Simple DirectMedia Layer
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2020 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
|
@@ -37,9 +37,45 @@ extern "C" {
|
|
37
37
|
#endif
|
38
38
|
|
39
39
|
/* Public functions */
|
40
|
-
|
40
|
+
|
41
|
+
|
42
|
+
/**
|
43
|
+
* \brief Set the error message for the current thread
|
44
|
+
*
|
45
|
+
* \return -1, there is no error handling for this function
|
46
|
+
*/
|
41
47
|
extern DECLSPEC int SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
|
48
|
+
|
49
|
+
/**
|
50
|
+
* \brief Get the last error message that was set
|
51
|
+
*
|
52
|
+
* SDL API functions may set error messages and then succeed, so you should
|
53
|
+
* only use the error value if a function fails.
|
54
|
+
*
|
55
|
+
* This returns a pointer to a static buffer for convenience and should not
|
56
|
+
* be called by multiple threads simultaneously.
|
57
|
+
*
|
58
|
+
* \return a pointer to the last error message that was set
|
59
|
+
*/
|
42
60
|
extern DECLSPEC const char *SDLCALL SDL_GetError(void);
|
61
|
+
|
62
|
+
/**
|
63
|
+
* \brief Get the last error message that was set for the current thread
|
64
|
+
*
|
65
|
+
* SDL API functions may set error messages and then succeed, so you should
|
66
|
+
* only use the error value if a function fails.
|
67
|
+
*
|
68
|
+
* \param errstr A buffer to fill with the last error message that was set
|
69
|
+
* for the current thread
|
70
|
+
* \param maxlen The size of the buffer pointed to by the errstr parameter
|
71
|
+
*
|
72
|
+
* \return errstr
|
73
|
+
*/
|
74
|
+
extern DECLSPEC char * SDLCALL SDL_GetErrorMsg(char *errstr, int maxlen);
|
75
|
+
|
76
|
+
/**
|
77
|
+
* \brief Clear the error message for the current thread
|
78
|
+
*/
|
43
79
|
extern DECLSPEC void SDLCALL SDL_ClearError(void);
|
44
80
|
|
45
81
|
/**
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
Simple DirectMedia Layer
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2020 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
|
@@ -85,6 +85,8 @@ typedef enum
|
|
85
85
|
Called on Android in onResume()
|
86
86
|
*/
|
87
87
|
|
88
|
+
SDL_LOCALECHANGED, /**< The user's locale preferences have changed. */
|
89
|
+
|
88
90
|
/* Display events */
|
89
91
|
SDL_DISPLAYEVENT = 0x150, /**< Display state change */
|
90
92
|
|
@@ -123,6 +125,10 @@ typedef enum
|
|
123
125
|
SDL_CONTROLLERDEVICEADDED, /**< A new Game controller has been inserted into the system */
|
124
126
|
SDL_CONTROLLERDEVICEREMOVED, /**< An opened Game controller has been removed */
|
125
127
|
SDL_CONTROLLERDEVICEREMAPPED, /**< The controller mapping was updated */
|
128
|
+
SDL_CONTROLLERTOUCHPADDOWN, /**< Game controller touchpad was touched */
|
129
|
+
SDL_CONTROLLERTOUCHPADMOTION, /**< Game controller touchpad finger was moved */
|
130
|
+
SDL_CONTROLLERTOUCHPADUP, /**< Game controller touchpad finger was lifted */
|
131
|
+
SDL_CONTROLLERSENSORUPDATE, /**< Game controller sensor was updated */
|
126
132
|
|
127
133
|
/* Touch events */
|
128
134
|
SDL_FINGERDOWN = 0x700,
|
@@ -413,6 +419,33 @@ typedef struct SDL_ControllerDeviceEvent
|
|
413
419
|
Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event */
|
414
420
|
} SDL_ControllerDeviceEvent;
|
415
421
|
|
422
|
+
/**
|
423
|
+
* \brief Game controller touchpad event structure (event.ctouchpad.*)
|
424
|
+
*/
|
425
|
+
typedef struct SDL_ControllerTouchpadEvent
|
426
|
+
{
|
427
|
+
Uint32 type; /**< ::SDL_CONTROLLERTOUCHPADDOWN or ::SDL_CONTROLLERTOUCHPADMOTION or ::SDL_CONTROLLERTOUCHPADUP */
|
428
|
+
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
429
|
+
SDL_JoystickID which; /**< The joystick instance id */
|
430
|
+
Sint32 touchpad; /**< The index of the touchpad */
|
431
|
+
Sint32 finger; /**< The index of the finger on the touchpad */
|
432
|
+
float x; /**< Normalized in the range 0...1 with 0 being on the left */
|
433
|
+
float y; /**< Normalized in the range 0...1 with 0 being at the top */
|
434
|
+
float pressure; /**< Normalized in the range 0...1 */
|
435
|
+
} SDL_ControllerTouchpadEvent;
|
436
|
+
|
437
|
+
/**
|
438
|
+
* \brief Game controller sensor event structure (event.csensor.*)
|
439
|
+
*/
|
440
|
+
typedef struct SDL_ControllerSensorEvent
|
441
|
+
{
|
442
|
+
Uint32 type; /**< ::SDL_CONTROLLERSENSORUPDATE */
|
443
|
+
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
444
|
+
SDL_JoystickID which; /**< The joystick instance id */
|
445
|
+
Sint32 sensor; /**< The type of the sensor, one of the values of ::SDL_SensorType */
|
446
|
+
float data[3]; /**< Up to 3 values from the sensor, as defined in SDL_sensor.h */
|
447
|
+
} SDL_ControllerSensorEvent;
|
448
|
+
|
416
449
|
/**
|
417
450
|
* \brief Audio device event structure (event.adevice.*)
|
418
451
|
*/
|
@@ -442,6 +475,7 @@ typedef struct SDL_TouchFingerEvent
|
|
442
475
|
float dx; /**< Normalized in the range -1...1 */
|
443
476
|
float dy; /**< Normalized in the range -1...1 */
|
444
477
|
float pressure; /**< Normalized in the range 0...1 */
|
478
|
+
Uint32 windowID; /**< The window underneath the finger, if any */
|
445
479
|
} SDL_TouchFingerEvent;
|
446
480
|
|
447
481
|
|
@@ -556,33 +590,35 @@ typedef struct SDL_SysWMEvent
|
|
556
590
|
*/
|
557
591
|
typedef union SDL_Event
|
558
592
|
{
|
559
|
-
Uint32 type;
|
560
|
-
SDL_CommonEvent common;
|
561
|
-
SDL_DisplayEvent display;
|
562
|
-
SDL_WindowEvent window;
|
563
|
-
SDL_KeyboardEvent key;
|
564
|
-
SDL_TextEditingEvent edit;
|
565
|
-
SDL_TextInputEvent text;
|
566
|
-
SDL_MouseMotionEvent motion;
|
567
|
-
SDL_MouseButtonEvent button;
|
568
|
-
SDL_MouseWheelEvent wheel;
|
569
|
-
SDL_JoyAxisEvent jaxis;
|
570
|
-
SDL_JoyBallEvent jball;
|
571
|
-
SDL_JoyHatEvent jhat;
|
572
|
-
SDL_JoyButtonEvent jbutton;
|
573
|
-
SDL_JoyDeviceEvent jdevice;
|
574
|
-
SDL_ControllerAxisEvent caxis;
|
575
|
-
SDL_ControllerButtonEvent cbutton;
|
576
|
-
SDL_ControllerDeviceEvent cdevice;
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
593
|
+
Uint32 type; /**< Event type, shared with all events */
|
594
|
+
SDL_CommonEvent common; /**< Common event data */
|
595
|
+
SDL_DisplayEvent display; /**< Display event data */
|
596
|
+
SDL_WindowEvent window; /**< Window event data */
|
597
|
+
SDL_KeyboardEvent key; /**< Keyboard event data */
|
598
|
+
SDL_TextEditingEvent edit; /**< Text editing event data */
|
599
|
+
SDL_TextInputEvent text; /**< Text input event data */
|
600
|
+
SDL_MouseMotionEvent motion; /**< Mouse motion event data */
|
601
|
+
SDL_MouseButtonEvent button; /**< Mouse button event data */
|
602
|
+
SDL_MouseWheelEvent wheel; /**< Mouse wheel event data */
|
603
|
+
SDL_JoyAxisEvent jaxis; /**< Joystick axis event data */
|
604
|
+
SDL_JoyBallEvent jball; /**< Joystick ball event data */
|
605
|
+
SDL_JoyHatEvent jhat; /**< Joystick hat event data */
|
606
|
+
SDL_JoyButtonEvent jbutton; /**< Joystick button event data */
|
607
|
+
SDL_JoyDeviceEvent jdevice; /**< Joystick device change event data */
|
608
|
+
SDL_ControllerAxisEvent caxis; /**< Game Controller axis event data */
|
609
|
+
SDL_ControllerButtonEvent cbutton; /**< Game Controller button event data */
|
610
|
+
SDL_ControllerDeviceEvent cdevice; /**< Game Controller device event data */
|
611
|
+
SDL_ControllerTouchpadEvent ctouchpad; /**< Game Controller touchpad event data */
|
612
|
+
SDL_ControllerSensorEvent csensor; /**< Game Controller sensor event data */
|
613
|
+
SDL_AudioDeviceEvent adevice; /**< Audio device event data */
|
614
|
+
SDL_SensorEvent sensor; /**< Sensor event data */
|
615
|
+
SDL_QuitEvent quit; /**< Quit request event data */
|
616
|
+
SDL_UserEvent user; /**< Custom event data */
|
617
|
+
SDL_SysWMEvent syswm; /**< System dependent window event data */
|
618
|
+
SDL_TouchFingerEvent tfinger; /**< Touch finger event data */
|
619
|
+
SDL_MultiGestureEvent mgesture; /**< Gesture event data */
|
620
|
+
SDL_DollarGestureEvent dgesture; /**< Gesture event data */
|
621
|
+
SDL_DropEvent drop; /**< Drag and drop event data */
|
586
622
|
|
587
623
|
/* This is necessary for ABI compatibility between Visual C++ and GCC
|
588
624
|
Visual C++ will respect the push pack pragma and use 52 bytes for
|