ruby2d 0.9.5 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. checksums.yaml +4 -4
  2. data/assets/include/SDL2/SDL.h +4 -1
  3. data/assets/include/SDL2/SDL_assert.h +3 -1
  4. data/assets/include/SDL2/SDL_atomic.h +1 -1
  5. data/assets/include/SDL2/SDL_audio.h +1 -1
  6. data/assets/include/SDL2/SDL_bits.h +1 -1
  7. data/assets/include/SDL2/SDL_blendmode.h +4 -1
  8. data/assets/include/SDL2/SDL_clipboard.h +1 -1
  9. data/assets/include/SDL2/SDL_config.h +1 -1
  10. data/assets/include/SDL2/SDL_config_android.h +7 -3
  11. data/assets/include/SDL2/SDL_config_iphoneos.h +16 -10
  12. data/assets/include/SDL2/SDL_config_macosx.h +40 -14
  13. data/assets/include/SDL2/SDL_config_minimal.h +1 -1
  14. data/assets/include/SDL2/SDL_config_os2.h +26 -8
  15. data/assets/include/SDL2/SDL_config_pandora.h +4 -2
  16. data/assets/include/SDL2/SDL_config_psp.h +2 -1
  17. data/assets/include/SDL2/SDL_config_windows.h +40 -9
  18. data/assets/include/SDL2/SDL_config_winrt.h +5 -2
  19. data/assets/include/SDL2/SDL_config_wiz.h +5 -2
  20. data/assets/include/SDL2/SDL_copying.h +1 -1
  21. data/assets/include/SDL2/SDL_cpuinfo.h +32 -3
  22. data/assets/include/SDL2/SDL_egl.h +4 -1
  23. data/assets/include/SDL2/SDL_endian.h +6 -3
  24. data/assets/include/SDL2/SDL_error.h +38 -2
  25. data/assets/include/SDL2/SDL_events.h +64 -28
  26. data/assets/include/SDL2/SDL_filesystem.h +1 -1
  27. data/assets/include/SDL2/SDL_gamecontroller.h +160 -9
  28. data/assets/include/SDL2/SDL_gesture.h +1 -1
  29. data/assets/include/SDL2/SDL_haptic.h +10 -1
  30. data/assets/include/SDL2/SDL_hints.h +316 -4
  31. data/assets/include/SDL2/SDL_joystick.h +115 -24
  32. data/assets/include/SDL2/SDL_keyboard.h +1 -1
  33. data/assets/include/SDL2/SDL_keycode.h +11 -9
  34. data/assets/include/SDL2/SDL_loadso.h +1 -1
  35. data/assets/include/SDL2/SDL_locale.h +101 -0
  36. data/assets/include/SDL2/SDL_log.h +3 -3
  37. data/assets/include/SDL2/SDL_main.h +1 -1
  38. data/assets/include/SDL2/SDL_messagebox.h +6 -4
  39. data/assets/include/SDL2/SDL_metal.h +117 -0
  40. data/assets/include/SDL2/SDL_misc.h +75 -0
  41. data/assets/include/SDL2/SDL_mouse.h +1 -1
  42. data/assets/include/SDL2/SDL_mutex.h +1 -1
  43. data/assets/include/SDL2/SDL_name.h +1 -1
  44. data/assets/include/SDL2/SDL_opengl.h +1 -1
  45. data/assets/include/SDL2/SDL_opengl_glext.h +3 -0
  46. data/assets/include/SDL2/SDL_opengles.h +1 -1
  47. data/assets/include/SDL2/SDL_opengles2.h +1 -1
  48. data/assets/include/SDL2/SDL_pixels.h +25 -16
  49. data/assets/include/SDL2/SDL_platform.h +1 -1
  50. data/assets/include/SDL2/SDL_power.h +1 -1
  51. data/assets/include/SDL2/SDL_quit.h +1 -1
  52. data/assets/include/SDL2/SDL_rect.h +1 -1
  53. data/assets/include/SDL2/SDL_render.h +63 -3
  54. data/assets/include/SDL2/SDL_revision.h +2 -2
  55. data/assets/include/SDL2/SDL_rwops.h +2 -10
  56. data/assets/include/SDL2/SDL_scancode.h +1 -1
  57. data/assets/include/SDL2/SDL_sensor.h +25 -9
  58. data/assets/include/SDL2/SDL_shape.h +1 -1
  59. data/assets/include/SDL2/SDL_stdinc.h +44 -4
  60. data/assets/include/SDL2/SDL_surface.h +11 -2
  61. data/assets/include/SDL2/SDL_system.h +50 -4
  62. data/assets/include/SDL2/SDL_syswm.h +29 -2
  63. data/assets/include/SDL2/SDL_test.h +1 -1
  64. data/assets/include/SDL2/SDL_test_assert.h +1 -1
  65. data/assets/include/SDL2/SDL_test_common.h +14 -1
  66. data/assets/include/SDL2/SDL_test_compare.h +1 -1
  67. data/assets/include/SDL2/SDL_test_crc32.h +1 -1
  68. data/assets/include/SDL2/SDL_test_font.h +1 -1
  69. data/assets/include/SDL2/SDL_test_fuzzer.h +1 -1
  70. data/assets/include/SDL2/SDL_test_harness.h +1 -1
  71. data/assets/include/SDL2/SDL_test_images.h +1 -1
  72. data/assets/include/SDL2/SDL_test_log.h +1 -1
  73. data/assets/include/SDL2/SDL_test_md5.h +1 -1
  74. data/assets/include/SDL2/SDL_test_memory.h +1 -1
  75. data/assets/include/SDL2/SDL_test_random.h +1 -1
  76. data/assets/include/SDL2/SDL_thread.h +34 -11
  77. data/assets/include/SDL2/SDL_timer.h +1 -1
  78. data/assets/include/SDL2/SDL_touch.h +1 -1
  79. data/assets/include/SDL2/SDL_types.h +1 -1
  80. data/assets/include/SDL2/SDL_version.h +2 -2
  81. data/assets/include/SDL2/SDL_video.h +11 -5
  82. data/assets/include/SDL2/SDL_vulkan.h +6 -8
  83. data/assets/include/SDL2/begin_code.h +5 -9
  84. data/assets/include/SDL2/close_code.h +1 -1
  85. data/assets/macos/lib/libFLAC.a +0 -0
  86. data/assets/macos/lib/libSDL2.a +0 -0
  87. data/assets/macos/lib/libSDL2_image.a +0 -0
  88. data/assets/macos/lib/libSDL2_mixer.a +0 -0
  89. data/assets/macos/lib/libSDL2_ttf.a +0 -0
  90. data/assets/macos/lib/libfreetype.a +0 -0
  91. data/assets/macos/lib/libjpeg.a +0 -0
  92. data/assets/macos/lib/libmpg123.a +0 -0
  93. data/assets/macos/lib/libogg.a +0 -0
  94. data/assets/macos/lib/libpng16.a +0 -0
  95. data/assets/macos/lib/libtiff.a +0 -0
  96. data/assets/macos/lib/libvorbis.a +0 -0
  97. data/assets/macos/lib/libvorbisfile.a +0 -0
  98. data/assets/macos/lib/libwebp.a +0 -0
  99. data/assets/mingw/bin/SDL2.dll +0 -0
  100. data/assets/mingw/lib/libSDL2.a +0 -0
  101. data/assets/mingw/lib/libSDL2.dll.a +0 -0
  102. data/assets/mingw/lib/libSDL2_test.a +0 -0
  103. data/assets/mingw/lib/libSDL2main.a +0 -0
  104. data/ext/ruby2d/extconf.rb +1 -1
  105. data/ext/ruby2d/gl.c +17 -0
  106. data/ext/ruby2d/gl2.c +15 -0
  107. data/ext/ruby2d/gl3.c +15 -0
  108. data/ext/ruby2d/gles.c +15 -0
  109. data/ext/ruby2d/music.c +13 -0
  110. data/ext/ruby2d/ruby2d.c +306 -168
  111. data/ext/ruby2d/ruby2d.h +32 -0
  112. data/ext/ruby2d/sound.c +25 -0
  113. data/ext/ruby2d/tileset.c +30 -0
  114. data/lib/ruby2d.rb +4 -1
  115. data/lib/ruby2d/circle.rb +18 -2
  116. data/lib/ruby2d/dsl.rb +16 -9
  117. data/lib/ruby2d/entity.rb +17 -0
  118. data/lib/ruby2d/font.rb +4 -3
  119. data/lib/ruby2d/image.rb +24 -1
  120. data/lib/ruby2d/line.rb +20 -0
  121. data/lib/ruby2d/music.rb +5 -0
  122. data/lib/ruby2d/pixel.rb +17 -0
  123. data/lib/ruby2d/quad.rb +18 -0
  124. data/lib/ruby2d/rectangle.rb +11 -2
  125. data/lib/ruby2d/renderable.rb +4 -8
  126. data/lib/ruby2d/sound.rb +5 -0
  127. data/lib/ruby2d/sprite.rb +35 -3
  128. data/lib/ruby2d/square.rb +9 -0
  129. data/lib/ruby2d/text.rb +22 -1
  130. data/lib/ruby2d/tileset.rb +69 -0
  131. data/lib/ruby2d/triangle.rb +16 -0
  132. data/lib/ruby2d/version.rb +1 -1
  133. data/lib/ruby2d/window.rb +249 -22
  134. metadata +10 -3
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  Simple DirectMedia Layer
3
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
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
@@ -49,6 +49,9 @@ struct SDL_SysWMinfo;
49
49
  #ifndef WIN32_LEAN_AND_MEAN
