Commit Graph

1645 Commits

Author SHA1 Message Date
Sam Lantinga
48bcdfd8cc Added float versions of SDL's math functions 2017-11-04 15:34:14 -07:00
Sam Lantinga
325dff1cb1 Fixed using libunwind on iOS, where it's only available on the simulator (thanks Vit!) 2017-11-04 09:44:29 -07:00
Sam Lantinga
30962f0b83 Android configure-based build fixes (thanks Vit!) 2017-11-04 09:00:40 -07:00
Sam Lantinga
bb156ce5ec Fixed bug 3926 - SDL_main export
e_pluschauskas

I noticed that after updating SDL to 2.0.6 my application now exports SDL_main.

At GitHub SDL mirror (branch 2.0.5) SDL_main prototyped as
extern C_LINKAGE int SDL_main(int argc, char *argv[]);
but at branch 2.0.6 prototype is
extern C_LINKAGE DECLSPEC int SDL_main(int argc, char *argv[]);
2017-11-01 17:41:25 -07:00
Brandon Schaefer
02c0174483 Fixed bug 3902 - Add a specific KMSDRM hint for low latency video 2017-10-26 16:37:20 -07:00
Sam Lantinga
1e63db4504 Document the SDL audio channel mapping 2017-10-20 14:48:10 -07:00
Sam Lantinga
ff2da1f583 Added SDL_AudioStreamFlush() to the list of new audio stream functions 2017-10-20 10:45:38 -07:00
Ryan C. Gordon
ba79be8ef6 audio: Added SDL_AudioStreamFlush(). 2017-10-19 18:05:42 -04:00
Sam Lantinga
34f15d9394 Added audio stream conversion functions:
SDL_NewAudioStream
    SDL_AudioStreamPut
    SDL_AudioStreamGet
    SDL_AudioStreamAvailable
    SDL_AudioStreamClear
    SDL_FreeAudioStream
2017-10-18 15:54:05 -07:00
Sam Lantinga
0bf446b21a Added min/max macros for the sized SDL datatypes 2017-10-16 14:39:56 -07:00
Sam Lantinga
e7ae12dc1e Fixed compiler warning 2017-10-12 17:17:09 -07:00
Sam Lantinga
84dfc945e8 Android doesn't have libunwind.h in API 16 2017-10-12 14:21:21 -07:00
Sam Lantinga
eea9c57d52 Added functions to query and set the SDL memory allocation functions:
SDL_GetMemoryFunctions()
    SDL_SetMemoryFunctions()
    SDL_GetNumAllocations()
2017-10-12 13:44:28 -07:00
Sam Lantinga
7847ffdd25 Updated version to 2.0.7 2017-10-12 08:08:04 -07:00
Sam Lantinga
a074f79dd9 Exposed the joystick locking functions for multi-threaded access to the joystick API 2017-10-10 11:10:15 -07:00
Brandon Schaefer
ceae5eed47 revert files I didnt mean to commit! 2017-09-29 10:15:44 -07:00
Brandon Schaefer
fe922885a4 wayland: Fix bug 3814 -Wmissing-field-initializers 2017-09-29 10:07:37 -07:00
Sam Lantinga
db70d14a04 Fixed bug 3842 - fix SDL_thread.h for emx
Ozkan Sezer

EMX declares _beginthread() / _endthread() in stdlib.h, not process.h.
The attached patch updates the OS/2 case of SDL_thread.h for it.  (It
also tidies the unreadable whitespace in win32 case.)
2017-09-23 12:38:47 -07:00
Alex Szpakowski
7a7cdca1ed iOS: Fix compiling using the iOS 7 SDK, partially broken since MoltenVK support was added.
Note that apps submitted to the iOS App Store *must* use a modern iOS SDK (currently iOS 10 is probably the minimum), however the SDK used to build is separate from the minimum iOS version an app supports at runtime.
2017-09-21 20:11:44 -03:00
Sam Lantinga
224272207c Added a hint SDL_HINT_AUDIO_CATEGORY to control the audio category,
determining whether the phone mute switch affects the audio
2017-09-15 17:27:32 -07:00
Sam Lantinga
b7aeb816ce Fixed bug 3811 - change HAVE_COPYSIGN to HAVE__COPYSIGN in SDL_config_windows.h
Ozkan Sezer