50
50
  #define WIN32_LEAN_AND_MEAN
51
51
  #endif
52
+ #ifndef NOMINMAX /* don't define min() and max(). */
53
+ #define NOMINMAX
54
+ #endif
52
55
  #include <windows.h>
53
56
  #endif
54
57
 
@@ -103,6 +106,11 @@ typedef void *EGLSurface;
103
106
  #if defined(SDL_VIDEO_DRIVER_VIVANTE)
104
107
  #include "SDL_egl.h"
105
108
  #endif
109
+
110
+ #if defined(SDL_VIDEO_DRIVER_OS2)
111
+ #define INCL_WIN
112
+ #include <os2.h>
113
+ #endif
106
114
  #endif /* SDL_PROTOTYPES_ONLY */
107
115
 
108
116
 
@@ -129,7 +137,8 @@ typedef enum
129
137
  SDL_SYSWM_WINRT,
130
138
  SDL_SYSWM_ANDROID,
131
139
  SDL_SYSWM_VIVANTE,
132
- SDL_SYSWM_OS2
140
+ SDL_SYSWM_OS2,
141
+ SDL_SYSWM_HAIKU
133
142
  } SDL_SYSWM_TYPE;
134
143
 
135
144
  /**
@@ -182,6 +191,16 @@ struct SDL_SysWMmsg
182
191
  int dummy;
183
192
  /* No Vivante window events yet */