The patch below changes HAVE_COPYSIGN macro in SDL_config_windows.h to
HAVE__COPYSIGN, so that _copysign() can be used in SDL_stdlib.h which
is available in many more windows-targeting toolchains such as MinGW,
MSVC >= 6, etc, and not just  MSVC >= 2013. SDL_stdlib.c already has a
specific check for HAVE__COPYSIGN, so I believe this is reasonable.
2017-09-10 10:30:25 -07:00
Sam Lantinga
718b4cb228 Correction: copysign has been supported by windows several toolchains
for a very long time, including MSVC6, MinGW, LCC-Win32, (no released
watcom versions though, but that's of no concern.)

Patch from Ozkan Sezer
2017-09-10 09:19:10 -07:00
Sam Lantinga
9586c66c22 Updated documentation so it's clear you should use SDL_SetWindowDisplayMode() to change the size of fullscreen windows. 2017-09-09 11:04:35 -07:00
Sam Lantinga
af35942108 Fixed bug 3760 - RWops doesn't check for integer overflow when stdio_fseek only supports 32 bits
Simon Hug

When RWops seeks with fseek or fseeko it uses the types long or off_t which can be 32 bits on some platforms. stdio_seek does not check if the 64-bit integer for the offset fits into a 32-bit integer. Offsets equal or larger than 2 GiB will have implementation-defined behavior and failure states would be very confusing to debug.

The attached patch adds range checking by using the macros from limits.h for long type and some bit shifting for off_t because POSIX couldn't be bothered to specify min and max macros.

It also defines HAVE_FSEEKI64 in SDL_config_windows.h so that the Windows function gets picked up automatically with the default config.

And there's an additional error message for when ftell fails.
2017-09-09 08:36:37 -07:00
Sam Lantinga
ea862ec7d6 Fixed bug 3807 - Remove restriction from DECLSPEC macro for OS/2
Ozkan Sezer

The following patch removes the unnecessary / wrong
Watcom restriction from the DECLSPEC macro for OS/2.
2017-09-09 07:42:29 -07:00
Sam Lantinga
370c988c76 Fixed building with the first version of Visual Studio 2017, which doesn't have __has_include() (Thanks Simon!) 2017-09-08 15:08:50 -07:00
Sam Lantinga
5c46a0fcb8 We don't need to pass the renderer into SDLTest_CleanupTextDrawing() 2017-09-08 04:53:31 -07:00
Sam Lantinga
8330eff2f8 Added a function to clean up test text drawing 2017-09-08 04:14:05 -07:00
Ryan C. Gordon
ff03b74f22 vulkan: use "unsigned int" instead of "unsigned" 2017-09-06 19:35:36 -04:00
Sam Lantinga
ec6890cbb5 Fixed bug 3780 - GCC 7 implicit fallthrough warnings
Martin Gerhardy 2017-08-28 06:58:01 UTC

SDL_blit.h, SDL_fillrect.c and SDL_stdinc.h produces a lot of the (new) gcc-7 implicit fallthrough warnings.
2017-09-06 04:32:30 -07:00
Sam Lantinga
fc5665de44 Fixed bug 3801 - HAVE_LIBSAMPLERATE_H depending on HAVE_LIBC in current SDL_config.h.in
Ozkan Sezer

HAVE_LIBSAMPLERATE_H is depending on HAVE_LIBC in current config.h.in:
it shouldn't be.  HAVE_LIBUDEV_H, HAVE_DBUS_DBUS_H, HAVE_IBUS_IBUS_H,
HAVE_FCITX_FRONTEND_H, and HAVE_ALTIVEC_H have the same situation too.
I suggest something like the following, which moves them out of the
HAVE_LIBC confinement and also moves the windows dx header stuff along
side them. (Not ideal, but a bit cleaner I think.)
2017-09-06 10:31:05 -07:00
Sam Lantinga
de9d602503 Fixed bug 3797 - configure check for float.h
Ozkan Sezer

Cmake checks for float.h, but configure does not:  the attached patch
adds float.h to checked headers in configury, and it adds the missing
HAVE_FLOAT_H macro to SDL_config.h.cmake and SDL_config.h.in.

In SDL_config_macosx.h and SDL_config_windows.h, defined HAVE_FLOAT_H
as 1, where I know that it's true.
2017-09-06 01:14:23 -07:00
Ryan C. Gordon
bdf64ad0d9 vulkan: Changed SDL_WINDOW_VULKAN value to match Tizen's fork. 2017-09-03 13:20:33 -04:00
Sam Lantinga
ce5938adfa Fixed bug 3791 - SDL_bits.h: __builtin_clz is supported in gcc >= 3.4
Ozkan Sezer

__builtin_clz is supported in gcc >= 3.4. The following patchlet adjusts
SDL_bits.h for it.
2017-08-31 15:17:59 -07:00
Sam Lantinga
c768e01da0 Updated documentation, you don't need to initialize the audio subsystem to do in-place format conversion. (Thanks Simon Hug!) 2017-08-29 09:02:04 -07:00
Sam Lantinga
0e87a23859 Fixed check for Mac OS X 10.11+ SDK (thanks Edward Rudd!) 2017-08-29 08:27:23 -07:00
Sam Lantinga
74d3425d27 MAC_OS_X_VERSION_MAX_REQUIRED isn't actually set in recent Xcode versions 2017-08-29 02:32:53 -07:00
Sam Lantinga
8c9b4e78a1 Fixed building with an older Mac OS X SDK 2017-08-28 20:52:05 -07:00
Sam Lantinga
30f8bae0e1 Vulkan support on Mac OS X introduces a link time dependency (CAMetalLayer) on 10.11 and newer 2017-08-28 19:32:08 -07:00
Sam Lantinga
c5ce1120af Removed the need for libSDL2main.a on Android, and separated JNI initialization out for other integrations 2017-08-28 14:34:15 -07:00
Sam Lantinga
a08e293faf Fixed bug 3781 - unbalanced #pragma pack(pop) in close_code.h
Ozkan Sezer

Revision 288 (http://hg.libsdl.org/SDL/rev/2f5a6062db86) excluded the
Watcom compiler from forcing 4 byte structure packing in begin_code.h.
However, it missed updating close_code.h, which now has an unbalanced
#pragma pack(pop) if the compiler is Watcom.  The issue seems to have
crawled into SDL2, too.
2017-08-28 09:41:00 -07:00
Sam Lantinga
ae48232ed1 Be clear that disabling Vulkan surface support disables the entire SDL Vulkan integration 2017-08-28 00:11:38 -07:00
Sam Lantinga
248b190b77 Fixed typedef redefinition errors when including both SDL_vulkan.h and vulkan.h
You should always include vulkan/vulkan.h first, then include SDL_vulkan.h
2017-08-27 23:13:15 -07:00
Sam Lantinga
d1b0a025ad Don't define Vulkan types if vulkan.h has already been included 2017-08-27 22:27:45 -07:00
Ryan C. Gordon
10d552ae31 vulkan: Initial Vulkan support!
This work was done by Jacob Lifshay and Mark Callow; I'm just merging it
into revision control.
2017-08-27 22:15:57 -04:00
Sam Lantinga
bdc7417a20 Fixed bug 3724 - Allow Angle Static Link
Carlos

We would like to add a switch (define) that allows us to compile Angle statically with SDL. That is, getting rid of the OpenGL DLL. Usually you need OpenGL to be loaded dynamically as DLL because implementation is provided by the system but no need with Angle.

Only 2 files need modification and it shouldn't affect current behaivor:
include/SDL_egl.h and src/video/SDL_egl.c, as in here

https://github.com/native-toolkit/sdl/pull/10/files

The flag name could be SDL_VIDEO_STATIC_ANGLE (instead of NATIVE_TOOLKIT_STATIC_ANGLE) as discussed here https://github.com/native-toolkit/sdl/pull/10

We have tested this with both Windows and UWP, using NME engine (https://github.com/haxenme/nme).

Releated issue: https://bugzilla.libsdl.org/show_bug.cgi?id=1820
2017-08-27 19:05:57 -07:00
Sam Lantinga
56b97ce5c0 SDL_thread.h: fix os/2 defines (rev 11340:97cd834a843e was a missing patch) 2017-08-27 18:48:51 -07:00
Sam Lantinga
d9974bc520 Fixed bug 3774 - Cmake build fails for Android
sfalexrog

Android haptic code was not added to CMakeLists.txt, leading to build failures when targeting Android platform.

Attached patch adds Android haptic driver to source sets and adds configuration parameter to SDL_config.h.cmake.
2017-08-26 21:17:12 -07:00
Ryan C. Gordon
a2ede16eeb opengl: add support for GL_KHR_no_error.
This is completely untested!

Fixes Bugzilla #3721.
2017-08-24 21:30:53 -04:00
Sam Lantinga
77738252c9 SDL_thread.h: add missing os/2 defines.
(essentially replicates the windows case || SDL1.2 case.)
2017-08-21 13:01:22 -07:00