184
193
  } vivante;
194
+ #endif
195
+ #if defined(SDL_VIDEO_DRIVER_OS2)
196
+ struct
197
+ {
198
+ BOOL fFrame; /**< TRUE if hwnd is a frame window */
199
+ HWND hwnd; /**< The window receiving the message */
200
+ ULONG msg; /**< The message identifier */
201
+ MPARAM mp1; /**< The first first message parameter */
202
+ MPARAM mp2; /**< The second first message parameter */
203
+ } os2;
185
204
  #endif
186
205
  /* Can't have an empty union */
187
206
  int dummy;
@@ -276,6 +295,14 @@ struct SDL_SysWMinfo
276
295
  } android;
277
296
  #endif
278
297
 
298
+ #if defined(SDL_VIDEO_DRIVER_OS2)
299
+ struct
300
+ {
301
+ HWND hwnd; /**< The window handle */
302
+ HWND hwndFrame; /**< The frame window handle */
303
+ } os2;
304
+ #endif
305
+
279
306
  #if defined(SDL_VIDEO_DRIVER_VIVANTE)
280
307
  struct
281
308
  {
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  Simple DirectMedia Layer
3
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
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-2019 Sam Lantinga <slouken@libsdl.org>
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-2019 Sam Lantinga <slouken@libsdl.org>
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
@@ -155,6 +155,19 @@ int SDLTest_CommonArg(SDLTest_CommonState * state, int index);
155
155
  */
156
156
  void SDLTest_CommonLogUsage(SDLTest_CommonState * state, const char *argv0, const char **options);
157
157
 
158
+ /**
159
+ * \brief Returns common usage information
160
+ *
161
+ * You should (probably) be using SDLTest_CommonLogUsage() instead, but this
162
+ * function remains for binary compatibility. Strings returned from this
163
+ * function are valid until SDLTest_CommonQuit() is called, in which case
164
+ * those strings' memory is freed and can no longer be used.
165
+ *
166
+ * \param state The common state describing the test window to create.
167
+ * \returns String with usage information
168
+ */
169
+ const char *SDLTest_CommonUsage(SDLTest_CommonState * state);
170
+
158
171
  /**
159
172
  * \brief Open test window.
160
173
  *
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  Simple DirectMedia Layer
3
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
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-2019 Sam Lantinga <slouken@libsdl.org>
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-2019 Sam Lantinga <slouken@libsdl.org>
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-2019 Sam Lantinga <slouken@libsdl.org>
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-2019 Sam Lantinga <slouken@libsdl.org>
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-2019 Sam Lantinga <slouken@libsdl.org>
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-2019 Sam Lantinga <slouken@libsdl.org>
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-2019 Sam Lantinga <slouken@libsdl.org>
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-2019 Sam Lantinga <slouken@libsdl.org>
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-2019 Sam Lantinga <slouken@libsdl.org>
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-2019 Sam Lantinga <slouken@libsdl.org>
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
@@ -54,6 +54,11 @@ typedef unsigned int SDL_TLSID;
54
54
  /**
55
55
  * The SDL thread priority.
56
56
  *
57
+ * SDL will make system changes as necessary in order to apply the thread priority.
58
+ * Code which attempts to control thread state related to priority should be aware
59
+ * that calling SDL_SetThreadPriority may alter such state.
60
+ * SDL_HINT_THREAD_PRIORITY_POLICY can be used to control aspects of this behavior.
61
+ *
57
62
  * \note On many systems you require special privileges to set high or time critical priority.
58
63
  */
59
64
  typedef enum {
@@ -69,7 +74,7 @@ typedef enum {
69
74
  */
70
75
  typedef int (SDLCALL * SDL_ThreadFunction) (void *data);
71
76
 
72
- #if defined(__WIN32__) && !defined(HAVE_LIBC)
77
+ #if defined(__WIN32__)
73
78
  /**
74
79
  * \file SDL_thread.h
75
80
  *
@@ -93,11 +98,18 @@ typedef int (SDLCALL * SDL_ThreadFunction) (void *data);
93
98
  #define SDL_PASSED_BEGINTHREAD_ENDTHREAD
94
99
  #include <process.h> /* _beginthreadex() and _endthreadex() */
95
100
 
96
- typedef uintptr_t(__cdecl * pfnSDL_CurrentBeginThread)
101
+ typedef uintptr_t (__cdecl * pfnSDL_CurrentBeginThread)
97
102
  (void *, unsigned, unsigned (__stdcall *func)(void *),
98
103
  void * /*arg*/, unsigned, unsigned * /* threadID */);
99
104
  typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code);
100
105
 
106
+ #ifndef SDL_beginthread
107
+ #define SDL_beginthread _beginthreadex
108
+ #endif
109
+ #ifndef SDL_endthread
110
+ #define SDL_endthread _endthreadex
111
+ #endif
112
+
101
113
  /**
102
114
  * Create a thread.
103
115
  */
@@ -118,12 +130,12 @@ SDL_CreateThreadWithStackSize(int (SDLCALL * fn) (void *),
118
130
  */
119
131
  #if defined(SDL_CreateThread) && SDL_DYNAMIC_API
120
132
  #undef SDL_CreateThread
121
- #define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex)
133
+ #define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
122
134
  #undef SDL_CreateThreadWithStackSize
123
- #define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex)
135
+ #define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
124
136
  #else
125
- #define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex)
126
- #define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex)
137
+ #define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
138
+ #define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)SDL_endthread)
127
139
  #endif
128
140
 
129
141
  #elif defined(__OS2__)
@@ -132,13 +144,23 @@ SDL_CreateThreadWithStackSize(int (SDLCALL * fn) (void *),
132
144
  * into a dll with Watcom's runtime statically linked.
133
145
  */
134
146
  #define SDL_PASSED_BEGINTHREAD_ENDTHREAD
147
+
135
148
  #ifndef __EMX__
136
149
  #include <process.h>
137
150
  #else
138
151
  #include <stdlib.h>
139
152
  #endif
153
+
140
154
  typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void * /*arg*/);
141
155
  typedef void (*pfnSDL_CurrentEndThread)(void);
156
+
157
+ #ifndef SDL_beginthread
158
+ #define SDL_beginthread _beginthread
159
+ #endif
160
+ #ifndef SDL_endthread
161
+ #define SDL_endthread _endthread
162
+ #endif
163
+
142
164
  extern DECLSPEC SDL_Thread *SDLCALL
143
165
  SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data,
144
166
  pfnSDL_CurrentBeginThread pfnBeginThread,
@@ -147,14 +169,15 @@ extern DECLSPEC SDL_Thread *SDLCALL
147
169
  SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const size_t stacksize, void *data,
148
170
  pfnSDL_CurrentBeginThread pfnBeginThread,
149
171
  pfnSDL_CurrentEndThread pfnEndThread);
172
+
150
173
  #if defined(SDL_CreateThread) && SDL_DYNAMIC_API
151
174
  #undef SDL_CreateThread
152
- #define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthread, (pfnSDL_CurrentEndThread)_endthread)
175
+ #define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
153
176
  #undef SDL_CreateThreadWithStackSize
154
- #define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthread, (pfnSDL_CurrentEndThread)_endthread)
177
+ #define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
155
178
  #else
156
- #define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthread, (pfnSDL_CurrentEndThread)_endthread)
157
- #define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)_beginthread, (pfnSDL_CurrentEndThread)_endthread)
179
+ #define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
180
+ #define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
158
181
  #endif
159
182
 
160
183
  #else
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  Simple DirectMedia Layer
3
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
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-2019 Sam Lantinga <slouken@libsdl.org>
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-2019 Sam Lantinga <slouken@libsdl.org>
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-2019 Sam Lantinga <slouken@libsdl.org>
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
@@ -59,7 +59,7 @@ typedef struct SDL_version
59
59
  */
60
60
  #define SDL_MAJOR_VERSION 2
61
61
  #define SDL_MINOR_VERSION 0
62
- #define SDL_PATCHLEVEL 10
62
+ #define SDL_PATCHLEVEL 14
63
63
 
64
64
  /**
65
65
  * \brief Macro to determine SDL version program was compiled against.
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  Simple DirectMedia Layer
3
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
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
@@ -96,7 +96,6 @@ typedef struct SDL_Window SDL_Window;
96
96
  */
97
97
  typedef enum
98
98
  {
99
- /* !!! FIXME: change this to name = (1<<x). */
100
99
  SDL_WINDOW_FULLSCREEN = 0x00000001, /**< fullscreen window */
101
100
  SDL_WINDOW_OPENGL = 0x00000002, /**< window usable with OpenGL context */
102
101
  SDL_WINDOW_SHOWN = 0x00000004, /**< window is visible */
@@ -119,7 +118,8 @@ typedef enum
119
118
  SDL_WINDOW_UTILITY = 0x00020000, /**< window should be treated as a utility window */
120
119
  SDL_WINDOW_TOOLTIP = 0x00040000, /**< window should be treated as a tooltip */
121
120
  SDL_WINDOW_POPUP_MENU = 0x00080000, /**< window should be treated as a popup menu */
122
- SDL_WINDOW_VULKAN = 0x10000000 /**< window usable for Vulkan surface */
121
+ SDL_WINDOW_VULKAN = 0x10000000, /**< window usable for Vulkan surface */
122
+ SDL_WINDOW_METAL = 0x20000000 /**< window usable for Metal view */
123
123
  } SDL_WindowFlags;
124
124
 
125
125
  /**
@@ -175,7 +175,9 @@ typedef enum
175
175
  typedef enum
176
176
  {
177
177
  SDL_DISPLAYEVENT_NONE, /**< Never used */
178
- SDL_DISPLAYEVENT_ORIENTATION /**< Display orientation has changed to data1 */
178
+ SDL_DISPLAYEVENT_ORIENTATION, /**< Display orientation has changed to data1 */
179
+ SDL_DISPLAYEVENT_CONNECTED, /**< Display has been added to the system */
180
+ SDL_DISPLAYEVENT_DISCONNECTED /**< Display has been removed from the system */
179
181
  } SDL_DisplayEventID;
180
182
 
181
183
  typedef enum
@@ -485,7 +487,8 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window * window);
485
487
  * ::SDL_WINDOW_HIDDEN, ::SDL_WINDOW_BORDERLESS,
486
488
  * ::SDL_WINDOW_RESIZABLE, ::SDL_WINDOW_MAXIMIZED,
487
489
  * ::SDL_WINDOW_MINIMIZED, ::SDL_WINDOW_INPUT_GRABBED,
488
- * ::SDL_WINDOW_ALLOW_HIGHDPI, ::SDL_WINDOW_VULKAN.
490
+ * ::SDL_WINDOW_ALLOW_HIGHDPI, ::SDL_WINDOW_VULKAN
491
+ * ::SDL_WINDOW_METAL.
489
492
  *
490
493
  * \return The created window, or NULL if window creation failed.
491
494
  *
@@ -504,6 +507,9 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window * window);
504
507
  * If SDL_WINDOW_VULKAN is specified and there isn't a working Vulkan driver,
505
508
  * SDL_CreateWindow() will fail because SDL_Vulkan_LoadLibrary() will fail.
506
509
  *
510
+ * If SDL_WINDOW_METAL is specified on an OS that does not support Metal,
511
+ * SDL_CreateWindow() will fail.
512
+ *
507
513
  * \note On non-Apple devices, SDL requires you to either not link to the
508
514
  * Vulkan loader or link to a dynamic library version. This limitation
509
515
  * may be removed in a future version of SDL.
@@ -204,10 +204,9 @@ extern DECLSPEC void SDLCALL SDL_Vulkan_UnloadLibrary(void);
204
204
  *
205
205
  * \sa SDL_Vulkan_CreateSurface()
206
206
  */
207
- extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_GetInstanceExtensions(
208
- SDL_Window *window,
209
- unsigned int *pCount,
210
- const char **pNames);
207
+ extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_GetInstanceExtensions(SDL_Window *window,
208
+ unsigned int *pCount,
209
+ const char **pNames);
211
210
 
212
211
  /**
213
212
  * \brief Create a Vulkan rendering surface for a window.
@@ -238,10 +237,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_GetInstanceExtensions(
238
237
  *
239
238
  * \sa SDL_Vulkan_GetInstanceExtensions()
240
239
  */
241
- extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_CreateSurface(
242
- SDL_Window *window,
243
- VkInstance instance,
244
- VkSurfaceKHR* surface);
240
+ extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_CreateSurface(SDL_Window *window,
241
+ VkInstance instance,
242
+ VkSurfaceKHR* surface);
245
243
 
246
244
  /**
247
245
  * \brief Get the size of a window's underlying drawable in pixels (for use
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  Simple DirectMedia Layer
3
- Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
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
@@ -51,15 +51,11 @@
51
51
 
52
52
  /* Some compilers use a special export keyword */
53
53
  #ifndef DECLSPEC
54
- # if defined(__WIN32__) || defined(__WINRT__)
55
- # ifdef __BORLANDC__
56
- # ifdef BUILD_SDL
57
- # define DECLSPEC
58
- # else
59
- # define DECLSPEC __declspec(dllimport)
60
- # endif
61
- # else
54
+ # if defined(__WIN32__) || defined(__WINRT__) || defined(__CYGWIN__)
55
+ # ifdef DLL_EXPORT
62
56
  # define DECLSPEC __declspec(dllexport)
57
+ # else
58
+ # define DECLSPEC
63
59
  # endif
64
60
  # elif defined(__OS2__)
65
61
  # ifdef BUILD_SDL