Compare commits

...
Sign in to create a new pull request.

1512 commits

Author SHA1 Message Date
Sam Lantinga
b84a1e6a4d Make sure hidapi is built for the release DMG 2020-03-01 18:16:15 -08:00
Sam Lantinga
01469496eb We already have a hidapi implementation for Windows, we don't need libusb 2020-03-01 17:53:30 -08:00
Sam Lantinga
f002c5c73f Updated version to 2.0.12 for release candidate build 2020-03-01 14:58:16 -08:00
Sam Lantinga
d09e1783a9 Fixed bug 4996 - Mac: XBoxOne Bluetooth rumble isn't working
rofferom

I have an annoying issue on MacOS about XBoxOne Bluetooth rumble (Vendor: 0x045e, Product: 0x02fd).

When 360controller is installed, rumble is working correctly. However, Bluetooth rumble isn't working at all, with or without 360controller installed (although it is working with Chrome + https://html5gamepad.com).

I looked at the code, and it seems that XBox controllers are managed in MacOS in this file: SDL_hidapi_xbox360.c. The XBoxOne file is disabled for MacOS in SDL_hidjoystick_c.h.

The function HIDAPI_DriverXbox360_Rumble() is called correctly, and hid_write() returns no error.

I have tried a stupid test. I took the rumble packet from 360controller: ec4e88eb2d/XBOBTFF/FFDriver.cpp (L620). With the patch I have attached, I manage to have rumble working on Bluetooth (with some stupid vibration level, but it proves it can if the packet is changed).

But it breaks the USB rumble with 360controller. A comment in the function makes an explicit reference to 360controller, I think that's why I have broken this specific usecase.

I don't know what is the correct way to fix this, but it seems that the current implementation has a missing case for Bluetooth support.


Note that I also tested master this morning, and I have another issue:
    if (!device->ffservice) {
        return SDL_Unsupported();
    }

test fails in DARWIN_JoystickRumble(). This test has been done quickly, I'm not totaly confident about its accuracy.
2020-03-01 14:52:49 -08:00
Romain Roffé
802ddf478e mac: Fix gamepad detection 2020-03-01 13:01:53 -08:00
Sam Lantinga
b378f68cd6 Fixed whitespace 2020-03-01 13:00:50 -08:00
Sam Lantinga
cd69970c24 Fixed bug 4369 - Going fullscreen with green knob in MacOS freezes app for 15 seconds.
Elmar

creating a fullscreen window with SDL_CreateWindow(..SDL_WINDOW_FULLSCREEN_DESKTOP..) in MacOS works fine, except if it was triggered by the user with the green knob in the top left window title bar.

Then "something" is different, and SDL_CreateWindow hangs for 15-20 seconds (tested in MacOS 10.13 and 10.14).

Responsible for the hang is this code in SDL_cocoawindow.m - Cocoa_SetWindowFullscreenSpace:

        const int maxattempts = 3;
        int attempt = 0;
        while (++attempt <= maxattempts) {
            /* Wait for the transition to complete, so application changes
             take effect properly (e.g. setting the window size, etc.)
             */
            const int limit = 10000;
            int count = 0;
            while ([data->listener isInFullscreenSpaceTransition]) {
                if ( ++count == limit ) {
                    /* Uh oh, transition isn't completing. Should we assert? */
                    break;
                }
                SDL_Delay(1);
                SDL_PumpEvents();
            }
            if ([data->listener isInFullscreenSpace] == (state ? YES : NO))
                break;
            /* Try again, the last attempt was interrupted by user gestures */
            if (![data->listener setFullscreenSpace:(state ? YES : NO)])
                break; /* ??? */
        }

One trivial workaround is to change 'const int limit = 10000' to 500. Then the freeze is so short that it doesn't look like a freeze to the user.

Looking further into the problem, I observed that the function Cocoa_SetWindowFullscreenSpace recursively calls itself via some ObjectiveC messages. I managed to extract a callstack for this (copied below): Note how Cocoa_SetWindowFullscreenSpace in stack line 22 calls SDL_PumpEvents, which eventually arrives at  SDL_SendWindowEvent, which calls SDL_UpdateFullscreenMode (stack line 0), which then calls Cocoa_SetWindowFullscreenSpace again (not shown). This recursive second call is the one that hangs.

Another "solution" that worked for me was to add a flag to SDL_Window that is set in Cocoa_SetWindowFullscreenSpace and causes this function to return immediately if called from itself.

Obviously, this is also an ugly hack, but I don't have enough time to dive into this crazy Cocoa/ObjectiveC business deep enough to find a proper solution. But hopefully it's easy for one of the experts around.

Note that there is a "failure to go fullscreen"-message involved, maybe using the green knob causes this failure at first.

I can unfortunately not provide a minimum example.

Best regards,
Elmar

0   com.yasara.View               	0x00000001007495af SDL_UpdateFullscreenMode + 207
1   com.yasara.View               	0x00000001006e2591 SDL_SendWindowEvent + 401
2   com.yasara.View               	0x0000000100775a72 -[Cocoa_WindowListener windowDidResize:] + 370
3   com.yasara.View               	0x0000000100776550 -[Cocoa_WindowListener windowDidExitFullScreen:] + 512
4   com.apple.AppKit              	0x00007fff3180a2a4 -[_NSWindowEnterFullScreenTransitionController failedToEnterFullScreen] + 692
5   com.apple.AppKit              	0x00007fff31c59737 -[_NSEnterFullScreenTransitionController _doFailedToEnterFullScreen] + 349
6   com.apple.AppKit              	0x00007fff3172aa53 __NSFullScreenDockConnectionSendEnterForSpace_block_invoke + 135
7   libxpc.dylib                  	0x00007fff6114b9b1 _xpc_connection_reply_callout + 36
8   libxpc.dylib                  	0x00007fff6114b938 _xpc_connection_call_reply_async + 82
9   libdispatch.dylib             	0x00007fff60ec7e39 _dispatch_client_callout3 + 8
10  libdispatch.dylib             	0x00007fff60ede3b0 _dispatch_mach_msg_async_reply_invoke + 322
11  libdispatch.dylib             	0x00007fff60ed2e25 _dispatch_main_queue_callback_4CF + 807
12  com.apple.CoreFoundation      	0x00007fff33d39e8b __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
13  com.apple.CoreFoundation      	0x00007fff33d3959a __CFRunLoopRun + 2335
14  com.apple.CoreFoundation      	0x00007fff33d38a28 CFRunLoopRunSpecific + 463
15  com.apple.HIToolbox           	0x00007fff32fd1b35 RunCurrentEventLoopInMode + 293
16  com.apple.HIToolbox           	0x00007fff32fd1774 ReceiveNextEventCommon + 371
17  com.apple.HIToolbox           	0x00007fff32fd15e8 _BlockUntilNextEventMatchingListInModeWithFilter + 64
18  com.apple.AppKit              	0x00007fff3128deb7 _DPSNextEvent + 997
19  com.apple.AppKit              	0x00007fff3128cc56 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1362
20  com.yasara.View               	0x000000010076fab2 Cocoa_PumpEvents + 290
21  com.yasara.View               	0x00000001006dd1c7 SDL_PumpEvents_REAL + 23
22  com.yasara.View               	0x00000001007795cf Cocoa_SetWindowFullscreenSpace + 223
23  com.yasara.View               	0x000000010074970b SDL_UpdateFullscreenMode + 555
24  com.yasara.View               	0x00000001006e2476 SDL_SendWindowEvent + 118
25  com.yasara.View               	0x0000000100774ff7 -[Cocoa_WindowListener resumeVisibleObservation] + 135
26  com.yasara.View               	0x000000010077664c Cocoa_ShowWindow + 188
27  com.yasara.View               	0x0000000100749492 SDL_FinishWindowCreation + 546
28  com.yasara.View               	0x0000000100748da5 SDL_CreateWindow_REAL + 1573
29  com.yasara.View               	0x000000010010d9b1 vga_setvideomode + 1347
30  com.yasara.View               	0x00000001003f0d46 mod_initscreen + 2614
31  com.yasara.View               	0x00000001003f344b mod_reinitscreen + 460
32  com.yasara.View               	0x00000001003f370d mod_resizescreen + 383
33  com.yasara.View               	0x0000000100418e39 mod_main + 815
34  com.yasara.View               	0x000000010029ca5d main2 + 5766
35  com.yasara.View               	0x000000010011d1b7 main.main_cpuok + 19
2020-03-01 12:58:50 -08:00
Sam Lantinga
6a6b941e58 Fixed bug 4992 - UWP/WinRT does not set thread priority when using SDL_SetThreadPriority
Ethan Lee

Attached is a diff that I used to get SetThreadPriority working locally. I still have no idea what the minimum SDK version is since Microsoft never documented it, but it's worth pointing out that they're much more aggressive about using the latest VS and UWP SDK anyway (for example, an updated Xbox is no longer compatible with VS2017, and updates are required to have a network connection of any kind).
2020-03-01 12:50:42 -08:00
Sam Lantinga
3e79ac2a16 Fixed trying to handle the HORI Wireless Switch Pad when connected via USB 2020-02-27 13:53:32 -08:00
Sam Lantinga
d7b703adbb Xbox One controller rumble doesn't need synchronization if you use a packet counter of 0 2020-02-27 09:33:32 -08:00
Sam Lantinga
1bb0c43749 Temporarily disabled NEON optimizations added for bug 4365
The ABGR to ARGB blit results in an empty surface, this needs to be looked at.
2020-02-27 09:32:03 -08:00
Sam Lantinga
93c0e32357 Fixed bug 5005 - warnings in kmsdrm
Malte Kießling

At the moment i get following warnings from kmsdrm:

 * in SDL_kmsdrmvideo.c KMSDRM_DestroySurfaces is return type int, but thats never returned or checked against
 * in SDL_kmsdrmvideo.c KMSDRM_DestroySurfaces the variable viddata is not used
 * in SDL_kmsdrmopengles.c KMSDRM_GLES_LoadLibrary a cast to NativeDisplayType is missing

I attached a patch for them :)
2020-02-27 08:20:34 -08:00
Sam Lantinga
6331aebaaf Fixed bug 4987 - Can't build on MinGW a recent state (15'th February, 2020): conflicting types 2020-02-27 08:18:20 -08:00
Ryan C. Gordon
3d1b93ed7d cmake: Forgot to add this file to revision control.
Fixes Bugzilla #5003.

--HG--
extra : rebase_source : bf8f9f7b3f96ae9a7c11d634487ca83712487c27
extra : histedit_source : 05eb4076f48da86a74c93a9bb5fb3a7228624bf0
2020-02-25 14:52:03 -05:00
Sylvain Becker
233d05a1f2 Fix compilation C90 mixed declarations and code (Thanks Cameron Gutman !) 2020-02-25 06:53:51 +01:00
Sylvain Becker
9b5850bdb7 Better fix to set the palette opaque, when there is also a colorkey
(see bug 3827)
2020-02-24 21:57:03 +01:00
Sam Lantinga
ea119534c0 Don't call setPreferredOutputNumberOfChannels on iOS, it breaks audio output 2020-02-24 12:07:18 -08:00
Sam Lantinga
2a669e967a Fixed surround sound support on Apple TV 2020-02-24 10:25:57 -08:00
Sylvain Becker
0b991f8e16 Fix: set to opaque when a palette surface is converted to an alpha format. 2020-02-23 23:07:15 +01:00
Sylvain Becker
1b4134df89 Fix regression: when a palette + colorkey is converted, it needs a blend mode.
- Regression of test_1.c of bug 3827, after fix from bug 4798.
- Blending is also needed when the palette contains alpha value, but not necessarily colorkey.
- Clean up SDL_ConvertColorkeyToAlpha which doesn't seem to need 'ignore_alpha' parameter any-more.

(see bug 3827)
2020-02-23 22:38:08 +01:00
Ryan C. Gordon
3324453465 cocoa: Make sure wait for button enable can't be infinite. 2020-02-23 14:49:03 -05:00
Ryan C. Gordon
e939635f84 cocoa: Removed a debug printf that was accidentally committed. 2020-02-23 14:48:48 -05:00
Sylvain Becker
5a0ed0a7e4 Fixed bug 4999 - Palette surface always promoted to alpha (Thanks Cameron Gutman!)
MSVC Static analysis: Incorrect alpha_value check in SDL_render.c
(see also bug 4425)
2020-02-23 09:59:52 +01:00
Ryan C. Gordon
e0661f0cdf cmake: more proper sdl2-config.cmake work (thanks, Alexander!)
Fixes Bugzilla #4970.

--HG--
extra : amend_source : 58e7991ac25965c177e3f11346396f19e2ca6c5d
2020-02-21 15:52:35 -05:00
Ryan C. Gordon
4814d83a17 cmake: Backed out changeset d62544e5fa7a
This is being replaced by a different patch (see Bugzilla #4970).
2020-02-21 15:51:04 -05:00
Ryan C. Gordon
74335f35e8 cocoa: When exiting a fullscreen space, wait for window state to normalize.
A good metric of this is when the titlebar's "minimize" button is reenabled,
which doesn't happen by the time windowDidExitFullscreen triggers.

This fixes minimizing a fullscreen window on macOS.

Fixes Bugzilla #4177.

--HG--
extra : rebase_source : d3b71427a15165cd0ca0edb9bd3e74da6dd861e6
2020-02-21 14:50:09 -05:00
Sam Lantinga
ebc08484de Fixed support for third party Xbox 360 wireless controller dongle 2020-02-19 08:26:00 -08:00
Ryan C. Gordon
a3d9b5e227 dynapi: Fixed build on non-Android platforms. 2020-02-18 01:44:07 -05:00
Sam Lantinga
99068e7cfe Added Android SDK conditionals to game controller mappings
The Nintendo Switch Pro controller has a different mapping on Android 10 and newer
2020-02-17 14:15:47 -08:00
Sam Lantinga
a76493a35b Made SDL_GetAndroidSDKVersion() available for applications 2020-02-17 13:54:45 -08:00
Ryan C. Gordon
e6e4be9fc1 opengl: Backed out hg changeset 0c915d307499
This is the OpenGL line drawing fix for Bugzilla #3182, but there's some
disagreement about what the renderers should do here, so I'm backing this out
until after 2.0.12 ships, and then we'll reevaluate all the renderer backends
to decide what's correct, and make them all work the same.
2020-02-17 16:15:04 -05:00
Ryan C. Gordon
59af901bbd x11: Wait a bit in SDL_SetWindowSize() to see if window manager vetoed change.
Same idea as the fix for Bugzilla #4646.

Fixes Bugzilla #4727.

--HG--
extra : rebase_source : 4dd57085a593f68553f921ba574607c01e8c08b9
2020-02-17 16:11:18 -05:00
Ryan C. Gordon
6b6ba6d243 x11: Don't delay an extra 10ms if we were just going to break out of the loop.
--HG--
extra : rebase_source : 0c11959078675b6204e643cd859d63b6871ee79d
2020-02-17 15:02:37 -05:00
Ryan C. Gordon
e647acf78d x11: Don't wait for the window to move if it's already in the place we want it.
--HG--
extra : rebase_source : b7ad35263159d7ac5c6c005c9bb0c9dc96bb8a18
2020-02-17 15:00:02 -05:00
Sam Lantinga
2a440598ca Further improvements for bug 4128 - CMAKE: Generated target import file contains incorrect include path
Mohamed

It would be useful to be able to do either `#include "SDL2/SDL.h"` or `#include "SDL.h"`. This patch allows that and adds compatibility with other build systems. It also allows differentiating between SDL1 and SDL2.
2020-02-16 00:08:36 -08:00
Sam Lantinga
5639c05fe4 Fixed bug 4987 - Can't build on MinGW a recent state: conflicting types
Vitaly Novichkov

Recent attempt to build a recent HG state of SDL2 via AppVeyor gives the failure:

30821858/job/359gqvypi2f18nok

```
C:\projects\sdl-mixer-x\build-MinGW-w32-MinSizeRel-Win32-VB6-Binding\external\AudioCodecs\src\AudioCodecs-build\external\SDL2\src\SDL2HG\src\dynapi\SDL_dynapi_procs.h:56:29: error: conflicting types for 'SDL_CreateThread'
 SDL_DYNAPI_PROC(SDL_Thread*,SDL_CreateThread,(SDL_ThreadFunction a, const char *b, void *c),(a,b,c),return)
2020-02-15 16:39:38 -08:00
Sam Lantinga
d5b3d8d150 Added some extra permissions and features likely to be used by SDL applications 2020-02-14 18:21:58 -08:00
Cameron Cawley
952060f329 test: Improved detection of OpenGL support 2020-02-08 19:34:51 +00:00
Cameron Cawley
2b9013fd76 Improved CPU detection on ARM platforms 2020-02-04 16:46:22 +00:00
Cameron Cawley
5e683ff94c Add basic support for compiling on RISC OS 2020-02-13 20:50:47 +00:00
Cameron Cawley
6a3ddc7b5f testfilesystem: Don't exit the application if SDL_GetBasePath isn't supported 2020-02-13 22:58:04 +00:00
Sam Lantinga
6df9e0ec2f Fixed bug 4980 - Build fails for SDL_kmsdrm*.c
Malte Kießling

Since https://hg.libsdl.org/SDL/rev/045f218436fe / bug 4966 i cannot build SDL anymore. The error i get is, essentially, caused by -Werror=declaration-after-statement in SDL_kmsdrmvideo.c and SDL_kmsdrmopengles.c
2020-02-14 16:17:17 -08:00
Sam Lantinga
f862a7305c Fixed bug 4986 - Memory leak in HIDAPI_JoystickConnected
meyraud705

Memory allocated for device->joysticks on line 589 of SDL_hidapijoystick.c is never freed.

Also, use memmove because memory is overlapping.
2020-02-14 16:15:46 -08:00
Sam Lantinga
342c1f5aa3 Fixed audio not coming out of the phone speakers while recording on iOS 2020-02-14 15:19:34 -08:00
Sam Lantinga
a5da847282 Fixed re-setting the audio session category when closing an audio device 2020-02-14 14:18:12 -08:00
Ryan C. Gordon
b88ebe6a95 cmake: Add PACKAGE_VERSION and SDL2_VERSION to sdl2-config.cmake.in
Fixes Bugzilla #4970.
2020-02-14 13:37:32 -05:00
Ryan C. Gordon
5cea2bb70e x11: SDL_SetWindowPosition should try to wait for the window manager.
Wait up to 100 milliseconds, since the window manager might alter or
outright veto the window change...or not respond at all.

In a well-functioning system, though, this should help make sure
that SDL_SetWindowPosition's results match reality.

Fixes Bugzilla #4646.
2020-02-14 13:17:18 -05:00
Ryan C. Gordon
5403dbd4a5 wayland: Don't delay pending surface resize handling on Vulkan.
OpenGL apparently needs to not do any drawing between wl_egl_window_resize
and eglSwapBuffers, but Vulkan apps don't use SDL to present, so they
never call into an equivalent of SDL_GL_SwapWindow where our Wayland code
was handling pending resize work.

Fixes Bugzilla #4722.

--HG--
extra : rebase_source : 123396f1b250a880cf9f47a7fc8895538ea7272d
2020-02-14 00:58:36 -05:00
Ryan C. Gordon
9ba80451dd wayland: Don't force the window into OpenGL mode if we want Vulkan.
--HG--
extra : rebase_source : c880cfc11efe459e8a8f735889929c7c8d1fae3d
2020-02-14 01:08:21 -05:00
Sam Lantinga
a430e13434 Fixed opening audio on Android from the Steam Link shell activity 2020-02-13 16:10:52 -08:00
Sam Lantinga
bf21c9aec1 Resolved conflict and added Android_JNI_RequestPermission() 2020-02-13 10:19:05 -08:00
Sam Lantinga
d62d7ebd0c Improved fix for bug 4748 - Calling WIN_UpdateClipCursor() / WIN_UpdateClipCursorForWindows() on WIN_PumpEvents() causes beeping and choppy mouse cursor movement, right-click doesn't work 2020-02-12 12:26:27 -08:00
Ryan C. Gordon
5c22af2fa8 test: Reimplemented SDLTest_CommonUsage() to restore binary compatibility.
Fixes Bugzilla #4975.
2020-02-12 13:09:38 -05:00
Ryan C. Gordon
48148ca586 mac: Wait a bit before activating app at startup.
This is obnoxious and wrong, but the patch that activates the Dock before
activating the app fixes the _menu_ not responding on Catalina, but the
first window created by the app won't have keyboard focus without a small
delay inserted.

This obviously needs a better solution, but it gets it limping along correctly
for now.
2020-02-12 13:08:29 -05:00
Sam Lantinga
9a6fe8b14b Fixed relative mode mouse events stopping if you click on the title bar 2020-02-11 21:19:05 -08:00
Sam Lantinga
294e05087e Fixed iOS and Android build 2020-02-11 16:23:43 -08:00
Sam Lantinga
06433488e1 Implemented OpenSL-ES audio recording on Android 2020-02-11 16:14:02 -08:00
Sam Lantinga
f26e92cc2b Attempt to make version detection safe for Mac OS X < 10.10 2020-02-11 10:35:14 -08:00
Sam Lantinga
e373060c8b Workaround for bug 4822 - Broken visual output in full screen mode with OS X 10.15
sjordan

We did some investigations into a different direction which I would like to share. As mentioned previously the scaling setting in the preferences play an important role for our problem and they also hint towards an issue with point/pixel scaling factors.

We found an interesting correlation between our fail case and the behavior of [nsWindow.screen backingScaleFactor]. It turns out that whenever we encounter the fail case the scale factor is zero when we print it quickly after calling SDL_CreateWindow. After some time the value changes to a non-zero value. In the success case the scaling factor is nonzero 'immediately'. Note that we don't use that factor. We also find that the window backingScaleFactor does not show the strange behavior even in the fail case.

We have also attempted to find out whether any event triggers the transition from zero to non-zero. We found the transition happening when we call SDL_PollEvent. We can even force this to happen by explicitly adding a SDL_PollEvent at an early stage, but it will only happen if a certain amount of time elapsed, so we need to add some sleep before the call to trigger the transition at an earlier stage. All that seems to imply that the transition happens async and that SDL_PollEvent merely causes the system to update its internal state at that time.

We have also verified that the scaling setting in the preferences does NOT directly correlate to the scaling factor behavior. We find that a particular scaling setting can lead to a fail case for one resolution and a success case for another resolution. This shows that the scaling setting alone does not determine whether the problem will appear or not.

We have also verified on another Mac with 10.14 that the scaling factor is always non-zero and we always have the success case.

I have no idea how to interpret this initial-zero behavior and haven't found any usable information on the screen backing scale factor. It seems as 10.15 does some stuff more async than before and maybe the problem could be caused by unfortunate timings. I would be very interested to hear your opinion about that.

...

Finally we found the cause of all our problems: it's the origin hack in Cocoa_SetWindowFullscreen:

        /* Hack to fix origin on Mac OS X 10.4 */
        NSRect screenRect = [[nswindow screen] frame];
        if (screenRect.size.height >= 1.0f) {
            rect.origin.y += (screenRect.size.height - rect.size.height);
        }

If we comment this one out our game and testdraw2 do behave correctly.

It turns out that if a window is not fully contained in the screen, it's screen property becomes zero and therefore we saw a zero when printing the backing scale factor (although it's not clear why it became nonzero later).

We suggest to add a runtime check which skips this code for 10.15 (or possibly earlier if you happen to know that the hack is not needed for certain older versions).

More info: consider the line

NSRect screenRect = [[nswindow screen] frame];

in Cocoa_SetWindowFullscreen. We found that this rect has the dimensions of the desktop
on our OS X 10.15 setup. This is true both for the success case and the fail case. It seems as the success case is actually a fail case in disguise.

On the other Mac with OS X 10.14 the same rect has the dimension of the newly created screen. This is what I would expect, because at that time the window has already been created successfully and there should be a newly created screen associated to the window.

What are the cases in which the whole origin conversion code for the fullscreen case is supposed to have a non-trivial result?

Today we found that if we print the dimensions of [nswindow screen] later, then we find them to be correct. So the conclusion seems to be that OS X 10.15 does indeed do the window/screen setup more async than before and that the origin correction code uses the [nswindow screen] at a time where the window/screen setup isn't finalized yet.
2020-02-11 10:21:31 -08:00
Sam Lantinga
b886d3e04d Fixed bug 4748 - Calling WIN_UpdateClipCursor() / WIN_UpdateClipCursorForWindows() on WIN_PumpEvents() causes beeping and choppy mouse cursor movement, right-click doesn't work
The problem here was calling ClipCursor() continuously in a tight loop. Fixed by only calling ClipCursor() if the clip area needs to be updated.
2020-02-11 10:08:22 -08:00
Sam Lantinga
b44b56594a Don't add a frame to borderless windows.
It was done to allow hotkey resizing of borderless windows, but Windows will sometimes draw it, regardless of our WM_* message handling. See bug 4466 for more details.
2020-02-11 09:41:55 -08:00
Sam Lantinga
901b499fef Fixed bug 4709 - incorrect (not) handling of windows on-screen cursor keys
Alex Denisov

When using Win10 on-screen keyboard (tooltip.exe), the left and right cursor keys in it do not produce SDLK_LEFT and SDLK_RIGHT events.

Windows messages generated by the on-screen keyboard, for some reason, have their scancodes set to zeroes. Here is the log from Spy++:

WM_KEYDOWN nVirtKey:VK_LEFT cRepeat:1 ScanCode:00 fExtended:0 fAltDown:0 fRepeat:0 fUp:0
WM_KEYUP nVirtKey:VK_LEFT cRepeat:1 ScanCode:00 fExtended:0 fAltDown:0 fRepeat:1 fUp:1

Regular physical keyboard produces VK_LEFT (ScanCode:4B) and VK_RIGHT (ScanCode:4D) which are interpreted correctly.

With on-screen keyboard, the switch statement in VKeytoScancode() does not check for VK_LEFT and VK_RIGHT, returning SDL_SCANCODE_UNKNOWN, which in turn does not get mapped to anything (because the scan codes are zeroes).
2020-02-11 08:36:13 -08:00
Sam Lantinga
fbf6d7e237 Make it possible for the application to use different C runtime begin/end thread functions 2020-02-11 08:26:46 -08:00
Sam Lantinga
25ff055ca2 Make sure SDL_CreateThread has the same signature regardless of how the DLL was created. 2020-02-11 08:01:44 -08:00
Ryan C. Gordon
1beeec74ae wayland: Fix building with -fno-common (which is now the default in GCC 10).
Fixes Bugzilla #4957.

--HG--
extra : rebase_source : 64466e107af6f0a6c825ba2e89fb45c30b531fd5
2020-02-10 23:48:06 -05:00
Sam Lantinga
6d2f81225b Fixed compile warning 2020-02-10 13:59:05 -08:00
Fabrice Fontaine
856c909a25 src/core/linux/SDL_threadprio.c: fix build without threads
Add an include on SDL_error.h to avoid the following build failure
without threads:

/home/buildroot/autobuild/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/../../../../arm-buildroot-linux-uclibcgnueabihf/bin/ld: build/.libs/SDL_threadprio.o: in function `SDL_LinuxSetThreadPriority_REAL':
SDL_threadprio.c:(.text+0x0): undefined reference to `SDL_Unsupported'

Fixes:
 - http://autobuild.buildroot.org/results/7f7712c5bd47de4a3fcec1e0d0526fd5a3ecd532

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2020-02-10 13:56:53 -08:00
Ryan C. Gordon
a76b80af17 opengl: Build out full GL_LINES and respect the diamond-exit rule.
Likewise for the GLES1 and GLES2 renderers.

This solves the missing pixel at the end of a line and removes all the
heuristics for various platforms/drivers. It's possible we could still use
GL_LINE_STRIP with this and save some vertex buffer space, assuming this
doesn't upset some driver somewhere, but this seems to be a clean fix that
makes the GL renderers match the software renderer output.

Diamond-exit rule explanation:
http://graphics-software-engineer.blogspot.com/2012/04/rasterization-rules.html

Fixes Bugzilla #3182.

--HG--
extra : rebase_source : c1728587ab719e93fc95e8b8af79413b3cae93b6
2020-02-10 12:53:54 -05:00
Sam Lantinga
8077909889 The scissor rect needs to be updated when the viewport changes in the Metal renderer 2020-02-10 09:42:53 -08:00
Sam Lantinga
0f44ae0f88 Fixed bug 4966 - KMSDRM: Add dynamic modeset support
Anthony Pesch

* Remove triple buffering support. As far as I can tell, this goes against the libdrm API; the EGL implementations themselves control the buffering. Removing it isn't absolutely necessary as it seemingly works on the Pi at least, but I noticed this while doing my work and explained my reasoning in the commit.

* Replace the crtc_ready logic which allocates an extra bo to perform the initial CRTC configuration (which is required before calling drmModePageFlip) with a call to drmModeSetCrtc after the front and back buffers are allocated, avoiding this allocation.

* Standardized the SDL_*Data variable names and null checks to improve readability. Given that there were duplicate fields in each SDL_*Data structure, having generic names such as "data" at times was very confusing.

* Removed unused fields from the SDL_*Data structures and moves all display related fields out of SDL_VideoData and into SDL_DisplayData. Not required since the code only supports a single display right now, but this was helpful in reading and understanding the code initially.

* Implement KMSDRM_GetDisplayModes / KMSDRM_SetDisplayMode to provide dynamic modeset support.

These changes have been tested on a Raspberry Pi 4 and a Dell XPS laptop with an HD 520.

As an update, I went back over the triple buffer changes and left them in. I didn't entirely get the code originally, I had just seen it calling KMSDRM_gbm_surface_lock_front_buffer twice for a single swap and had removed it because I was paranoid of bugs stemming from it while working on the modeset changes.

I've made a few small changes to the logic that had thrown me off originally and rebased the changes:
* The condition wrapping the call to release buffer was incorrect.
* The first call to KMSDRM_gbm_surface_lock_front_buffer has been removed. I don't understand why it existed.
* Added additional comments describing what was going on in the code (as it does fix the buffer release pattern of the original code before it).
2020-02-09 11:44:22 -08:00
Sam Lantinga
b727f93948 Fixed NullPointerException 2020-02-07 20:20:37 -08:00
Sam Lantinga
a345c092da Removed VID/PID 0x1532/0x0037, which was listed in the Linux kernel as a Razer Sabertooth, because at least one variant of the Razer DeathAdder mouse shows up with this VID/PID.
Specifically the Razer DeathAdder 2013 has this VID/PID
2020-02-07 20:19:32 -08:00
Sam Lantinga
66548a8bff Fixed bug 4968 - NULL passed to memcpy in WriteProprietary in SDL_hidapi_switch.c
meyraud705

In SDL_hidapi_switch.c

line 443: Function BTrySetupUSB call WriteProprietary with pBuf=NULL and ucLen=0
line 376: WriteProprietary check its input (!pBuf && ucLen > 0) || ucLen > sizeof(packet.rgucProprietaryData): ucLen is 0 so it passes
line 382: WriteProprietary call memcpy with pBuf=NULL
2020-02-07 11:49:56 -08:00
Sam Lantinga
39547c8367 Use the triggers to test rumble for more fine grained vibration feedback 2020-02-07 11:45:32 -08:00
Sam Lantinga
ee7b76f6ad Use the asynchronous HIDAPI rumble code for Nintendo Switch Pro controllers 2020-02-07 11:44:57 -08:00
Sam Lantinga
65ee09a29d Update for bug 4923 - Calling SDL_GameControllerRumble() often takes 8 ms
meyraud705

Dualshock4 on bluetooth need 78 bytes for the rumble data while SDL_HIDAPI_RumbleRequest can only hold 64 bytes.

'volatile' is not meant for thread synchronization.

The list of rumble request could grow infinitely if user call SDL_JoystickRumble too much. The documentation says "Each call to this function cancels any previous rumble effect", so overwriting pending request seem like a good idea.
2020-02-07 11:02:34 -08:00
David Ludwig
fdfa4783eb macOS: fix crash if and when joystick-init-on-add fails 2020-02-05 13:16:17 -05:00
Sam Lantinga
a8c1a21887 Updated the Android Xbox One Wireless Controller mapping for the latest Xbox controller firmware update 2020-02-05 09:29:46 -08:00
Sam Lantinga
6cd18f7cb9 Catch both PS3 and PS4 motion controls and don't treat them as a game controller 2020-02-04 18:36:23 -08:00
Sam Lantinga
12b7c0a718 Fixed Visual Studio build 2020-02-04 16:05:39 -08:00
Sam Lantinga
033cbd059b Added SDL_hidapi_rumble.c to the macOS, iOS and tvOS builds 2020-02-04 15:42:49 -08:00
Sam Lantinga
c9f0264cf3 Added SDL_hidapi_rumble.c to the Visual Studio project 2020-02-04 15:35:01 -08:00
David Ludwig
4ec6f86dcc FIX for SDL-4927: CFRetain+CFRelease a game controller's IOKit object
This fixes a crash whereby SDL could crash on macOS/Darwin, if and when a
USB game controller gets unplugged.  SDL was not retaining a reference
to the controller's OS/IOKit-provided 'device object', and was capable
of trying to use it, after a device was hot-unplugged.
2020-01-30 18:03:34 -05:00
Sam Lantinga
df5bd6eab0 Added missing files from previous commit 2020-02-04 15:27:25 -08:00
Sam Lantinga
af5eac78cd Fixed long delay on main thread caused by blocking rumble writes in HIDAPI drivers
There is now a thread that handles all HIDAPI rumble requests and a lock that guarantees that we're not reading and writing the device at the same time.
2020-02-04 15:26:56 -08:00
Sam Lantinga
e42b19fbe7 Moved rumble expiration to the main joystick handling level, and prevent sending the driver layer duplicate rumble requests. 2020-02-04 12:48:53 -08:00
Sjoerd Simons
fd93d66339 Correct joystick hat indexes on linux
The index and indices were swapped; Which is fine as long as there are
no gaps in the ABS_HAT* event availability but otherwise things do get confused.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
2020-02-04 07:23:44 -08:00
Sam Lantinga
d996900e94 Fixed bug 4965 - Update the .hgignore file
Cameron Cawley

This adds a number of files used by the build systems to the .hgignore file. Most of them are for CMake, but there are other additions as well.
2020-02-03 16:38:07 -08:00
Sam Lantinga
6afe8a7c68 Fixed bug 4758 - hgignore clion build artifacts
Malte

clion builds into cmake-build-debug, cmake-build-release etc. by default. Also, it creates the .idea forlder in wich it places some (mostly local) config.

Since SDL is perfectly buildable from within the IDE, i think it'd be nice to have the build and ide artifacts ignored by hg.
2020-02-03 16:34:33 -08:00
Sam Lantinga
abc7ba38df Fixed bug 4833 - Use EGL for X11?
Martin Fiedler

To be precise, this is about *desktop OpenGL* on X11. For OpenGL ES, EGL is already used (as it's the only way to get an OpenGL ES context), as Sylvain noted above.

To shine some light on why this is needed:
In 99% of all cases, using GLX on X11 is fine, even though it's effectively deprecated in favor of EGL [1]. However, there's at least one use case that *requires* the OpenGL context being created with EGL instead of GLX, and that's DRM_PRIME interoperability: The function glEGLImageTargetTexture2DOES simply doesn't work with GLX. (Currently, Mesa actually crashes when trying that.)
Some example code:
https://gist.github.com/kajott/d1b29c613be30893c855621edd1f212e
Runs on Intel and open-source AMD drivers just fine (others unconfirmed), but with #define USE_EGL 0 (i.e. forcing it to GLX), it crashes. The same happens when using SDL for window and context creation.

The good news is that most of the pieces for EGL support on X11 are already in place: SDL_egl.c is pretty complete (and used for desktop OpenGL on Wayland, for example), and SDL_x11opengl.c has the aforementioned OpenGL-ES-on-EGL support. However, when it comes to desktop OpenGL, it's hardcoded to fall back to GLX.

I'm not advocating to make EGL the default for desktop OpenGL on X11; don't fix what ain't broken. But something like an SDL_HINT_VIDEO_X11_FORCE_EGL would be very appreciated to make use cases like the above work with SDL.


[1] source: Eric Anholt, major Linux graphics stack developer, 7 years ago already - see last paragraph of https://www.phoronix.com/scan.php?page=news_item&px=MTE3MTI
2020-02-03 08:06:52 -08:00
Sam Lantinga
03d12f8b27 Fixed bug 4917 - Wayland: handle discrete pointer axis events
Luis Caceres

The current handling of Wayland mouse pointer events only handles wl_pointer.axis events, which, according to the Wayland documentation, deal with mouse wheel scroll events on a continuous scale. While this is reasonable for some input sources (e.g. touchpad two-finger scrolling), it is not for mouse wheel clicks which generate wl_pointer.axis events with large deltas.

This patch adds handling for wl_pointer.axis_discrete and wl_pointer.frame events and prefers to report SDL_MouseWheelEvent in discrete units if they are available. This means that for mouse wheel scrolling we count in clicks, but for touchpad two-finger scrolling we still use whatever units Wayland uses. This behaviour is closer to that of the X11 backend.

Since these events are only available since version 5 of the wl_seat interface, this patch also checks for this and falls back to the previous behaviour if its not available. I also had to add definitions for some of the pointer and keyboard events specified in versions 2-5 but these are just stubs and do nothing.
2020-02-03 00:57:12 -08:00
Sam Lantinga
a36dd13a17 Fixed the hidapi Info.plist for submission to the Apple App Store 2020-02-03 00:51:35 -08:00
Sam Lantinga
cfd79a1d7d Fixed build warnings on Android 2020-02-01 09:23:04 -08:00
Sam Lantinga
fc2b49e423 Map the right pad on the Steam Controller to the right stick in the game controller API 2020-01-31 14:09:23 -08:00
Sam Lantinga
cc3c1b3a14 Build the hidapi framework and weak link it on Mac OS X 2020-01-31 13:09:20 -08:00
Sam Lantinga
170f13b447 Weak link the hidapi framework on iOS and tvOS 2020-01-31 10:45:04 -08:00
Sam Lantinga
4d8d167149 Build hidapi as a framework on iOS, so it can be linked by the application as well. 2020-01-30 16:02:56 -08:00
Sam Lantinga
2b5945f9e8 Fixed build 2020-01-30 14:58:41 -08:00
Sam Lantinga
4c9d146dd8 More Xcode project improvements 2020-01-30 14:53:18 -08:00
Sam Lantinga
1ea93f060e Export SDL functions for iOS application delegates 2020-01-30 14:51:33 -08:00
Ryan C. Gordon
b0b11fbda9 test: Common framework now accepts --usable-bounds command line argument. 2020-01-30 13:47:48 -05:00
Ryan C. Gordon
20bbf48239 test: change path in a comment from '\\' to '/' char. Nothing serious here. 2020-01-30 13:47:19 -05:00
Sam Lantinga
3d0db544bf Added missing file from previous commit 2020-01-29 20:09:59 -08:00
Sam Lantinga
6a79b6a734 Added a unified Xcode project for macOS, iOS and tvOS 2020-01-29 20:09:18 -08:00
Sam Lantinga
3b021949fa Fixed compiler warning 2020-01-29 20:09:16 -08:00
Sam Lantinga
455ec28f0f Added SDL_hidapi_steam.c to the iOS and tvOS dylib build targets 2020-01-29 20:09:14 -08:00
Sam Lantinga
1e33532e50 There are lots of unused macros in the Steam controller code 2020-01-29 20:09:12 -08:00
Sam Lantinga
8a6c3acb7e Added support for the Steam Controller on mobile devices 2020-01-29 20:09:11 -08:00
Sam Lantinga
443729e39d Miscellaneous pending fixes 2020-01-29 20:09:08 -08:00
Sam Lantinga
b3e4cf8e4f Fixed member order to make more sense 2020-01-28 21:41:13 -08:00
Sam Lantinga
a8f3dbf7be Fixed wired PS4 controller support on Android 2020-01-28 17:11:17 -08:00
Ryan C. Gordon
b1dd63a269 x11: Use XSync when changing window position instead of XFlush.
Attempt to fix regression in Bugzilla #4646.
2020-01-28 13:51:24 -05:00
Ryan C. Gordon
508fce096a cocoa: Fix command line apps' menu bar not working on macOS Catalina.
Fixes Bugzilla #4937.
2020-01-27 17:15:12 -05:00
Ryan C. Gordon
5308e7993a darwin: Don't pass NULL device refs to IOHIDDeviceGetValue().
Possibly fixes Bugzilla #4961.
2020-01-27 15:44:48 -05:00
Ryan C. Gordon
c7d5f21176 video: Added a hint to override the display's usable bounds. 2020-01-27 10:58:30 -05:00
Sam Lantinga
3f01bf0a7a Fixed bug 4898 - No rumble because of integer overflow in SDL_JoystickRumble
meyraud705

Switch hidapi and xinput also need to check for overflow, attached a patch for them.
2020-01-26 12:48:35 -08:00
Sam Lantinga
6db8daca3e Don't enumerate devices we can't open 2020-01-26 12:40:32 -08:00
Sam Lantinga
89cf11c987 Fixed disabling the Xbox 360 wireless HIDAPI driver 2020-01-26 10:32:39 -08:00
Sam Lantinga
604d10b517 Always release devices in onPause in case we're going to be force stopped, and for consistency with interacting with other activities that might use the controller 2020-01-26 00:37:48 -08:00
Sam Lantinga
4181e6f181 Fixed compiler warnings 2020-01-23 22:24:24 -08:00
Sam Lantinga
fb59a7e956 Fixed mapping for both versions of the Xbox One Elite Series 2 controller firmware connecting over Bluetooth 2020-01-23 12:53:43 -08:00
Sam Lantinga
195a231caa Added mapping for the Xbox One controller connected via the wireless dongle using xow 2020-01-23 12:53:41 -08:00
Sam Lantinga
11096b51bc Turn off rumble on drivers which don't respect the replay.length value 2020-01-23 12:53:39 -08:00
Sam Lantinga
db64b5bcd6 SDL_LEAN_AND_MEAN defaults off 2020-01-23 01:03:23 -08:00
Sam Lantinga
fb74de4aad Added a single SDL_LEAN_AND_MEAN define to turn on minimal SDL builds
Protected more code with #ifdefs to reduce the size of minimal shared library builds
2020-01-23 01:00:52 -08:00
Sam Lantinga
a93c8d814a Fixed compile warning 2020-01-23 00:32:34 -08:00
Sam Lantinga
b39a795160 Added support for the paddles on the Xbox One Elite Series 1 controller 2020-01-22 11:28:35 -08:00
Sylvain Becker
b5d5e0cd20 Documentation of the footprint #defines 2020-01-22 15:23:44 +01:00
Ryan C. Gordon
9602ea47ed audio: Fixed a '//' style comment. 2020-01-21 17:40:16 -05:00
Ryan C. Gordon
6ee83a5626 audio: Calculate a legitimate SDL_AudioSpec::silence in SDL_LoadWAV_RW().
--HG--
extra : rebase_source : df12ee7fe34175ae2645925f5ba0fdf9d831ea9e
2020-01-21 15:49:37 -05:00
Sylvain Becker
fa93bdd2b9 Add #define SDL_HAVE_BLIT_N_RGB565 to compile out RGB565 LUT 2020-01-21 22:06:09 +01:00
Sylvain Becker
082ca2c747 A few #defines to reduce SDL2 footprint.
Only applied when library is statically linked
2020-01-21 21:33:40 +01:00
Sam Lantinga
ff0611aca9 The Xbox One 0x01 initialization packet is an ack packet 2020-01-20 13:53:40 -08:00
Sam Lantinga
1056ac9d31 Refactored code so SDL_GetJoystickGameControllerType() is called less during controller detection 2020-01-19 11:43:36 -08:00
Sam Lantinga
9c09177e2e Added missing file from previous commit 2020-01-18 11:21:42 -08:00
Sam Lantinga
694ebfdff3 Added support for detecting previously unknown Xbox 360 and Xbox One controllers using the HIDAPI driver with libusb and Android 2020-01-18 11:21:14 -08:00
Sam Lantinga
3c9d888dff There are multiple bindings for XBox One controller model 1708, depending on firmware revision 2020-01-17 11:09:57 -08:00
Sam Lantinga
e67d3e73a0 Added support for the NACON GC-400ES 2020-01-17 11:07:19 -08:00
Sam Lantinga
419b65f816 On Mac OSX there are spurious hat events at program start, so skip these 2020-01-17 11:06:02 -08:00
Sam Lantinga
d0f97f6537 Reattach the kernel driver after closing USB controllers 2020-01-17 10:43:14 -08:00
Sylvain Becker
a87e8ff1a6 Android: prevents rare crashes when app goes to background or ends.
Make sure the thread is actually paused, and context backep-up, before
SurfaceView is destroyed (eg surfaceDestroyed() actually returns).

Add a timeout when surfaceDestroyed() is called, and check 'backup_done' variable.

It prevents crashes like:

  #00  pc 000000000000c0d0  /system/lib64/libutils.so (android::RefBase::incStrong(void const*) const+8)
  #01  pc 000000000000c7f4  /vendor/lib64/egl/eglSubDriverAndroid.so (EglAndroidWindowSurface::UpdateBufferList(ANativeWindowBuffer*)+284)
  #02  pc 000000000000c390  /vendor/lib64/egl/eglSubDriverAndroid.so (EglAndroidWindowSurface::DequeueBuffer()+240)
  #03  pc 000000000000bb10  /vendor/lib64/egl/eglSubDriverAndroid.so (EglAndroidWindowSurface::GetBuffer(EglSubResource*, EglMemoryDesc*)+64)
  #04  pc 000000000032732c  /vendor/lib64/egl/libGLESv2_adreno.so (EglWindowSurface::UpdateResource(EsxContext*)+116)
  #05  pc 0000000000326dd0  /vendor/lib64/egl/libGLESv2_adreno.so (EglWindowSurface::GetResource(EsxContext*, EsxResource**, EsxResource**, int)+56)
  #06  pc 00000000002ae484  /vendor/lib64/egl/libGLESv2_adreno.so (EsxContext::AcquireBackBuffer(int)+364)
  #07  pc 0000000000249680  /vendor/lib64/egl/libGLESv2_adreno.so (EsxContext::Clear(unsigned int, unsigned int, unsigned int, EsxClearValues*)+1800)
  #08  pc 00000000002cb52c  /vendor/lib64/egl/libGLESv2_adreno.so (EsxGlApiParamValidate::GlClear(EsxDispatch*, unsigned int)+132)
2020-01-17 12:41:54 +01:00
Sylvain Becker
8cf14d6373 Fixed bug 4246 - Android: orientation between portrait<->landscape doesn't work
Improve handling of landscape/portrait orientation. Promote to SCREEN_ORIENTATION_SENSOR_* when needed.
Android window can be somehow resizable.
If SDL_WINDOW_RESIZABLE is set, window size change is allowed, for instance when orientation changes (provided the hint allows it).
2020-01-17 12:04:18 +01:00
Sam Lantinga
6b6170caf6 Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
Sam Lantinga
5fff262f77 Fixed bug 4929 - Software renderer produces bugs when optimizations are turned on with Visual C++ 2019
Konrad

I took the liberty of rewriting this function a bit as it seemed to be unnecessary extended with ifs regarding flags (we can check everything in one pass which seem to be the thing which confuses Visual C++ 2019 as well).

Also, I have made CPU features an int instead of uint because if we check it against flags which are all ints it might as well just be int (no signed/unsigned bitwise comparison).
2020-01-16 15:54:20 -08:00
Sam Lantinga
25c5d56c04 Added support for the paddles on the Xbox One Elite Series 2 controller 2020-01-16 15:32:41 -08:00
Sam Lantinga
40811164b0 Improved Xbox One controller initialization 2020-01-16 15:32:39 -08:00
Sam Lantinga
7328bbad9e Fixed bug 4903 - Lack of color multiply with alpha (SDL_BLENDMODE_MOD + SDL_BLENDMODE_BLEND) blending mode for all renderers
Konrad

This kind of blending is rather quite useful and in my opinion should be available for all renderers. I do need it myself, but since I didn't want to use a custom blending mode which is supported only by certain renderers (e.g. not in software which is quite important for me) I did write implementation of SDL_BLENDMODE_MUL for all renderers altogether.

SDL_BLENDMODE_MUL implements following equation:

dstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA))
dstA = (srcA * dstA) + (dstA * (1-srcA))

Background:

https://i.imgur.com/UsYhydP.png

Blended texture:

https://i.imgur.com/0juXQcV.png

Result for SDL_BLENDMODE_MOD:

https://i.imgur.com/wgNSgUl.png

Result for SDL_BLENDMODE_MUL:

https://i.imgur.com/Veokzim.png

I think I did cover all possibilities within included patch, but I didn't write any tests for SDL_BLENDMODE_MUL, so it would be lovely if someone could do it.
2020-01-16 08:52:59 -08:00
Sam Lantinga
0cb537758c Improved Xbox One controller initialization sequence
This sequence works across Microsoft, PowerA, PDP, and HORI controllers.
The newer Microsoft XBox firmware requires synchronizing the rumble sequence number, when SDL sees it after the initial connect
The Razer Wildcat controller requires waiting for init responses before continuing the initialization sequence.
The PDP Battlefield 1 controller takes over a second to be ready for initialization, and if initialization is attempted before then, it will fail.
2020-01-15 22:18:31 -08:00
Sam Lantinga
f1e568d3d0 Added support for the HORI Fighting Commander 2020-01-15 22:18:29 -08:00
Sam Lantinga
5b2a9cbafa Added D-PAD bindings for the Linux Steam Controller 2020-01-13 22:05:58 -08:00
Sam Lantinga
5e165b3bae Fixed compiler warning 2020-01-13 22:05:56 -08:00
Sam Lantinga
e1565fc8da Fixed deadlock in HIDAPI joystick system 2020-01-13 22:05:54 -08:00
Sam Lantinga
6ad79df252 Free the joystick player index when the joystick is removed 2020-01-13 15:35:54 -08:00
Sam Lantinga
ed187bc102 Added support for claiming individiual interfaces on USB devices on Android
This is needed for supporting multiple wireless Xbox 360 controllers
2020-01-13 15:35:52 -08:00
David Ludwig
e3cfa32791 Emscripten: build fix for testoverlay2.c
--HG--
extra : rebase_source : 9aae22ee4e151f5ebbbc93c7701787723378b7e7
2020-01-13 11:46:17 -05:00
Sam Lantinga
a32f50d3f1 Fixed error formatting 2020-01-13 08:12:10 -08:00
Sam Lantinga
a0f8072797 Send the full Xbox One controller sequence for Microsoft controllers
This switches Bluetooth controllers back into USB report mode for the latest Xbox One S and Xbox One Elite Series 2 firmware
2020-01-12 17:22:24 -08:00
Sam Lantinga
0119b26859 Fixed NEON detection on arm64 CPUs
This probably breaks RISCOS, but we need a better fix from Cameron Cawley for this
2020-01-11 22:03:06 -08:00
Sam Lantinga
9f8f58970e Worked around an issue where the kernel would lose the force feedback effect 2020-01-11 13:38:50 -08:00
Sam Lantinga
eac8622569 Add the destination format to the error when conversion isn't possible 2020-01-11 04:38:13 -08:00
Sam Lantinga
f63770922e The Xbox One S Bluetooth controller with older firmware uses b16 as the guide button. The same controller with newer firmware uses b12 as the guide button. Map both buttons so both firmware revisions will work with the same mapping. 2020-01-11 04:34:28 -08:00
Sam Lantinga
4d689c2a25 The Amlogic TVB-906X is Android TV 2020-01-11 04:34:23 -08:00
Sam Lantinga
6fad317398 Only initialize Xbox One controllers once they're ready for initialization (or if they are silent until init)
This fixes the Hyperkin Duke Xbox One controller showing the Xbox startup animation every time an SDL application launches
2020-01-09 14:53:34 -08:00
Sam Lantinga
c76bfc125b Fixed crash when unplugging a HIDAPI controller 2020-01-09 14:53:30 -08:00
Sam Lantinga
0a7fc0f837 Added support for the updated Hyperkin Duke Xbox One controller 2020-01-08 18:55:53 -08:00
Sam Lantinga
1474479300 Fixed handling the 8BitDo M30 in Nintendo Switch mode 2020-01-07 16:47:56 -08:00
Sam Lantinga
59b174ed8a Added support for the 8BitDo M30 GamePad 2020-01-07 18:43:40 -08:00
Cameron Cawley
176539d9db riscos: Add CPU feature detection 2020-01-06 20:26:52 +00:00
Sam Lantinga
073cb5abd1 Added support for the 8Bitdo FC30 Pro 2020-01-06 12:18:51 -08:00
Sam Lantinga
22b126541f Fixed bug 4928 - CMakeLists.txt: put cmake package helpers in proper libdir
Tiago O.

Use LIB_SUFFIX variable to determine the correct path.
2020-01-06 07:06:58 -08:00
"Dmitry V. Levin"
a86389ebc1 X11_InitKeyboard: do not call XAutoRepeatOn unnecessarily
Use XGetKeyboardControl to initialize the current XKeyboardState, and
skip XAutoRepeatOn invocation if global_auto_repeat is AutoRepeatModeOn.

This fixes SDL2 when the X11 client is untrusted.
2020-01-04 11:05:06 -08:00
"Dmitry V. Levin"
8d5f91014a have_mitshm: use XShmQueryExtension to check for MIT-SHM extension
Do not try to guess MIT_SHM extension availability from the string
returned by XDisplayName, use the appropriate API instead.

This fixes SDL2 inside hasher.
2020-01-04 11:03:04 -08:00
Michael Forney
887f98ae5d wayland: support wl_data_device_manager version < 3 2019-12-29 23:10:39 -08:00
Sam Lantinga
4dac206154 Added support for the Hyperkin Duke controller 2020-01-01 08:13:40 -08:00
Sam Lantinga
4a9801918a Fixed bug 4357 - iosbuild.sh broken with SDL 2.0.9
Christoph Charles

The new source files for coremotion sensors don't seem to have been included correctly in configure.in. This leads to the build script ios-build.sh to fail at link time, complaining about missing symbols, namely about missing SDL_COREMOTION_SensorDriver.
2019-12-31 10:40:30 -08:00
Sam Lantinga
9fb5983ebe Fixed GameCube controller axis and trigger ranges and X and B button being swapped 2019-12-30 17:56:56 -08:00
Sam Lantinga
16c3b3b338 Fixed bug 4920 - Wider support for seconds of battery life left on Linux platforms using sys interface
Murad

On my system, SDL_GetPowerInfo() returns -1 seconds of battery life left. I have quickly investigated that in my case SDL uses sys interface to get battery data. It tries to read "time_to_empty_now" file which is not always present. However, it is still possible to calculate remaining lifetime using "energy_now" and "power_now" files. This is what my simple patch (included as attachment) tries to accomplish.
Best wishes.
2019-12-30 13:21:47 -08:00
Sam Lantinga
256cfd4477 Fixed bug 4918 - SDL failed to build due to error LNK2019: unresolved external symbol memset referenced in function SDL_SetJoystickIDForPlayerIndex with MSVC x64 on Windows
LinGao

We build SDL with Visual studio 2017 compiler on Windows Server 2016, but it failed to build due to error LNK2019: unresolved external symbol memset referenced in function SDL_SetJoystickIDForPlayerIndex with MSVC x64 on Windows on latest default branch. And we found that it can be first reproduced on 6c431d30a6df changeset. Could you please help have a look about this issue? Thanks in advance!

Steps to Reproduce:
1.hg clone https://hg.libsdl.org/SDL D:\SDL\src
2.Open a VS 2017 x64 command prompt as admin and browse to D:\SDL
3.msbuild /p:Configuration=Release /p:Platform=x64 /p:WindowsTargetPlatformVersion=10.0.17134.0 VisualC\SDL.sln /t:Rebuild

Actual result:
 Creating library D:\SDL\src\VisualC\x64\Release\SDL2.lib and object D:\SDL\src\VisualC\x64\Release\SDL2.exp
SDL_joystick.obj : error LNK2019: unresolved external symbol memset referenced in function SDL_SetJoystickIDForPlayerIndex [D:\SDL\src\VisualC\SDL\SDL.vcxproj]
D:\SDL\src\VisualC\x64\Release\SDL2.dll : fatal error LNK1120: 1 unresolved externals [D:\SDL\src\VisualC\SDL\SDL.vcxproj]
Done Building Project "D:\SDL\src\VisualC\SDL\SDL.vcxproj" (Rebuild target(s)) -- FAILED.
2019-12-30 13:18:57 -08:00
Sam Lantinga
440864883d Removed unnecessary setlocale() on Mac
240bad3b66
2019-12-30 11:09:03 -08:00
Sam Lantinga
af2ef9e019 Added support for the Nintendo GameCube adapter, tested on Steam Link hardware 2019-12-30 09:44:32 -08:00
Ozkan Sezer
6861da9ef2 SDL_x11events.c (X11_DispatchEvent): remove FIXME and use SDL_strtokr(). 2019-12-27 23:01:10 +03:00
Ozkan Sezer
cbf70cfa54 Fix build error in SDL_render_metal.m (bug #4916.)
Patch provided by Konrad. Error was introduced by commit 35f99d918ca2 for bug #4914.
2019-12-23 19:55:10 +03:00
Sylvain Becker
fa8d0cced7 SDL_ScaleMode: fix compilation GLES renderer 2019-12-23 16:47:00 +01:00
Ryan C. Gordon
179bc26a62 direct3d11: Always set vertex buffers when updating them (thanks, Konrad!).
Fixes Bugzilla #4913.
2019-12-22 20:48:43 -05:00
Sam Lantinga
b6744ae1c2 Fixed bug 4910 - Missing joystick-driver type check in haptic
meyraud705

On Linux and MacOS, some haptic system functions access joystick->hw_data without checking the driver type.
2019-12-22 13:56:50 -08:00
Cameron Gutman
591bf09c87 Use IOHIDManagerRegisterDeviceRemovalCallback() to monitor for HID removal
The function we currently use, IOHIDDeviceRegisterRemovalCallback(), often
fails on Catalina with a "__CFRunLoopModeFindSourceForMachPort returned NULL"
error message. Once a removal callback is missed, we will eventually crash when
the joystick is closed attempting to use the invalid IOHIDDeviceRef.

https://forums.developer.apple.com/thread/124444
2019-12-20 22:25:49 -08:00
Sam Lantinga
1b32b0934a Fixed bug 4911 - Build broken when hidapi enabled
meyraud705

SDL_hidapi.c is added twice to 'SOURCES' which causes "multiple definition error" when linking.
2019-12-22 13:42:20 -08:00
Sam Lantinga
b88aaba9c1 Fixed bug 4914 - Expose SDL_ScaleMode and add SDL_SetTextureScaleMode/SDL_GetTextureScaleMode
Konrad

This was something rather trivial to add, but asked at least several times before (I did google about it as well).

It should be possible to dynamically change scaling mode of the texture. It is actually trivial task, but until now it was only possible with a hint before creating a texture.

I needed it for my game as well, so I took the liberty of writing it myself.

This patch adds following functions:

SDL_SetTextureScaleMode(SDL_Texture * texture, SDL_ScaleMode scaleMode);
SDL_GetTextureScaleMode(SDL_Texture * texture, SDL_ScaleMode *scaleMode);

That way you can change texture scaling on the fly.
2019-12-22 13:39:44 -08:00
Zack Middleton
0d52bf57d7 Fix shutting down HIDAPI device with multiple joysticks
Using Wii U GameCube USB adapter with multiple controllers attached and
restarting SDL input in a game results in extra joysticks with NULL name.

HIDAPI_CleanupDeviceDriver() shut down joysticks by iterating through
device->num_joysticks but each HIDAPI_JoystickDisconnected() decreases
device->num_joysticks and shifts joysticks array down. Resulting in only
half of controllers being shutdown. It worked with only 1 controller
attached though.

Disconnect HIDAPI device joystick 0 until there are none left.
2019-12-22 13:15:11 -08:00
Sam Lantinga
404d56d564 Fixed windows build 2019-12-21 22:33:21 -08:00
Sylvain Becker
cc7a10af34 Android: same way as in nativePause(), resume events are sent from SDL thread 2019-12-21 22:40:33 +01:00
Sylvain Becker
4247051270 Android: fix call of glFinish without context.
Message in the log, when going to background:
"call to OpenGL ES API with no current context (logged once per thread)"

Because of SDL_WINDOWEVENT_MINIMIZED is sent from the Java Activity thread.
It calls SDL_RendererEventWatch(), _WindowEvent() and glFinish() without context.

Solution is to move sending of SDL_WINDOWEVENT_MINIMIZED to the SDL thread.
2019-12-21 21:18:02 +01:00
Sam Lantinga
d53cdbda64 Added support for the Hori Dragon Quest Slime Controller 2019-12-20 21:40:28 -08:00
Sam Lantinga
026b3a0502 Fixed duplicate controller entries on Mac OS X when using libusb, due to the HID interface number not being available in the Mac OS X HID code. 2019-12-20 21:00:16 -08:00
Sam Lantinga
c759387989 Automatically assign player indexes to game controllers, and allow changing the player index for game controllers and joysticks.
Added the functions SDL_JoystickFromPlayerIndex(), SDL_JoystickSetPlayerIndex(), SDL_GameControllerFromPlayerIndex(), and SDL_GameControllerSetPlayerIndex()
2019-12-20 20:12:03 -08:00
Sylvain Becker
c4b62cfd9d Android: fix IllegalStateException in onBackPressed()
Rare exception, not catch-able, which appears when the activity gets in a broken
state.

java.lang.IllegalStateException:
  at android.app.FragmentManagerImpl.checkStateLoss (FragmentManagerImpl.java:1323)
  at android.app.FragmentManagerImpl.popBackStackImmediate (FragmentManagerImpl.java:493)
  at android.app.Activity.onBackPressed (Activity.java:2215)
  at org.libsdl.app.SDLActivity.onBackPressed (SDLActivity.java)
  at android.app.Activity.onKeyUp (Activity.java:2193)
  at android.view.KeyEvent.dispatch (KeyEvent.java:2685)
  at android.app.Activity.dispatchKeyEvent (Activity.java:2423)
  at org.libsdl.app.SDLActivity.dispatchKeyEvent (SDLActivity.java)
2019-12-20 15:58:59 +01:00
Ozkan Sezer
4bebd710c5 fix xcode project file permissions 2019-12-20 14:33:37 +03:00
Paul Cercueil
9b7675d26e kmsdrm: Fix busy-loop within libc's dlopen()
For some obscure reason, the order in which the libdrm/libgbm libraries
are loaded matters.

Without this fix, the first call to check_modesetting() will work and
load then unload all symbols properly, but the second call to this
function will lock up as soon as dlopen() is called on libdrm.

Swapping the order in which the libdrm and libgbm libraries are loaded
is enough to fix (or work around?) this issue.

Fixes #4891:
https://bugzilla.libsdl.org/show_bug.cgi?id=4891

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
2019-12-19 21:47:43 -08:00
Sam Lantinga
53fc83833c Make sure the Xbox 360 driver doesn't try to talk to the wireless controllers 2019-12-19 21:45:44 -08:00
Sam Lantinga
3a677a597a Fixed rare infinite rumble in HIDAPI controller driver 2019-12-19 18:03:28 -08:00
Sam Lantinga
c036e9abd5 Fixed GameCube rumble 2019-12-19 18:00:08 -08:00
Sam Lantinga
418e577f33 Added support for the Nintendo GameCube Controller, using the Mayflash GameCube adapter. 2019-12-19 16:14:22 -08:00
Sam Lantinga
fdfdaf1dc5 Fixed compiler warning 2019-12-19 15:58:16 -08:00
Sam Lantinga
9b213b6e89 Backed out debug code 2019-12-19 15:21:44 -08:00
Sam Lantinga
6e81827e7c Added new HIDAPI driver files to the Xcode projects 2019-12-19 15:18:50 -08:00
Sam Lantinga
21fecce4cf Added new HIDAPI driver files to the Visual Studio project 2019-12-19 15:12:36 -08:00
Sam Lantinga
053b8072d1 Added missing files from previous commits 2019-12-19 15:02:12 -08:00
Sam Lantinga
b560b700c4 Added an untested driver for the Nintendo GameCube adapter, based on code contributed by Ethan Lee 2019-12-19 15:01:35 -08:00
Sam Lantinga
3092fedc53 Added support for wireless Xbox 360 controllers using the HIDAPI driver 2019-12-19 15:01:32 -08:00
Sam Lantinga
f57af100a0 Refactored HIDAPI controller code to support dongles and hubs that dynamically attach controllers 2019-12-19 15:01:30 -08:00
Sylvain Becker
55181836c4 Fixed bug 4906 - Pressing Back button terminates app after SDL_StartTextInput 2019-12-19 13:54:03 +01:00
Sam Lantinga
93d3c202dc Fixed compiler warning 2019-12-19 04:31:00 -08:00
Sam Lantinga
f85f872ffa Added Android support for the Hyperkin X91 and the SteelSeries Stratus Duo 2019-12-17 12:03:57 -08:00
Sam Lantinga
c8e1fc78c4 Added support for the SteelSeries Stratus Duo 2019-12-16 17:11:23 -08:00
Sam Lantinga
a5d0b5b7f0 Update for bug 4883 - Add approximation for display DPI on iOS
Aaron Barany

I realized I made a minor mistake in my patch: I changed the constructor prototype for SDL_DisplayData, but didn't update the declaration in the .h file. The compiler and linker don't complain, but it would probably be best to fix in case a later change runs into a problem from the mismatch. I have attached a patch to fix this.
2019-12-16 10:26:36 -08:00
Sam Lantinga
d131b3ddc1 Fixed bug 4898 - No rumble because of integer overflow in SDL_JoystickRumble
meyraud705

On a Dualshock 4 controller using hidapi driver, calling SDL_JoystickRumble with a duration too long (SDL_HAPTIC_INFINITY for example) causes the rumble to stop immediately.

This happens because of integer overflow on line 301 of SDL_hidapi_ps4.c
(https://hg.libsdl.org/SDL/file/99ecd178999f/src/joystick/hidapi/SDL_hidapi_ps4.c#l301), which sets expiration time in the past.
2019-12-16 10:20:03 -08:00
Sam Lantinga
f403f9cb0f Fixed binding D-pad on NES30 controller 2019-12-12 19:07:26 -08:00
Sam Lantinga
f0835c2350 Added mappings for the Razer Serval on Windows and Mac OSX 2019-12-13 16:12:41 -08:00
Sam Lantinga
58651287b9 Added support for the 8Bitdo NES30 GamePad in wired mode 2019-12-13 16:12:39 -08:00
Sam Lantinga
56ac21844c Enable the LED on PowerA Xbox One controllers 2019-12-13 16:12:37 -08:00
Sam Lantinga
02463ccfff Added support for the BDA XB1 Spectra Pro 2019-12-13 16:12:35 -08:00
Sam Lantinga
fbcacffa2a Identified the BDA XB1 Classic Controller 2019-12-13 16:12:33 -08:00
Sam Lantinga
ccbde816a1 Added general remapping of controller manufacturer 2019-12-13 16:07:25 -08:00
Sam Lantinga
dde1bd4cdc Added support for the HORI PAD A 2019-12-13 16:07:22 -08:00
Sam Lantinga
8ac86ac57e Strip trailing whitespace on controller manufacturer identification 2019-12-12 19:14:37 -08:00
Sam Lantinga
1cc6f31e2d Fixed Xbox 360 Controller support using libusb on Linux 2019-12-12 14:26:34 -08:00
Sam Lantinga
7b73e5ebb4 Fixed comment typo 2019-12-12 14:25:02 -08:00
Sylvain Becker
de82351aaa Android: use SDL_arraysize() 2019-12-12 20:33:11 +01:00
Sylvain Becker
72b24b1874 Android: use 'RegisterNatives' to export the native methods
"The advantages of RegisterNatives are that you get up-front checking
that the symbols exist, plus you can have smaller and faster shared
libraries by not exporting anything but JNI_OnLoad"

https://developer.android.com/training/articles/perf-jni#native-libraries
2019-12-12 18:38:36 +01:00
Sam Lantinga
e1ba2389e4 Added names for official Microsoft controllers, since they don't have descriptive product names 2019-12-11 19:24:40 -08:00
Sam Lantinga
56c692238c Added custom names for some controllers 2019-12-11 17:47:01 -08:00
Sam Lantinga
becf554a56 Shorten "Performance Designed Products" to "PDP" 2019-12-11 17:46:59 -08:00
Sam Lantinga
b0b7783e08 Added support for the full line of PDP Xbox 360 and Xbox One controllers 2019-12-11 17:46:57 -08:00
Sam Lantinga
3a7b1e1a33 Use the controller product string instead of hard-coding controller names 2019-12-11 17:46:54 -08:00
Sam Lantinga
f7fcedea2c Added support for the Razer Raion Fightpad for PS4 2019-12-10 13:09:52 -08:00
Sam Lantinga
b9bcbcf0fa Add the manufacturer to the joystick name on Mac OS X, for consistency with other drivers 2019-12-10 11:46:22 -08:00
Sam Lantinga
f40a11945f Remove any duplicate manufacturer in the joystick name 2019-12-10 11:30:56 -08:00
Sam Lantinga
7a51772418 Don't include the manufacturer if it's already included in the product string 2019-12-10 10:00:49 -08:00
Sam Lantinga
77784463c1 Fixed the name of the Razer RAION Fightpad 2019-12-10 09:38:10 -08:00
Sam Lantinga
60d180e428 Fixed rumble after Xbox controller initialization
When we initialize the controller it has an internal rumble sequence number, and if our rumble sequence number doesn't match that, rumble won't happen. To fix that we cycle through the range of sequence numbers, and at some point we'll match up with the controller's sequence number and it'll roll forward until it matches our next rumble sequence number.
2019-12-09 16:52:11 -08:00
Sam Lantinga
662e995ae9 The PowerA Mini controller blocks while writing feature reports, so don't try to use the HIDAPI driver for it on Linux 2019-12-09 13:54:05 -08:00
Sam Lantinga
80bc288d57 Added some missing Xbox controller names 2019-12-09 13:54:03 -08:00
Sam Lantinga
91b24c357b Fixed bug 4883 - Add approximation for display DPI on iOS
Aaron Barany

There appears to be no way to directly access the display DPI on iOS, so as an approximation the DPI for the iPhone 1 is used as a base value and is multiplied by the screen's scale. This should at least give a ballpark number for the various screen scales. (based on https://stackoverflow.com/questions/25756087/detecting-iphone-6-6-screen-sizes-in-point-values it appears that both 2x and 3x are used)

I have updated the patch to use a table of current devices and use a computation as a fallback. I have also updated the fallback computation to be more accurate.
2019-12-08 11:36:40 -08:00
Sam Lantinga
9c591a8538 Fixed bug 4890 - Add hint for SDL that the graphics context is externally managed
Aaron Barany

Add SDL_HINT_VIDEO_EXTERNAL_CONTEXT hint to notify SDL that the graphics context is external. This disables the automatic context save/restore behavior on Android and avoids using OpenGL by default when SDL_WINDOW_VUKLAN isn't set.

When the application wishes to manage the OpenGL contexts on Android, this avoids cases where SDL unbinds the context and creates new contexts, which can interfere with the application's operation.

When using Vulkan and Metal renderer implementations, this avoids SDL forcing OpenGL to be enabled on certain platforms. While using the SDL_WINDOW_VULKAN flag can be used to achieve the same thing, it also causes Vulkan to be loaded. If the application uses Vulkan directly, this is not necessary, and fails window creation when using Metal due to Vulkan not being present. (assuming MoltenVK isn't installed)
2019-12-08 11:33:06 -08:00
Sam Lantinga
0bac215ef1 Fixed the Apple TV remote menu button on tvOS 13.2 (thanks Romain Tisserand) 2019-12-06 13:48:13 -08:00
Sam Lantinga
1261b79fa7 Fixed the game controller menu button on tvOS 13.2 (thanks Romain Tisserand) 2019-12-06 13:48:10 -08:00
Ryan C. Gordon
d4ae38e3de cocoa: Patched to compile on older compilers.
--HG--
extra : rebase_source : 5208ac48839c78cc7c88614cf5eceab92a0d79fc
2019-12-05 17:27:06 -05:00
Sam Lantinga
fa5fc94422 Fixed controller mapping issues caused by PS3 gyro jitter 2019-12-05 13:48:08 -08:00
Sam Lantinga
54dbdfc8eb Ignore axis jitter when mapping controllers 2019-12-05 13:18:56 -08:00
Sam Lantinga
e3ef217e93 Get full axis range for PS3 controller triggers on Linux 2019-12-05 13:18:53 -08:00
Ryan C. Gordon
bf9b22caa9 cocoa: SDL_GetDisplayDPI() should account for Retina displays.
Fixes Bugzilla #4856.
2019-12-04 12:20:24 -05:00
Sam Lantinga
eef3b51057 Fixed bug 4882 - Fix build for iOS when disabling OpenGL
Aaron Barany

Since OpenGL is deprecated on iOS, it is advantageous to be able to remove all OpenGL related code when building SDL for iOS. This patch adds the necessary #if checks to compile in this case.
2019-12-03 22:07:58 -08:00
Alex Smith
d3aa0260ee Fix sending SDL_WINDOWEVENT_RESTORED after unminimizing windows on X11
SDL_SendWindowEvent will only send a RESTORED event if the window has
the minimized or maximized flag set. However, for a SHOWN event, it
will clear the minimized flag. Since the SHOWN event was being sent
first for a MapNotify event, the RESTORED event would never be sent.
Swapping the SendWindowEvent calls around fixes this.

https://bugzilla.libsdl.org/show_bug.cgi?id=4821
2019-12-02 15:41:25 +00:00
Cameron Gutman
59728f9802 Use stat() to minimize input device opens when not using udev
Calling open() on input devices can generate device I/O which blocks
the main thread and causes dropped frames. Using stat() we can avoid
opening anything unless /dev/input has changed since we last polled.

We could have used something fancy like inotify, but it didn't seem
worth the added complexity for this uncommon non-udev case.
2019-11-20 20:27:45 -08:00
Sam Lantinga
8fd426855c Fixed bug 4877 - Add support for loading menus from a nib/xib instead of building a hardcoded minimum set
Eric Shepherd

Currently, SDL on Cocoa macOS creates a rudimentary menu bar programmatically if none is already present when the app is registered during setup.

SDL could be much more easily and flexibly used on macOS if upon finding that no menus are currently in place, it first looked for the application's main menu nib or xib file and, if found, loaded that instead of programmatically building the menus.

This would then let developers simply drop in a nib file with a menu bar defined in it and it would be installed and used automatically.

Attached is a patch that does just this. It changes the SDL_cocoaevents.m file to:

* In Cocoa_RegisterApp(), before calling CreateApplicationMenus(), it calls a new function, LoadMainMenuNibIfAvailable(), which attempts to load and install the main menu nib file, using the nib name fetched from the Info.plist file. If that succeeds, LoadMainMenuNibIfAvailable() returns true; otherwise false.
* If LMMNIA() returns false, CreateApplicationMenus() is called to programmatically build the menus as before.
* Otherwise, we're done, and using the menus from the nib/xib file!

I made these changes to support a project I'm working on, and felt they were useful enough to be worth offering them for uplift. They should have zero impact on existing projects' behavior, but make Cocoa SDL development miles easier.
2019-12-03 07:12:55 -08:00
Ryan C. Gordon
152078a690 pulseaudio: don't let FlushCapture get stuck in an infinite loop on shutdown.
Fixes Bugzilla #4645.
2019-12-03 03:53:06 -05:00
Ryan C. Gordon
8a8f825f18 direct3d11: Fixed incorrect texture coordinates (thanks, Martin!).
Fixes Bugzilla #4860.
2019-12-03 03:07:34 -05:00
Gerasim Troeglazov
216706a976 haiku: Disable pointer history
(note from PulkoMandy on Bugzilla #4442 about why this is a desirable patch:
"The event mask: note that the window and GL view run in their own thread
which I don't expect to be too much CPU bound, and will quickly pop these
messages and forward them to the main thread in our SDL code. Therefore the
B_NO_POINTER_HISTORY should be no problem, and is the default on Haiku
anyway (it was not in BeOS, but we changed that and added a
B_FULL_POINTER_HISTORY flag to request the old behavior explicitly). So, this
seems fine.")

Partially fixes Bugzilla #4442.
2019-12-03 02:49:01 -05:00
Ryan C. Gordon
f1d916b454 cmake: ${SDL_CMAKE_DEBUG_POSTFIX} needs to be wrapped in quotes.
Otherwise, if it's an empty string, it causes problems.

Fixes Bugzilla #4117.
2019-12-03 02:42:53 -05:00
Sam Lantinga
a975a672c8 Updated DPAD binding for 8Bitdo Zero controller 2019-11-28 14:23:24 -08:00
Sam Lantinga
a8b35bc28c Fixed trying to use the HIDAPI driver for the original Xbox One S Bluetooth controller 2019-11-28 11:44:17 -08:00
Sam Lantinga
dee346af66 Fixed mapping controllers that have axes that start at -32768 and then snap to 0 at the first input report 2019-11-28 11:44:15 -08:00
Sam Lantinga
668f2bd321 Added support for the 8Bitdo SN30 Pro, wired connection 2019-11-28 10:04:05 -08:00
Sam Lantinga
e28b12ca6a Added the full Xbox One Elite Series 2 controller initialization sequence, to start input reports after switching out of Bluetooth mode. 2019-11-27 18:26:57 -08:00
Sam Lantinga
5d869a7e59 Backed out changeset 6f0ec1079286, which fixed bug 4775
This change broke individual key events, so I'm reverting the change until we can investigate a better fix.
2019-11-27 17:17:03 -08:00
Sam Lantinga
a0a3169d7f Check for duplicates in the supported controller list 2019-11-27 15:27:21 -08:00
Sam Lantinga
03f52303a9 Sorted controller entries by type and VID/PID to more easily find entries in the list 2019-11-27 15:27:19 -08:00
Sam Lantinga
5472c08f0e Fixed detection of the Mad Catz FightPad Pro 2019-11-27 15:27:16 -08:00
Sam Lantinga
78ab9d822d Added support for the Google Stadia Controller 2019-11-27 12:38:53 -08:00
Sam Lantinga
751809cca4 Added support for the Hori Fighting Commander 2019-11-27 12:38:51 -08:00
Sam Lantinga
85e1d73e12 Added support for the PowerA XB1 Fusion Fight Pad 2019-11-27 12:38:48 -08:00
Ozkan Sezer
4205214211 CMakeLists.txt: sync DYLIB_CURRENT_VERSION to Xcode project 2019-11-26 20:41:00 +03:00
Sam Lantinga
3a04fa45ce Added support for a variant of the PowerA FUSION Pro Controller 2019-11-26 08:35:41 -08:00
Sam Lantinga
bc1cfae60e Use the same logic to get the config descriptor in hid_open() as in hid_enumerate() 2019-11-25 16:29:12 -08:00
Sam Lantinga
8c5dc58b2f Added some missing controller names 2019-11-25 15:02:54 -08:00
Sam Lantinga
346666653f Added support for the Hyperkin X91 2019-11-25 15:02:50 -08:00
Sam Lantinga
7eecaefd82 Use SDL_hidapi.c instead of the platform specific hid.c implementations when libusb isn't available 2019-11-25 15:02:48 -08:00
Sam Lantinga
1d549300f2 Backed out change to dynamically load udev - it's already happening in SDL_hidapi.c 2019-11-25 15:02:45 -08:00
Sam Lantinga
6b61f030d5 Moved the SteelSeries controllers into the "known controller" section 2019-11-25 13:27:26 -08:00
Sam Lantinga
a7a866b321 Updated identification for the SteelSeries Stratus Duo 2019-11-25 11:12:09 -08:00
Sam Lantinga
87e9b82737 Linux hidapi code dynamically loads udev 2019-11-23 12:11:20 -08:00
Sam Lantinga
6cb3b5112c Fixed DragonRise Generic USB PCB showing up as a PS3 controller 2019-11-23 12:11:16 -08:00
Sam Lantinga
11431c5c53 Added the Linux hidraw sources when libusb isn't available 2019-11-23 11:35:20 -08:00
Sam Lantinga
2fba75a8fe This packet didn't end up being needed to initialize input for the Xbox One Elite Series 2 controller 2019-11-22 17:46:30 -08:00
Ozkan Sezer
9bb60d130b SDL_gamecontroller.h: remove comma at end of enumerator list 2019-11-23 03:28:02 +03:00
Sam Lantinga
07880dca0e Use SDL_zeroa() appropriately 2019-11-22 16:23:37 -08:00
Sam Lantinga
dd2258c2c3 Fixed build 2019-11-22 14:09:24 -08:00
Sam Lantinga
c9c9eb41b6 Added support for the PDP Versus Fighting Pad 2019-11-22 13:44:40 -08:00
Sam Lantinga
e061577afb Added SDL_GameControllerTypeForIndex() and SDL_GameControllerGetType() to return the type of controller attached. 2019-11-22 13:12:12 -08:00
Sam Lantinga
6d873be06d Added support for the PDP Battlefield One controller 2019-11-21 14:04:48 -08:00
Sam Lantinga
fc6c409633 Fixed the guide button on the NVIDIA Controller v01.04 2019-11-21 13:09:00 -08:00
Sam Lantinga
24fd9254ac Added support for the NVIDIA Controller v01.04 on Linux and Mac OS X 2019-11-21 12:11:47 -08:00
Ozkan Sezer
d7ef3d9d79 fix xcode project file permissions 2019-11-21 23:04:20 +03:00
Sam Lantinga
34608829ba Added support for the NVIDIA Controller v01.04 on Android 2019-11-21 11:52:50 -08:00
Sam Lantinga
e6e255bb87 Added support for the MOGA XP5-A Plus 2019-11-21 10:14:57 -08:00
Sam Lantinga
7ee14a9bc1 Turned on controllermap debug output by default 2019-11-21 10:09:26 -08:00
Ozkan Sezer
5314c4626a ran gendynapi.pl after newly added SDL_string.c functions. 2019-11-21 11:50:50 +03:00
Ozkan Sezer
ef80e4516b updated os/2 config file 2019-11-21 11:33:50 +03:00
Ozkan Sezer
2485c440fb CMakeLists.txt: add several missing function checks for unix case. 2019-11-21 10:33:56 +03:00
Ozkan Sezer
6e3cb7cffa configure: add back mistakenly removed strtok_r check, and regenerate. 2019-11-21 10:02:02 +03:00
Sam Lantinga
7b8e308a67 Improved XInput VID/PID detection and added SDL_wcsstr() and SDL_wcsncmp() 2019-11-20 16:42:50 -08:00
Ozkan Sezer
79725cdb32 added SDL_strtokr() as a replacement for POSIX strtok_r (bug #4046.) 2019-11-20 20:40:50 +03:00
Sam Lantinga
cc27616f85 Fixed Xbox One Elite Series 2 showing up as 2 devices in Bluetooth mode on Windows 2019-11-20 08:43:24 -08:00
Ozkan Sezer
016dd1f1d1 SDL.c (SDL_ExitProcess): unconstify its param to match its declaration. 2019-11-20 02:47:40 +03:00
Sam Lantinga
5a9fd48247 Added support for the Xbox One Elite Series 2 controller on Mac OSX 2019-11-19 15:15:00 -08:00
Sam Lantinga
66cb584318 Added support for the Xbox One Elite Series 2 controller in wired mode 2019-11-18 15:46:13 -08:00
Sam Lantinga
42c37b06bc Added Linux controller mapping for the Xbox One Elite Series 2 controller in Bluetooth mode 2019-11-18 14:08:05 -08:00
Sam Lantinga
cda9fd15e6 Added names for some missing Xbox controllers 2019-11-18 11:51:39 -08:00
Sam Lantinga
43768687d0 Added identifiers for the Xbox One Elite Series 2 controller 2019-11-18 11:44:51 -08:00
Sam Lantinga
4dd086735a Fixed unused function warning on Android 2019-11-18 10:48:14 -08:00
Sam Lantinga
3a7e57f1da Fixed bug 4814 - Missing scancodes on Linux
Michael Roe

The mappings for keyboard scancodes on Linux do not include keypad left and right parentheses (used on some Microsoft keyboard), keypad plus/minus, LANG1 and LANG2 (used on Korean keyboards), XK86MenuKB, and F20 (remapped to Audio Mic Mute in the usual X11 config).
2019-11-16 22:45:49 -08:00
Sam Lantinga
0b0de4f563 Fixed bug 4819 - Attempting to create an OpenGL ES context with unachievable MSAA parameters under X11 dooms the program
Solra Bizna

I have written a program that, in the event that the user requests more MSAA samples than their hardware supports, attempts to gracefully fall back to the best MSAA available. This code works with my conventional OpenGL renderer, but if I change nothing about the code except to make it request an OpenGL ES profile instead, Xlib kills the program with an error that looks like:

X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  4 (X_DestroyWindow)
  Resource id in failed request:  0x5c00008
  Serial number of failed request:  188
  Current serial number in output stream:  193

To trigger the bug, attempt to create a window with the SDL_WINDOW_OPENGL flag, with SDL_GL_CONTEXT_PROFILE_MASK set to SDL_GL_CONTEXT_PROFILE_ES, and with SDL_GL_MULTISAMPLESAMPLES set to any unsupported value. SDL_CreateWindow properly returns NULL, but at this point the program is already doomed. Xlib will shortly terminate the program with an error. Calling SDL_CreateWindow again will immediately trigger this termination.

I have attached a skeletal program that reproduces this bug for me. Replacing SDL_GL_CONTEXT_PROFILE_ES with SDL_GL_CONTEXT_PROFILE_COMPATIBILITY avoids the bug (but, obviously, doesn't create an OpenGL ES context).

As I suspected, the problem was with XDestroyWindow being called twice on the same window. The X11_CreateWindow function in src/video/x11/SDL_x11window.c calls SetupWindowData. If initialization fails after that point, XDestroyWindow gets called on the window by a subsequent call to X11_DestroyWindow. But, later in the same function, iff a GLES context is requested and initializing it fails, X11_XDestroyWindow (which wraps XDestroyWindow) is manually called. Shortly after, the intended call to X11_DestroyWindow occurs, which attempts to destroy the same window again. Boom.

(The above confusing summary involves three separate, similarly-named functions: XDestroyWindow, X11_DestroyWindow, X11_XDestroyWindow)

I have attached a simple patch that removes the redundant X11_XDestroyWindow calls. I've tested that XDestroyWindow still gets called for the windows in question, and that it only gets called once.
2019-11-16 22:35:48 -08:00
Cameron Cawley
b7e16c20c8 atomic: Support compiling on ARMv3 2019-10-11 22:08:53 +01:00
Cameron Cawley
935a136364 Added SDL_PIXELFORMAT_BGR444 2019-11-02 22:58:52 +00:00
Sam Lantinga
d2805d6e55 Don't try to use this driver with the Xbox One S in Bluetooth mode on Linux 2019-11-16 19:58:29 -08:00
Sam Lantinga
a8a6d3497b Added support for the Xbox One S controller in Bluetooth mode on Linux 2019-11-16 19:55:53 -08:00
Sylvain Becker
03ad3136c8 Fix missing prototype warning 2019-11-16 22:59:56 +01:00
Sylvain Becker
02c7e4fd6f Fix crash when detecting SIMD 2019-11-16 22:55:36 +01:00
Sam Lantinga
53768d7d97 Added a utility function to simplify the hint handling logic 2019-11-13 21:53:01 -08:00
Sam Lantinga
c3ed380542 Supported Android and Apple hardware has ARM SIMD capability 2019-11-13 15:46:58 -08:00
Sam Lantinga
3ea1eb5600 SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS defaults to true, to match Steam's default behavior 2019-11-13 14:24:48 -08:00
Anuj Mittal
61f5cf85e1 configure: check for build dir when building version res (fix bug #4858)
Fixes a race where we try to build version res file in build directory
before it has even been created. Prevents errors like:

/bin/bash ../SDL2-2.0.10/build-scripts/updaterev.sh
/bin/bash ../SDL2-2.0.10/build-scripts/mkinstalldirs build
mkdir -p -- build
x86_64-pokysdk-mingw32-windres --include-dir=/home/pokybuild/yocto-worker/meta-mingw/build/build/tmp/work/x86_64-nativesdk-mingw32-pokysdk-mingw32/nativesdk-libsdl2/2.0.10-r0/recipe-sysroot/opt/poky/3.0/sysroots/x86_64-pokysdk-mingw32/usr/include ../SDL2-2.0.10/src/main/windows/version.rc build/version.o
x86_64-pokysdk-mingw32-windres: build/version.o: No such file or directory
Makefile:692: recipe for target 'build/version.o' failed
make: *** [build/version.o] Error 1
make: *** Waiting for unfinished jobs....
touch build/.created
WARNING: exit code 1 from a shell command.

Extension of fix:
https://hg.libsdl.org/SDL/rev/99d8b18acf8a

Signed-off-by: Anuj Mittal <am.devel@gmail.com>
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
2019-11-13 10:51:02 +03:00
EXL
8567ce86de haiku: Rename BE_* entities to HAIKU_*
In favor Bugzilla #2349.
Update copyright years to 2019.

Partially fixes Bugzilla #4442.
2019-11-12 17:24:37 -05:00
Peter Kosyh
3af07e9794 haiku: mouse_relative fix
Partially fixes Bugzilla #4442.
2019-11-11 22:23:33 -05:00
Peter Kosyh
6bbeb84a69 haiku: mouse->ShowMouse method added
Partially fixes Bugzilla #4442.
2019-11-11 22:22:40 -05:00
Gerasim Troeglazov
14fb2a9093 haiku: Add support for relative mouse mode.
Partially fixes Bugzilla #4442.
2019-11-11 22:21:17 -05:00
Gerasim Troeglazov
48bde81cb6 haiku: Add simple relative mode for mouse.
Partially fixes Bugzilla #4442.
2019-11-11 22:18:21 -05:00
Adrien Destugues
c2364e8d6a haiku: Fix crash when opening window.
- _num_clips was not set in constructor, so a NULL _clips could be
  mistakenly dereferenced.
- As _clips is accessible outside the class, it is not a good idea to
  free/reallocate it. Try to limit this by reallocating only when it needs to
  grow.

Partially fixes Bugzilla #4442.
2019-11-11 22:14:00 -05:00
Jerome Duval
8380785be9 haiku: use addr_t instead of size_t for OpenGL dynamic loading.
Partially fixes Bugzilla #4442.
2019-11-11 22:04:10 -05:00
Peter Kosyh
a48e635af9 haiku: Invert mouse wheel values to match what SDL expects.
Partially fixes Bugzilla #4442.
2019-11-11 21:59:39 -05:00
EXL
78010bafad haiku: Implement message box for Haiku
Add implementation for functions:

SDL_ShowSimpleMessageBox()
SDL_ShowMessageBox()

Add simple customization support also.
Fix build for x86_gcc2.

Partially fixes Bugzilla #4442.

--HG--
extra : amend_source : 1bada5c1e8f4b81a40bca7158c404b88a97d3dbc
2019-11-11 16:44:40 -05:00
Ozkan Sezer
05e5c6188d ran gendynapi.pl after SDL_HasARMSIMD() addition 2019-11-04 11:15:24 +03:00
Ryan C. Gordon
a5c53f9dc1 Fixed a comment typo (thanks, Dominus!).
https://twitter.com/iniquitatis/status/1190064278365188102
2019-11-01 04:32:44 -04:00
Sylvain Becker
b1eab4839a Android: some readability: redundant casts, deads stores, redundant control flow 2019-10-31 15:53:10 +01:00
Ozkan Sezer
4a96006e0d SDL_qsort.c: sync comments with version 1.15 from mainstream 2019-10-31 17:10:02 +03:00
Sylvain Becker
7a18b5b6ca Wayland: touch events, use of memory after it is freed 2019-10-30 21:12:36 +01:00
Sylvain Becker
51c9915b03 Use correct enum: typo in org_kde_kwin_server_decoration_mode
instead of org_kde_kwin_server_decoration_manager_mode
2019-10-30 17:59:20 +01:00
Sylvain Becker
151fe7f76e Remove redundant 'SDL_GetErrBuf' declaration 2019-10-30 17:35:40 +01:00
Sylvain Becker
5ff9c8ad04 SDL_render_gles2: remove ineffective widening cast
warning: either cast from 'int' to 'size_t' (aka 'unsigned long') is ineffective, or there is loss of precision before the conversion [bugprone-misplaced-widening-cast]
2019-10-30 16:45:53 +01:00
Sylvain Becker
fb9b2cb70c revert this const parameter for X11 function 2019-10-30 16:33:32 +01:00
Sylvain Becker
1e2803ce84 Readability: remove redundant cast 2019-10-30 16:20:58 +01:00
Sylvain Becker
d46923790e Fix const warning in RLE getpix functions 2019-10-30 16:17:59 +01:00
Sylvain Becker
8d04ad1f4d SDL_syspower.c: remove redundant expression 2019-10-30 16:12:39 +01:00
Sylvain Becker
61ca65cfae Readability: change some pointer parameter to be pointer to const 2019-10-30 16:06:51 +01:00
Sylvain Becker
4acf3c3cb4 Readability: remove const-qualifation from function declaration
const-qualification of parameters only has an effect in function definitions
2019-10-30 15:43:49 +01:00
Sylvain Becker
b4ca96449f Readability: remove redundant return, continue, enum declaration 2019-10-30 15:36:17 +01:00
Sylvain Becker
2ebaea723d Readability: remove redundant cast to the same type 2019-10-30 15:13:55 +01:00
Sylvain Becker
bab0be855d BlitAuto: remove redundant cast to the same type 2019-10-30 14:37:06 +01:00
Sylvain Becker
b72b3d0d5f Remove nested redundant #ifndef 2019-10-30 14:29:41 +01:00
Sylvain Becker
b503b72f3c SDL_syspower: remove dead store warning
Value stored to 'str' during its initialization is never read
2019-10-30 14:26:18 +01:00
Sylvain Becker
5e348f75e3 Use fill_function for FillRect SIMD/NEON (bug 4365) 2019-10-29 16:13:41 +01:00
Alex Szpakowski
20f38f7052 iOS: remove some unused code, minor code style cleanup. 2019-10-27 11:41:48 -03:00
Alex Szpakowski
9d1f29993c iOS: replace a deprecated function call with a non-deprecated equivalent. 2019-10-27 11:41:11 -03:00
Sylvain Becker
e36f189289 Android: remove warning in blit_features
"integer constant not in range of enumerated type 'enum blit_features'"
2019-10-27 15:22:28 +01:00
Sylvain Becker
9a412bdf64 Android: fix compilation error of SDL_cpuinfo.c on android-r13b (bug 4365) 2019-10-27 14:52:09 +01:00
Ryan C. Gordon
1ed6be9663 x11: check if the X server honored our XMoveWindow() call (thanks, R.E. Rust!).
This can happen if a window is still grabbed when we try to move it, or if
the X11 ecosystem is just in a bad mood, I guess.

This makes sure that SDL will report the correct position for a window;
otherwise, SDL_GetWindowPosition will just report whatever the last
SDL_SetWindowPosition call requested, even if the window didn't actually move.

Fixes Bugzilla #4646.
2019-10-26 23:58:55 -04:00
Alex Szpakowski
97cd01b831 macOS: more robust detection and switching of exclusive-fullscreen display modes (bug #4822). 2019-10-26 15:27:51 -03:00
Alex Szpakowski
1df8b99b3c macOS Fix potential memory leaks in the Metal renderer caught by clang's static analyzer. 2019-10-26 14:39:50 -03:00
Ryan C. Gordon
ea68d4375d d3d11: Don't fail if there's no vertex data to upload (thanks, Martin!).
Fixes Bugzilla #4832.
2019-10-26 12:56:18 -04:00
Ryan C. Gordon
d659e11a27 cpuinfo: Remove incorrect #warning when building for non-ARM architectures. 2019-10-25 00:07:30 -04:00
Ryan C. Gordon
e4bba9687d cmake: added support for enabling the ARM SIMD/NEON code. 2019-10-24 23:17:19 -04:00
Ryan C. Gordon
bafcc3737f configure: Regenerate configure script with the ARM SIMD/NEON changes. 2019-10-24 21:51:55 -04:00
Ryan C. Gordon
91539a1f69 configure: warn about MIT-licensed code if using ARM SIMD/NEON optimizations. 2019-10-24 21:41:03 -04:00
Ben Avison
e11544c11b ARM: NEON assembly optimization for SDL_FillRect
--HG--
extra : histedit_source : 05adff24c257ab385f7d3887c3a7ff9bd7bd86ff
2019-10-24 21:17:52 -04:00
Ben Avison
0b04ebbcf7 ARM: NEON assembly optimization for function BlitARGBto565PixelAlpha
--HG--
extra : histedit_source : 020eebc551604aef16e5a21e92a9b23a969393af
2019-10-24 21:17:38 -04:00
Ben Avison
3f069f458c ARM: NEON assembly optimization for function BlitRGBtoRGBPixelAlpha
--HG--
extra : histedit_source : 0c4202e02cbd677a99c1606ac622ef27e28923c1
2019-10-24 21:17:19 -04:00
Ben Avison
7ddb7981d8 ARM: Create configure option --enable-arm-neon to govern assembly optimizations
--HG--
extra : histedit_source : ae8cebdb416b6b808acab37128921d82105079cc
2019-10-24 21:17:05 -04:00
Ben Avison
ea3d342c44 ARM: SIMD optimization for 4:4:4:4 to 8:8:8:8 normal blits
--HG--
extra : histedit_source : c47e6317d65d0045a8d001fd2d43be99424ff614
2019-10-24 21:15:50 -04:00
Ben Avison
0245b373e7 ARM: assembly optimization for SDL_FillRect
--HG--
extra : histedit_source : a59d74607d4133873e77d6f4b5f046f692d8d488
2019-10-24 21:15:35 -04:00
Ben Avison
38dfe93240 ARM: SIMD assembly optimization for BGR-to-RGB 32bpp normal blits
--HG--
extra : histedit_source : 2030ded3092783d6be7055a136000b3ba5fcfb24
2019-10-24 21:15:21 -04:00
Ben Avison
194b20bc56 SDL_blit: use a named enum for required hardware bits in dispatch tables
--HG--
extra : histedit_source : 21b83b72797307b338b44027826dca63883bac72
2019-10-24 21:15:09 -04:00
Ben Avison
7b74f8dff2 ARM: SIMD assembly optimization for function BlitARGBto565PixelAlpha
--HG--
extra : histedit_source : 5fe9e97bc4fec9a85a801ede31daa2b5b4677a87
2019-10-24 21:13:56 -04:00
Ben Avison
1362ca2643 ARM: SIMD assembly optimization for function BlitRGBtoRGBPixelAlpha
Much of the heavy lifting of this optimization is lifted from the Pixman
project, which is distributed under an MIT-style license. As far as possible,
these elements have been relicensed to the zlib license.

--HG--
extra : histedit_source : c1e93e49cf2981be109d535558693e49452875bc
2019-10-24 21:13:05 -04:00
Ben Avison
fd7508ad61 ARM: Create configure option --enable-arm-simd to govern assembly optimizations
--HG--
extra : histedit_source : 12ab7dd2b55b3aea44b60ad153a73bd41d81f3fb
2019-10-24 21:12:08 -04:00
Alex Szpakowski
789caa7e85 macOS: Expose high dpi-capable display modes on macOS 10.13+.
Fixes an issue in macOS 10.15 where the displayed content would move up after entering, exiting and re-entering exclusive fullscreen when certain display modes were used (bug #4822).
Bug #3949 is also related to this change.
2019-10-24 20:15:54 -03:00
Sylvain Becker
5960887968 Fixed bug 2014 - Hardcoded srcA value in SDL_Blit_auto.c functions 2019-10-24 18:07:30 +02:00
Sylvain Becker
8bd87ca117 Fixed bug 4775 - Japanese on Android, remove inputtype PASSWORD (Thanks Tamo!) 2019-10-23 11:25:16 +02:00
Sylvain Becker
4cd69969d5 Android: remove eglGetProcAdded busted comment (bug #4040) 2019-10-23 11:07:11 +02:00
Sylvain Becker
00bccb9baf Fixed bug 4843 - Passing NULL to memset in SDL_PrivateLoadButtonMapping
(Thanks!)
2019-10-23 09:53:23 +02:00
Sylvain Becker
4f84eb70f2 Fixed bug 4842 - Redundant condition in MS_ADPCM_Decode and IMA_ADPCM_Decode
(Thanks!)
2019-10-23 09:36:41 +02:00
Sylvain Becker
71fd3d0433 Fixed bug 4840 - Read of uninitialized memory in DXGI_LoadDLL (Thanks!) 2019-10-23 09:26:27 +02:00
Sylvain Becker
a5f949624b Fixed bug 4839 - Read of uninitialized memory in Win32_ResizeWindowShape
(Thanks!)
2019-10-23 09:17:53 +02:00
Sylvain Becker
9112e9155b Fixed bug 4841 - Misplaced parenthesis WIN_WindowProc / WM_ACTIVATE / ClipCursor
(Thanks!)
2019-10-23 08:58:52 +02:00
Sylvain Becker
b9bcc1c105 Fixed bug 4838 - Use after free in SDL_JoystickUpdate (Thanks!) 2019-10-23 08:50:57 +02:00
Sylvain Becker
e2b5420f85 Fixed bug 4837 - Use after free in SDL_SensorUpdate (Thanks!) 2019-10-23 08:46:59 +02:00
Sam Lantinga
07141746e7 Fixed accidental whitespace 2019-10-22 15:43:58 -07:00
Sam Lantinga
87cff63608 Added support for the Power A Nintendo Switch Enhanced Wireless Controller 2019-10-22 10:57:07 -07:00
Sam Lantinga
e5f86fa1d6 Reordered Power A Switch controllers so they're grouped together 2019-10-22 10:28:51 -07:00
Sam Lantinga
c64f8c4d86 Added support for the PowerA - Super Mario Controller 2019-10-22 10:27:30 -07:00
Sam Lantinga
be53132dcd Fixed the location of controller_type.h in the Visual Studio project 2019-10-22 10:26:49 -07:00
Sam Lantinga
031a236456 Fixed the location of controller_type.h in the Visual Studio project 2019-10-22 10:25:55 -07:00
Ozkan Sezer
0841f17433 SDL_endian.h: Use endian.h for OpenBSD.
Patch from OpenBSD CVS, authored by Donovan Watteau.
2019-10-21 22:22:28 +03:00
Ozkan Sezer
c4ca9ebdfe Fix typo with __MIPSEB__ preprocessor check (bug #4836.)
Patch from Simon Howard
2019-10-21 10:20:25 +03:00
Ryan C. Gordon
4ead2b39e3 cpuinfo: Use a better default alignment value (thanks, Simon!).
Fixes Bugzilla #4835.
2019-10-20 22:17:59 -04:00
Sam Lantinga
3dc2e8c3e4 Don't try to use the Xbox HID protocol with the NVIDIA Shield controllers 2019-10-19 01:54:02 -07:00
Sylvain Becker
de4af62f3c remove warning prototype SDL_ExitProcess() 2019-10-19 09:23:40 +02:00
Ozkan Sezer
ab6cd0c600 updated includes for _exit() 2019-10-18 23:10:00 +03:00
Sylvain Becker
a149de6a0c Add internal function SDL_EGL_GetVersion() 2019-10-18 21:47:30 +02:00
Sam Lantinga
60332ec10f Fixed whitespace 2019-10-18 08:56:54 -07:00
Sylvain Becker
382e3d8ad2 Fixed bug 4829 - Sensor events incorrectly disabled 2019-10-18 14:23:37 +02:00
Sylvain Becker
8c775d077e Android: enable eglGetProcAddress (bug #4040, bug #4794) 2019-10-18 14:08:07 +02:00
Sylvain Becker
d6be3ee5f7 Add robustness getting the EGL version (see bug #4040) 2019-10-18 13:27:58 +02:00
Ryan C. Gordon
1cb064bf31 egl: adjust how we load symbols in SDL_EGL_GetProcAddress.
Use eglGetProcAddress for everything on EGL >= 1.5. Try SDL_LoadFunction first
for EGL <= 1.4 in case it's a core symbol, and as a fallback if
eglGetProcAddress fails. Finally, for EGL <= 1.4, fallback to
eglGetProcAddress to catch extensions not exported from the shared library.

(Maybe) Fixes Bugzilla #4794.

--HG--
extra : rebase_source : 8288f8901eaf2ddbcd6bfac126ddcc748df1078f
2019-10-18 00:07:32 -04:00
Sam Lantinga
a7975649c6 Added support for the BDA PS4 Fightpad 2019-10-17 18:07:52 -07:00
Sam Lantinga
4a36e96ef3 Build fix for the build fix 2019-10-17 17:51:36 -07:00
Sam Lantinga
2d0a540be2 Better fix for iOS build 2019-10-17 17:51:49 -07:00
Sam Lantinga
fc07d41949 Fixed build on iOS 2019-10-17 17:47:27 -07:00
Sam Lantinga
d6b20b4c53 Removed unused variable 2019-10-17 17:47:11 -07:00
Sam Lantinga
0fdabf6b9c Added the hint SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS to control whether Nintendo Switch controllers use their button labels or button positions for game controller button reporting. 2019-10-17 17:32:47 -07:00
Sam Lantinga
616ae77ef2 Added support for third party Nintendo Switch controllers that don't support the full protocol 2019-10-17 16:59:05 -07:00
Sam Lantinga
1568d44648 Merged latest data from Steam 2019-10-17 16:14:17 -07:00
Alex Szpakowski
0702104c3a metal: Fix compilation when using older Apple SDKs (bug #4828). 2019-10-17 18:48:58 -03:00
Ryan C. Gordon
bc0021f35c emscripten: Patched to compile (thanks, Caleb!).
Fixes Bugzilla #4827.
2019-10-16 13:54:35 -04:00
Sam Lantinga
60137cf696 Fixed bug 4785 - SDL_CreateRGBSurface creates 1-bit surfaces with zero pitch
Sylvain

Seems to be a regression in this commit: https://hg.libsdl.org/SDL/rev/cf166abbde4a
SDL_CalculatePitch() was using format->BytesPerPixel, now it uses SDL_BYTESPERPIXEL().

The underlying issue is that "surface->format->BytesPerPixel" is *not* always the same as SDL_BYTESPERPIXEL(format);
BytesPerPixel defined as format->BytesPerPixel = (bpp + 7) / 8;
vs
#define SDL_BYTESPERPIXEL(format)  ... (format & 0xff)

Because of SDL_pixels.h format definitions, one is giving a BytesPP 1, the other 0.
2019-10-16 08:45:54 -07:00
Ryan C. Gordon
06d5992f30 x11: On macOS, look for X11 install in /opt/X11 instead of /usr/X11R6.
This is where Apple installs XQuartz now (and apparently, the compatibility
symlink at /usr/X11R6 can be missing).

Fixes Bugzilla #4706.

--HG--
extra : histedit_source : 962212cab88ecd1230ec4f491505c88d67085b53
2019-10-15 22:36:08 -04:00
Ryan C. Gordon
7133dfc02d video: Make sure SDL_FillRects()'s fill_function isn't used unitialized. 2019-10-15 14:55:09 -04:00
Ryan C. Gordon
ae447943ff include: Removed a FIXME comment.
Using (1 << 14) instead of 0x4000 might be clearer for the maintainer, but
it makes it harder to look up these flags when debugging an app. The value
has to be written once by one person, the has to be read by tons of people
over and over.
2019-10-15 14:17:32 -04:00
Ryan C. Gordon
5b3ec9f184 video: Removed unused variables. 2019-10-15 14:04:43 -04:00
Ryan C. Gordon
27a9e64d97 video: speed up SDL_FillRect[s] slightly (thanks, Jakub!).
"This patch does the following:

* Instead of SDL_FillRects calling SDL_FillRect in a loop the opposite
happens -- SDL_FillRect (a specific case) calls SDL_FillRects (a general case)
with a count of 1

* The switch/case block is moved out of the loop -- it modifies the color
once and stores the fill routine in a pointer which is then used throughout
the loop"

Fixes Bugzilla #4674.
2019-10-15 14:03:01 -04:00
Ryan C. Gordon
6339b66aab test: Fixed wrong verbose flag check (thanks, watcom.hecht!).
Fixes Bugzilla #4826.
2019-10-15 12:02:19 -04:00
Ryan C. Gordon
dc66966cc6 windows: Remove /ARCH:SSE option from x64 Visual Studio builds.
Fixes Bugzilla #4561.
2019-10-15 09:07:12 -04:00
Ryan C. Gordon
d79a6f9c0a test: Fixed compiler warning on Visual Studio.
--HG--
extra : rebase_source : 909accf2e3015a69e6d5739f5562310202038f47
2019-10-15 08:54:25 -04:00
Cameron Gutman
9462494d8f Reduce delay to 1 ms in SDL_WaitEventTimeout() and SDL_WaitEvent()
The 10 ms delay effectively caps input polling at 100 Hz and rendering
at 100 FPS if applications use these functions in their event loop. The
delay may also lead to dropped frames even at 60 FPS due if they are
unlucky enough to hit the delay and rendering takes longer than 6 ms.
2018-11-03 15:46:42 -07:00
Sam Lantinga
27e3a45771 Backed out changeset a429ccdea379
Better commit incoming!
2019-10-14 22:41:27 -07:00
Ryan C. Gordon
475b1b7bba events: SDL_WaitEvent()'s polling loop now sleeps 1ms instead of 10ms.
Fixes Bugzilla #4356.
2019-10-15 01:13:44 -04:00
Ryan C. Gordon
1c8dffa9b2 cocoa: Implement SDL_WINDOW_ALWAYS_ON_TOP support (thanks, Gabriel!).
Fixes Bugzilla #4809.
2019-10-15 00:59:10 -04:00
Ryan C. Gordon
fc251a1d25 dynapi: Deal with failure cases better, other fixes.
Fixes Bugzilla #4803.

--HG--
extra : rebase_source : e61e03dd4f7a0046baff2d653c4f533ed6766012
2019-10-14 12:41:06 -04:00
Sylvain Becker
e4d2f905eb Fixed race condition when scaling Touch events, and changing the renderer
target.
Always read the output size of the main renderer.
(similar to bug 2107)
2019-10-14 16:40:46 +02:00
Alex Szpakowski
f7e5d151e2 macOS: Fix the initial window background not being black since macOS 10.14.2 or so, when OpenGL is used (bug #4810). Also fixes "CGContext: invalid context 0x0" errors when an OpenGL window is created (bug #4470). 2019-10-14 00:51:53 -03:00
Alex Szpakowski
f55628e7fa macOS: Fix non-highdpi OpenGL contexts not scaling properly in macOS 10.15 (bug 4810 and 4822). 2019-10-13 21:39:20 -03:00
Sylvain Becker
1665430f7c Fixed bug 4825 - SDL Renderer OpenGL: Buffer overflow (SDL_RENDERCMD_DRAW_LINES) 2019-10-13 20:52:52 +02:00
Alex Szpakowski
20c1dd6012 macOS: Fix asserts in SDL_Render's metal scissor code when the window is resized. 2019-10-13 15:18:28 -03:00
Alex Szpakowski
5a1c21a1e9 macOS: Fix a new issue in 10.15 where the window decorations don't always get restored after SDL_SetWindowFullscreen(window, 0). 2019-10-13 12:16:40 -03:00
Sylvain Becker
53385fcc1a Fixed bug 4797 - SDL fails to compile with Mesa Master (thanks Michael Olbrich!)
fix building with Mesa 19.2

With Mesa 19.2 building fails with:

/include/GLES/gl.h:63:25: error: conflicting types for 'GLsizeiptr'

The same type is defined in include/SDL_opengl.h for OpenGL and the two
headers should not be included at the same time.
This was just never noticed because the same header guard '__gl_h_' was
used. This was changed in Mesa. The result is this error.

Fix this the same way GLES2 already handles this: Don't include the GLES
header when the OpenGL header was already included.
(https://hg.libsdl.org/SDL/rev/a60b3c292f0f)
2019-10-12 18:47:56 +02:00
Sylvain Becker
3b9066d478 Remove 'Enum' suffixes (bug 4813) 2019-10-11 06:18:24 +02:00
Sylvain Becker
81a0f46566 Fixed bug 4813 - Give enums their own name
* SDL_PIXELTYPE_
* SDL_BITMAPORDER_
* SDL_PACKEDORDER_
* SDL_ARRAYORDER_
* SDL_PACKEDLAYOUT_
* SDLK_
* SDL_LOG_CATEGORY_
2019-10-10 17:40:00 +02:00
Sylvain Becker
f8e45d4b56 Fixed bug 4820 - SDL assumes RW_SEEK_SET == SEEK_SET 2019-10-10 17:21:46 +02:00
Ryan C. Gordon
00da518a8c linux: If D-Bus isn't available on the system, don't keep trying to load it.
Fixes Bugzilla #4476.
2019-10-09 19:38:16 -04:00
Ryan C. Gordon
484452103f mouse: Save initial position yet even if xrel and yrel are 0.
The X11 target sets mouse->last_x and last_y in EnterNotify and then calls
SDL_SendMouseMotion(), which throws away the new position because it matches
the mouse->last_x and last_y we just set, meaning that if the pointer is
in the window when it created, SDL_GetMouseState() will report a position of
0,0 until a MotionNotify event (the pointer moves) arrives and corrects the
mouse state.

Mostly fixes Bugzilla #1612.
2019-10-09 13:42:13 -04:00
Ryan C. Gordon
4380aea547 dynapi: Make gendynapi.pl work on older Perl releases. 2019-10-05 20:19:10 -04:00
David Ludwig
1758af58f5 WinRT: fix a link-time error when building UWP + x64
--HG--
extra : rebase_source : 76eaabf446b038b79400be8b84b82e9a7ca4a62f
2019-10-02 14:55:02 -04:00
Sam Lantinga
5a993d3789 Removed unused volume check interval 2019-10-01 08:50:04 -07:00
Ozkan Sezer
1bd9e1d4dc endpointvolume.h checks not needed since changeset 13078:ae4f9911321a . 2019-10-01 14:00:02 +03:00
Sylvain Becker
b57ee9bae4 SDL_LockTextureToSurface: robustness of locked region compared to texture size 2019-10-01 09:26:30 +02:00
Ozkan Sezer
7abdb6e754 dynapi: move new SDL_LockTextureToSurface addition to the end of file. 2019-10-01 00:05:50 +03:00
Sylvain Becker
72bbc9de9d Added a helper function SDL_LockTextureToSurface()
Similar to SDL_LockTexture(), except the locked area is exposed as a SDL surface.
2019-09-30 20:58:44 +02:00
Alex Szpakowski
bfc44641e4 macOS: Fix SDL_metal.h not being copied to the framework's Headers folder when SDL.framework is built using Xcode. 2019-09-27 20:15:42 -03:00
Sam Lantinga
c2a5078c5a Fixed rtkit feature guard 2019-09-27 15:21:31 -07:00
Sam Lantinga
063bd947e4 Fix the RealtimeKit dbus include guards
The SDL_USE_LIBDBUS define is set inside SDL_debug.h, therefore the
circular dependency made it impossible for this feature to be enabled.

Instead, guard SDL_dbus.h based on the autoconf variable HAVE_DBUS_DBUS_H

Additionally, fix one of the rtkit comments. CAP_SYS_NICE isn't required
to achieve high priority. But there is some scheduler config that rtkit
needs the app to setup.
2019-09-27 15:21:27 -07:00
Ryan C. Gordon
c5abb67846 stdlib: Patched to compile. 2019-09-26 13:44:49 -04:00
Ryan C. Gordon
0f56490221 stdlib: Try to coerce VS2019 to not replace some loops with memset() calls.
Fixes (?) Bugzilla #4759.
2019-09-26 12:55:05 -04:00
Ryan C. Gordon
3a8e3718b8 audio: Set (something close to) the correct silence value for U16 audio.
Partially fixes Bugzilla #4805.
2019-09-25 15:40:27 -04:00
Ryan C. Gordon
6efb87b5e4 coreaudio: Apple doesn't support U16 data, so convert in that case. 2019-09-25 15:07:07 -04:00
Brandon Schaefer
b40d67ae21 offscreen: Define missing define on a older EGL for an EXT function which it wont have 2019-09-24 17:49:53 -04:00
Brandon Schaefer
86b7a6bd72 offscreen: Avoid using EGLDeviceEXT as it causes issues with older platforms, which is just a void* 2019-09-24 17:27:51 -04:00
Brandon Schaefer
937d0c8ded offscreen: Add new video driver backend Offscreen
The Offscreen video driver is intended to be used for headless rendering
  as well as allows for multiple GPUs to be used for headless rendering

Currently only supports EGL (OpenGL / ES) or Framebuffers
Adds a hint to specifiy which EGL device to use: SDL_HINT_EGL_DEVICE
Adds testoffscreen.c which can be used to test the backend out
Disabled by default for now
2019-09-24 16:36:48 -04:00
David Ludwig
3d7da54392 CMake: tabs to spaces in new parts of README-cmake.md 2019-09-23 18:30:22 -04:00
David Ludwig
ec890882d8 CMake: document iOS/tvOS support in README-cmake.md 2019-09-23 18:27:14 -04:00
David Ludwig
21405ce399 CMake: bug-fix for tvOS support
tvOS Device support wasn't working, at least not with the current-latest tvOS release (13.0), with CMake failing during its configuration stage.
2019-09-23 18:24:03 -04:00
David Ludwig
a2af92e8eb CMake: add version strings to Apple Info.plist files
This fills in the CFBundleVersion and CFBundleShortVersionString fields,
if and when SDL's test-apps are built via CMake.  This is needed to install
the .app bundles on iOS 13+ (using 'xcrun simctl install booted path/to/testsuchandsuch.app')
2019-09-23 17:48:14 -04:00
David Ludwig
248f5137bf CMake: tvOS support/fixes
To use, set the following CMake variables when running CMake's configuration stage:
- CMAKE_SYSTEM_NAME=tvOS
- CMAKE_OSX_SYSROOT=<SDK>  (examples: appletvos, appletvsimulator, appletvos12.4, /full/path/to/AppleTVOS.sdk, etc.)
- CMAKE_OSX_ARCHITECTURES=<semicolon-separated list of CPU architectures> (example: "arm64;x86_64")

--HG--
extra : rebase_source : fdeae761e5df97a2342bfed61dbbfc41170d61d7
2019-08-27 12:30:20 -04:00
David Ludwig
36e1615cf0 CMake: iOS support added
When using a recent version of CMake (3.14+), this should make it possible to:
- build SDL for iOS, both static and dynamic
- build SDL test apps (as iOS .app bundles)
- generate a working SDL_config.h for iOS (using SDL_config.h.cmake as a basis)

To use, set the following CMake variables when running CMake's configuration stage:
- CMAKE_SYSTEM_NAME=iOS
- CMAKE_OSX_SYSROOT=<SDK>  (examples: iphoneos, iphonesimulator, iphoneos12.4, /full/path/to/iPhoneOS.sdk, etc.)
- CMAKE_OSX_ARCHITECTURES=<semicolon-separated list of CPU architectures> (example: "arm64;armv7s")

Examples:
- for Simulator, using the latest, installed SDK:
    cmake path/to/SDL -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_ARCHITECTURES=x86_64

- for Device, using the latest, installed SDK, 64-bit only
    cmake path/to/SDL -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES=arm64

- for Device, using the latest, installed SDK, mixed 32/64 bit
    cmake path/to/SDL -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES="arm64;armv7s"

- for Device, using a specific SDK revision (iOS 12.4, in this example):
    cmake path/to/SDL -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos12.4 -DCMAKE_OSX_ARCHITECTURES=arm64

- for Simulator, using the latest, installed SDK, and building SDL test apps (as .app bundles):
    cmake path/to/SDL -DSDL_TEST=1 -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_ARCHITECTURES=x86_64

--HG--
extra : rebase_source : 0c6beeec1886332c685dad6c665085ed4e7f2a3e
2019-08-27 11:07:43 -04:00
Jinke Fan
ebcfaef81f Add Hygon Dhyana processor support
Background:
    Chengdu Haiguang IC Design Co., Ltd (Hygon) is a Joint Venture
    between AMD and Haiguang Information Technology Co.,Ltd., aims at
    providing high performance x86 processor for China server market.
    Its first generation processor codename is Dhyana, which
    originates from AMD technology and shares most of the
    architecture with AMD's family 17h, but with different CPU Vendor
    ID("HygonGenuine")/Family series number(Family 18h).

Related Hygon kernel patch can be found on:
http://lkml.kernel.org/r/5ce86123a7b9dad925ac583d88d2f921040e859b.1538583282.git.puwen@hygon.cn

Best regards.
2019-05-15 19:54:36 +08:00
Ozkan Sezer
d6fd87993c SDL_messagebox.h: remove comma at end of enumerator list 2019-09-22 21:41:20 +03:00
Ozkan Sezer
749686ee9d update version number in Makefile.os2 too 2019-09-22 20:47:00 +03:00
Sam Lantinga
455a109d79 Updated SDL development builds to version 2.0.11 2019-09-22 10:37:16 -07:00
Sam Lantinga
ca75c1f7aa The PS4 is ignoring the volume values in the report, so we don't need to fill them in. 2019-09-19 16:50:49 -07:00
Sam Lantinga
7af6f1bab9 Don't have Windows headers define min/max, in case they're defined by application code 2019-09-11 15:08:37 -07:00
Sylvain Becker
a52f365446 Fixed bug 4798 - PNG w/transparency breaks in SDL 2.0.10 but works in SDL 2.0.9 2019-09-10 17:12:34 +02:00
Ozkan Sezer
43d3bedb26 test: replace some exit()s with returns. 2019-09-10 10:03:20 +03:00
Sam Lantinga
530f718027 Fixed compiler warning on Android 2019-09-09 13:50:46 -07:00
Sam Lantinga
77d8ec0dbc SDL_blit_N.c: Correct vec_perm() application on little-endian 64-bit PowerPC
The LE transformation for vec_perm has an implicit assumption that the
permutation is being used to reorder vector elements (in this case 4-byte
integer word elements), not to reorder bytes within those elements.  Although
this is legal behavior, it is not anticipated by the transformation performed
by the compilers.

This causes pygame-1.9.1 test failure on PPC64LE because blitted pixmaps are
corrupted there due to how SDL uses vec_perm().

From RedHat / Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1392465
Original patch was provided by: Menanteau Guy <menantea@linux.vnet.ibm.com>
2019-09-06 08:50:19 -07:00
Conn O'Griofa
0dadd146a6 KMSDRM_GLES_SwapWindow: fix non-vsync case
If KMSDRM_drmModeSetCrtc is called when the swap interval is
set to 0, the driver behaves as though vertical sync is engaged by
limiting framerate to the refresh rate, but performance is much worse
than with vertical sync enabled.

Resolve this issue by ensuring that the Crtc is only set up once,
and KMSDRM_drmModePageFlip is called, albeit without any followup
queueing or waiting for flips.
2019-09-06 08:44:46 -07:00
Sam Lantinga
9f7ed473fc Fixed bug 4789 - Linux accelerometers no longer available as joysticks
Daniel Drake

A long time ago, it was possible to play neverball on Linux using the accelerometer found in HP laptops.

The kernel exposes the accelerometer as a joystick (/dev/input/jsX) as well as an evdev device (/dev/input/eventX). I guess it worked fine when SDL was using the js interface, but then stopped working here: http://hg.libsdl.org/SDL/rev/fdaeea9e7567

Looking at current code which uses udev to discover joysticks, it looks for the udev tag ID_INPUT_JOYSTICK.

However udev's internal input_id logic specifically tags accelerometers as ID_INPUT_ACCELEROMETER and nothing else.

This looks like a good fit for SDL_HINT_ACCELEROMETER_AS_JOYSTICK.
2019-09-06 08:42:54 -07:00
Ozkan Sezer
54cb8a7451 SDL_windowsevents.c: remove isVistaOrNewer (not used since 8254c364ec4a) 2019-09-05 20:47:20 +03:00
Ozkan Sezer
ed7faa076e fix permissions 2019-09-05 13:21:02 +03:00
Sylvain Becker
548a1f9d93 SDL_windowsmessagebox.c: remove unused variable 2019-09-05 10:49:53 +02:00
Sylvain Becker
6f9bfb75f0 SDL_bmp.c: remove unused variable warnings 2019-09-05 10:08:47 +02:00
Sam Lantinga
cc181908f0 x11: add a hint to force the VisualID used when creating a window. 2019-09-04 09:27:58 -07:00
Ryan C. Gordon
cf6b9e8180 stdinc: On macOS and iOS, use memset_pattern4() for SDL_memset4().
Fixes Bugzilla #4724.

--HG--
extra : rebase_source : 09a73f9539ef4b5086c68dcbd42be5944b551fa8
2019-09-04 00:39:47 -04:00
Sam Lantinga
9bfd60fb48 Fixed bug 4536 - Heap-Buffer Overflow in SDL_GetRGB pertaining to SDL_pixels.c
Ozkan Sezer

As for the issue: This bmp reports bpp=0, therefore SDL_CalculatePitch()
returns pitch==0, which is then fed to SDL_malloc() (which is malloc())
and malloc(0) returns _something_ which is not NULL but not someting
that we expect..  Then testsprite.c:LoadSprite() accesses the pixels
as *(Uint8*)pixels which valrind reports as:

==15533== Invalid read of size 1
==15533==    at 0x8048C08: LoadSprite (testsprite.c:45)
==15533==    by 0x80492FC: main (testsprite.c:224)
==15533==  Address 0x449e588 is 0 bytes after a block of size 0 alloc'd
==15533==    at 0x40072B2: malloc (vg_replace_malloc.c:270)
==15533==    by 0x4045719: SDL_CreateRGBSurface (SDL_surface.c:126)
==15533==    by 0x40403C1: SDL_LoadBMP_RW (SDL_bmp.c:237)
==15533==    by 0x8048BB2: LoadSprite (testsprite.c:36)
==15533==    by 0x80492FC: main (testsprite.c:224)

Besides, valrind also reports this:
==15533== Conditional jump or move depends on uninitialised value(s)
==15533==    at 0x40403F3: SDL_LoadBMP_RW (SDL_bmp.c:247)
==15533==    by 0x8048BB2: LoadSprite (testsprite.c:36)
==15533==    by 0x80492FC: main (testsprite.c:224)


Easy/quick solution would be early-rejecting a bmp with 0 bpp from SDL_bmp.c:SDL_LoadBMP_RW()
2019-09-03 11:55:20 -07:00
Ozkan Sezer
09a1cda048 SDL_bmp.c: restore most of the original formatting. 2019-09-02 12:35:00 +03:00
Ryan C. Gordon
25172f6f82 direct3d: Be more aggressive about resetting state when textures go away.
Fixes Bugzilla #4768.
2019-09-02 00:11:58 -04:00
Ryan C. Gordon
94bcd876de d3d11: Fixed VB state, avoiding unnecessary recreation (Thanks, Alex!).
Fixes Bugzilla #4779.
2019-09-01 22:41:44 -04:00
Sylvain Becker
f03b5ef30e LoadBMP: fix some warnings 2019-08-31 22:58:11 +02:00
Sylvain Becker
5982324061 LoadBMP: use code from SDL_image which allows loading compressed BMP files 2019-08-31 22:52:15 +02:00
Sam Lantinga
827c02da57 Allow mouse messages from Wacom pens, e.g. right click pen buttons, etc. 2019-08-30 15:32:15 -07:00
Sam Lantinga
7f1ee3f05e Fixed bug where the Steam overlay would generate an event and stop input processing for the frame. 2019-08-30 08:03:19 -07:00
Ozkan Sezer
4ee2aba0d1 use 'U' suffix on constants instead of (unsigned int) cast. 2019-08-30 11:35:20 +03:00
Sylvain Becker
e7b47e02ba Android: minor warning 2019-08-30 09:00:06 +02:00
Sylvain Becker
017af0ae91 Android: fix corresponding warnings 2019-08-30 08:55:20 +02:00
Sylvain Becker
ed4d83da73 Android: add more warning flags 2019-08-30 08:43:13 +02:00
Sylvain Becker
a8b00e9d91 Fixed bug 3918 - HIDAPI, CMake support for android project 2019-08-27 11:38:43 +02:00
Sam Lantinga
7b13b4a196 Fixed Windows relative mouse coordinates when capturing the mouse over RDP 2019-08-26 17:43:01 -07:00
Alex Szpakowski
9b8c97f15c gl/gles/gles2 render: fix SDL_RenderClear being affected by the clip rect in some situations. 2019-08-26 18:49:04 -03:00
Sam Lantinga
ace57ce610 Fixed bug 4475 - add Gasia Co. Ltd PS(R) Gamepad support
Frank

This gamepad/controller is sold in Germany https://www.amazon.de/gp/product/B01AQTPSA6/ref=ppx_yo_dt_b_asin_title_o03__o00_s00 but isn't supported right now. It identifies as "Gasia Co. Ltd PS(R) Gamepad"
2019-08-26 10:08:25 -07:00
Ozkan Sezer
c4d911d170 RPI_FreeCursor: set global_cursor to NULL to prevent double-free (bug 4769) 2019-08-26 18:41:40 +03:00
Sylvain Becker
0d0b51f2db Fixed bug 1663 - SDL_EventState(SDL_DOLLARGESTURE,SDL_IGNORE) etc. has no effect 2019-08-24 20:40:37 +02:00
Ozkan Sezer
0df1fc13af fix permissions 2019-08-23 03:01:10 +03:00
Sam Lantinga
b9acc8cecd Fixed whitespace 2019-08-22 16:12:16 -07:00
Sam Lantinga
f9c83e5ce5 [SDL][IOS] Audio fix - applies stream to sound data when resampling or reformatting is required. 2019-08-22 16:09:42 -07:00
Sam Lantinga
524454bad0 Prevent the SPEEDLINK COMPETITION PRO joystick from switching into Android controller mode when enumerated over HID on Windows 10. 2019-08-22 15:58:00 -07:00
Alex Szpakowski
504d68fa8f macOS: Use the proper type (NSSize instead of CGSize) for the bounds of metal views. 2019-08-22 19:23:52 -03:00
Sylvain Becker
0fb1a8c50a Fixed bug 4172 - remove logging Gesture error "NumPoints = 0"
- not necessary when app isn't recording gesture.
- happen when gesture path has less than 2 different points
2019-08-22 10:15:33 +02:00
Sylvain Becker
39b5b2d72c Fix audio conversion U16_to_F32_SSE2 (bug 4186) 2019-08-19 21:23:47 +02:00
Sylvain Becker
8749ba20aa Fixed bug 4186 - ARM/NEON audio converters cause strange clicking noises
reverse the order when storing ouput buffer
2019-08-19 20:35:02 +02:00
Sylvain Becker
940eeb03d0 Fixed bug 4186 - ARM/NEON audio converters cause strange clicking noises
reverse the order when storing ouput buffer
2019-08-19 16:57:15 +02:00
Alex Szpakowski
0f14f2a87a metal renderer: optimize SDL_RenderFillRect slightly. 2019-08-18 10:38:32 -03:00
Alex Szpakowski
ccfe75a655 render: fix colors not being set properly after the previous change 2019-08-18 09:35:11 -03:00
Alex Szpakowski
0b01e3cf35 render: avoid a couple redundant memcmp calls in all drawing functions. Improves performance slightly. 2019-08-17 22:26:33 -03:00
Alex Szpakowski
fd9b2e7257 metal renderer: use vertex attributes instead of indexing into a buffer with the vertex id in the shader. Allows for more flexibility with vertex setup in the future.
Also optimize vertex buffer binding slightly.
2019-08-17 16:53:08 -03:00
Alex Szpakowski
bee3a60005 metal renderer: more closely match buffer data alignment requirements from the metal specification. 2019-08-17 01:09:30 -03:00
Alex Szpakowski
e03c7d97d3 render: simplify vertex and uniform data allocation. Improves performance of various SDL_Render functions (bug #4764). 2019-08-17 00:43:44 -03:00
Alex Szpakowski
8a2ccace8a metal renderer: use the device address space instead of the constant address space for colors.
It doesn't negatively impact GPU performance in my tests, and it removes the need for 256 byte memory alignment of color data on macOS.
2019-08-17 00:37:22 -03:00
Alex Szpakowski
9d1d406b74 metal: Update compiled shaders based on compilation script changes 2019-08-16 22:13:30 -03:00
Alex Szpakowski
c4524f16b7 metal: Update shader compilation script with fixes for newer xcode versions and for running on older platforms 2019-08-16 22:11:50 -03:00
Alex Szpakowski
1cac684966 iOS: Fix issues with Split VIew on iPad (bugs #4586, #4705). 2019-08-15 19:38:12 -03:00
Sylvain Becker
7a36cc410d Android: remove tabs/indent 2019-08-15 20:38:25 +02:00
Sylvain Becker
d6637510b2 Android: SDL_image/SDL_mixer/SDL_ttf partially compiling with CMake (bug 3918) 2019-08-13 16:00:08 +02:00
Sam Lantinga
dcf21d5da2 Disable HIDAPI by default, as it breaks on Linux when trying to use libusb with non-root permissions on some distributions 2019-08-12 13:35:36 -07:00
Sylvain Becker
79da113ed7 Fixed bug 3918 - CMake support for android project 2019-08-11 15:23:37 +02:00
Ozkan Sezer
102850e1bd fix permissions 2019-08-08 23:35:02 +03:00
Sam Lantinga
9a01434255 [ SDL ] Fix compile error building for Windows/ARM64 on Visual Studio 2017 Win10 SDK 10.0.18362.0 which requires ar,74intr.h/arm64_neon.h header instead of armintr.h/arm_neon.h for intrinsics.
@saml
2019-08-08 13:26:05 -07:00
Ethan Lee
ebf1ac3122 hidapi: Explicitly include locale.h, for setlocale 2019-08-06 23:08:01 -04:00
Sam Lantinga
5a7015c93c Fixed bug 4747 - [Patch] SDL_ShowMessageBox ignores BUTTON_RETURNKEY_DEFAULT flag
Caleb Cornett

SDL_ShowMessageBox on UIKit doesn't do anything special with buttons that are marked with the flag SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT. According to Apple's documentation on UIAlertController, a button can respond to a return key if it's marked as the preferredAction of the controller. SDL doesn't set a preferredAction currently, so I've attached a patch to fix that.
2019-08-05 23:52:16 -07:00
Sam Lantinga
97b93a86d6 Fixed bug 4354 - CMake builds do not correctly enable IME on Linux
Callum McGing

While the CMake build checks for ibus and does enable the ibus backend with set(HAVE_IBUS_IBUS_H TRUE), this does not define SDL_USE_IME, thus CMake built SDL2 (as in Arch Linux) cannot use IME at all.

The attached patch fixes this behaviour when building against ibus. IME support will still fail when only fcitx is available on the build system.
2019-08-05 23:46:09 -07:00
Sam Lantinga
01075dc1f2 Fixed bug 4689 - SDL fails to detect compositor shutdown on Wayland -- program keeps running
M Stoeckl

To reproduce:

1. Run any SDL-based program with a Wayland compositor, orphaning it so that it doesn't have an immediate parent process. (For example, from a terminal, running `supertux2 & disown`.) The program should use the wayland backend, i.e. by setting environment variable SDL_VIDEODRIVER=wayland.
2. Kill the compositor process.

Results:

- The SDL program will keep running.

Expected results:

- The SDL program should close. (What close should mean here, I'm not sure - is injecting an SDL_Quit the appropriate action when a video driver disconnects?)

Build data:

2019-06-22, hg tip (12901:5cbf6472a916), Linux, can reproduce with sway, weston, and other Wayland oompositors.
2019-08-05 23:38:48 -07:00
Ethan Lee
99abe1244f Port libusb hid.c to SDL, add to MinGW configure 2019-08-04 00:01:38 -04:00
Alex Szpakowski
0ba98cae5f Add public APIs for creating a Metal view attached to an SDL window. Add SDL_metal.h. 2019-08-05 12:35:32 -03:00
Alex Szpakowski
84cb66b8a8 macOS: fix a typo in touch handling code. 2019-08-04 23:30:55 -03:00
Alex Szpakowski
5934a368bb Fix touch-related compile errors on Linux. 2019-08-04 16:56:40 -03:00
Ozkan Sezer
2467ed197c minor warning fixes. 2019-08-04 14:56:02 +03:00
Alex Szpakowski
99c222cc77 Implement touch window IDs on x11/xinput2. 2019-08-04 00:34:23 -03:00
Ozkan Sezer
08a0f96749 fix permissions 2019-08-03 12:50:28 +03:00
Ozkan Sezer
0f3d9a7186 remove test/aclocal.m4 2019-08-03 12:49:50 +03:00
Sam Lantinga
1d2350c07f Fixed building on Mac OS X without libusb 2019-08-02 18:14:31 -07:00
Sam Lantinga
7de41a80e1 Fix nullptr crash on android
nullcheck the device coming back from InputDevice.getDevice(deviceId) in new code added to sdlactivity.onkey.


java.lang.NullPointerException:
  at org.libsdl.app.SDLSurface.onKey (SDLActivity.java:1793)
  at android.view.View.dispatchKeyEvent (View.java:13321)
  at android.view.ViewGroup.dispatchKeyEvent (ViewGroup.java:1912)
  at android.view.ViewGroup.dispatchKeyEvent (ViewGroup.java:1912)
  at android.view.ViewGroup.dispatchKeyEvent (ViewGroup.java:1912)
  at android.view.ViewGroup.dispatchKeyEvent (ViewGroup.java:1912)
  at com.android.internal.policy.DecorView.superDispatchKeyEvent (DecorView.java:685)
  at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent (PhoneWindow.java:1869)
  at android.app.Activity.dispatchKeyEvent (Activity.java:3447)
  at org.libsdl.app.SDLActivity.dispatchKeyEvent (SDLActivity.java:496)

@dang @saml @dave
2019-08-02 17:20:00 -07:00
Sam Lantinga
ac6485552e Fix bug where the wrong button was the default in the old message box because buttons were added backwards, breaking the indexing used by GetButtonIndex.
Add messagebox flags to explicilty request left-to-right button order or right-to-left.  If neither is specified it'll be some platform default.
2019-08-02 17:19:50 -07:00
Sam Lantinga
f146a96b35 Added support for a few controllers on Android 2019-08-02 17:12:49 -07:00
Alex Szpakowski
d34695ffd4 Add a windowID field to SDL_TouchFingerEvent (bug #4331).
This is unimplemented on some platforms and will cause compile errors when building those platform backends for now.
2019-08-01 18:22:12 -03:00
Ozkan Sezer
c8e23236cd configury: allow libusb-less hidapi for macosx. 2019-08-01 17:41:40 +03:00
Ozkan Sezer
9c13eeabbb use WIN_IsWindowsVistaOrGreater() from core/windows for isVistaOrNewer 2019-07-31 23:37:02 +03:00
Ethan Lee
55c49e7d33 hidapi: Add SDL_hidapi.c, allows support for multiple hidapi backends.
This is currently supported on Linux and macOS. iOS and Android are not
supported at all, Windows support could be added with some changes to the libusb
backend. The Visual Studio and Xcode projects do not use this feature.

Based on Valve Software's hid.cpp, written in collaboration with Andrew Eikum.
2019-07-31 12:20:55 -04:00
Sam Lantinga
571fc2a8b1 Make sure HIDAPI is initialized whenever we call HIDAPI_IsDevicePresent() 2019-07-31 10:20:37 -07:00
Andrew Eikum
e0039a7c75 joystick: Ensure HIDAPI is initialized before calling it 2019-07-31 11:14:48 -05:00
Andrew Eikum
5e44950dfe cmake: Fix locating libusb header at configure-time
Removing the CheckUSBHID call is necessary to avoid caching the failed header
check result before we find libusb via pkg-config.
2019-07-31 11:34:00 -05:00
Ozkan Sezer
ac7da51929 minor whitespace tidy-up. 2019-07-31 19:40:50 +03:00
Sam Lantinga
198b2d497f Fixed bug 4692 - Command line parsing
Galadrim

As I have seen, SDL implements its own command line parser for Windows in SDL_windows_main.c. Unfortunately, it doesn't seem to allow command line arguments with trailing backslashes if quoting is required.

Usually, when you write an application that gets command line arguments passed as argc and argv, the parsing is done by parse_cmdline. The Windows API also provides the function CommandLineToArgvW, so an application can parse itself if only the command line string is provided. Both functions behave almost identically according to their documentation. If the argument "\\" (including the quotes) is passed, they both turn it into a single backslash.

The SDL command line parser on the other hand doesn't recognize the second quote character as the closing character in this example and therefore includes it in the parsed argument. The parser does not count the number of backslashes preceding a quote. It always treats a quote as escaped if a backslash is in front of it. Therefore, it should be impossible to quote and escape an argument correctly, if it has a trailing backslash and contains characters that require quoting.

Of course, each application is allowed to implement its own parsing rules, so SDL is free to do so. But the problem I see is that there are arguments, that are impossible to be passed to the parser correctly, as I described above. Is there a reason, why SDL does not simply use CommandLineToArgvW instead of implementing its own parser?

Here are some links that show that correct argument parsing, as it is usually done in Windows, is quite complicated:

https://docs.microsoft.com/en-us/windows/desktop/api/shellapi/nf-shellapi-commandlinetoargvw

http://www.windowsinspired.com/how-a-windows-programs-splits-its-command-line-into-individual-arguments/
2019-07-31 09:11:20 -07:00
Ozkan Sezer
32894f4f11 use SDL_zeroa at more places where the argument is an array. 2019-07-31 05:11:40 +03:00
Ozkan Sezer
ab8f831379 Fix bug 4746 - introduce SDL_zeroa macro. 2019-07-31 01:22:02 +03:00
Ozkan Sezer
ac4cb57923 minor build fix. 2019-07-31 01:19:26 +03:00
Ozkan Sezer
82cdc07031 MS_ADPCM_Decode: fix assigning an array to a pointer (lose '&'). 2019-07-31 00:10:00 +03:00
Ozkan Sezer
97014820d1 better readability.. 2019-07-31 00:07:15 +03:00
Ozkan Sezer
61368f443c SDL_iconv_string: add (char*) casts before SDL_malloc() calls. 2019-07-31 00:06:50 +03:00
Ozkan Sezer
0806aa2d53 minor build fixes. 2019-07-31 00:05:28 +03:00
Sam Lantinga
85138c1ec6 Fixed bug 4538 - validate image size when loading BMP files 2019-07-30 11:00:00 -07:00
Andrew Eikum
5542297551 hidapi: Update repository URLs
Upstream hidapi has been re-homed. Update the repo URLs to help guide folks
where to contribute fixes.
2019-07-25 08:05:13 -05:00
Sam Lantinga
f20de21177 Fixed bug 4742 - SDL 2.0.10 DMG has duplicated files (instead of symlinks) 2019-07-30 10:15:49 -07:00
Sam Lantinga
88ea879a38 Fixed bug 4745 - 2.0.10 fails to build against macOS 10.11 SDK
Joshua Root

NSEventSubtypeMouseEvent was added in 10.12, so it needs to be defined on 10.11 as well
2019-07-30 10:04:46 -07:00
Sylvain Becker
2e6310cc74 Fixed bug 4739 - Android: loading native libs, generated by bundletool (Thanks akk0rd87) 2019-07-27 20:21:42 +02:00
Alex Szpakowski
9f568ea83a macOS: fix atomics using deprecated functions instead of compiler intrinsics, when SDL is built with the Xcode project. 2019-07-27 14:08:51 -03:00
Sam Lantinga
b43ec841b4 Don't call hid_enumerate() if the HIDAPI drivers are all disabled 2019-07-25 15:21:44 -07:00
Sam Lantinga
902abb593a Added tag release-2.0.10 for changeset bc90ce38f1e2 2019-07-25 11:04:36 -07:00
Andrew Eikum
b71dec57ab hidapi: Zero out new hid_device_info structs 2019-07-23 14:41:00 -05:00
Ethan Lee
7a84f02172 Copypaste SDL_NSLog to UIKit backend, document it as such 2019-07-17 23:20:57 -04:00
Sam Lantinga
c4c43627bb Fixed bug 4726 - Fix for tvOS GetPrefPath
Caleb Cornett

Unlike iOS and macOS, tvOS does not have any persistent local storage. In fact, the ApplicationSupport directory pointed to by the existing Cocoa GetPrefPath() throws an error whenever any attempt is made to access it. To get any local storage on an Apple TV, our only option is to use a temporary cache directory.

This patch changes the tvOS PrefPath to this cache directory and also logs a critical warning that this if developers want their save data to persist across game sessions, they must use some form of iCloud storage.
2019-07-18 19:33:17 -07:00
Sam Lantinga
c0871789d5 Fixed build error 2019-07-17 16:47:19 -07:00
Sam Lantinga
6e1595997a Merged latest changes from Steam into controller_type.h 2019-07-17 16:47:17 -07:00
Sam Lantinga
6a313250ad Add linked list of opened HID devices to prevent accessing already freed devices in device removal callback that is sometimes called even after being unregistered 2019-07-17 16:47:13 -07:00
Sam Lantinga
d5f6eda1b2 Added support for the Victrix Pro Fight Stick for PS4 2019-07-17 13:01:44 -07:00
Cameron Gutman
bdb24dc076 Allow hotplugging joysticks without udev 2019-06-24 21:08:26 -07:00
Sam Lantinga
c5309610f9 Fixed bug 4704 - SDL_HINT_ANDROID_SEPERATE_MOUSE_AND_TOUCH on Windows?
superfury

I notice that, somehow, when locking the mouse into place(using SDL_SetRelativeMouseMode), somehow at least the movement information gets through to both mouse movement and touch movement events?

My app handles both, so when moving a touched finger accross the app(using RDP from an Android device) I see the mouse moving inside the app when it shouldn't(meaning that the touch movement is ignored properly by the app(press-location dependant) but the mouse movement is still performed due to the mouse movement events)?
2019-07-15 09:36:53 -07:00
Sam Lantinga
6e31658d7c Fixed bug 4723 - Generic Xbox pad controller bindings seem odd/broken
alexrice999

I have a knock off wired xbox 360 controller called afterglow for xbox 360 controller. Despite there being a few afterglow controllers in the controller mapping the guid of my controller seems to map to Generic Xbox pad. This binding is as follows:
```
 "030000006f0e00001304000000010000,Generic X-Box pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:a0,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:a3,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
```
When running openmw I have a strange issue that the joysticks work for up and down movements but not for side to side. I managed to track this down to the side to side events being classified as joystick events instead of gamepad events.
I believe this is due to both "leftstick" and "leftx" being bound to "a0" which seems odd to me. If I change openmw's mappings to remove these the controller works as expected. I was hoping someone who knows a lot more than me (as I have only been exploring this today trying to fix my controller) would know what is happening
2019-07-14 16:59:39 -07:00
Jimb Esser
f300711f50 Blacklist Corsair device causing hang 2019-07-14 16:48:31 -07:00
Alex Szpakowski
60cae8d8af macOS: Fix SDL_GL_CreateContext/MakeCurrent on non-main threads causing a Main Thread Checker warning when built with Xcode 11 / the macOS 10.15 SDK.
Fixes bug #4714.
2019-07-13 17:04:02 -03:00
Ryan C. Gordon
5ad9adcc0e ios: Fixed MFi guide button not being detected (thanks, Caleb!).
Fixes Bugzilla #4721.
2019-07-12 21:28:43 -04:00
Ryan C. Gordon
85acfec543 cmake: Add setupapi library to Windows build dependencies (hidapi needs it).
Fixes Bugzilla #4719.
2019-07-12 13:40:58 -04:00
Ryan C. Gordon
1ceddc5a20 cocoa: Set keyboard mod state correctly when turning off capslock.
Fixes Bugzilla #4716.

--HG--
extra : rebase_source : 5b360391f52cf3a4655f9bd3a7f4a2ad0c487851
2019-07-11 01:07:14 -04:00
Sylvain Becker
aec1d08f5a x11: prevent a synthetic mouse event when using a touchscreen
With multitouch, register to receive XI_Motion (which desctivates MotionNotify),
so that we can distinguish real mouse motions from synthetic one.

(bug 4690)
2019-07-10 10:06:28 +02:00
Ryan C. Gordon
2196977939 x11: set some modality things on message boxes with parent windows.
--HG--
extra : amend_source : 48628fd472f064256c194505f50c2e4bb040f03a
2019-07-09 17:28:02 -04:00
Sylvain Becker
ecbbaa8996 SDL_Mouse/Touch: discard synthetic events when hints are not set.
Those are generated/flagged by platform layer.
2019-07-09 11:46:42 +02:00
Ozkan Sezer
40cd461506 fix permissions 2019-07-09 08:55:00 +03:00
Ryan C. Gordon
d94ce6c016 cmake: Added HIDAPI support.
--HG--
extra : rebase_source : 0b5f91722b2552f1f047e67a1f9c6a19be93c20d
2019-07-08 16:46:52 -04:00
Ryan C. Gordon
1f7b118b31 configure: Windows and macOS now respect --enable-hidapi.
(and it defaults to "yes" on those platforms. Other places, which use libusb,
still default to no because they probably need root permissions to work.)

--HG--
extra : rebase_source : a1e87bb21658338374c94701860e90eacd90c6ea
2019-07-08 16:08:16 -04:00
Cameron Gutman
894d41096c Ignore synthetic mouse events generated for touchscreens
Windows generates fake raw mouse events for touchscreens for compatibility
with legacy apps that predate touch support in Windows. We already handle
touch events explicitly, so drop the synthetic events to avoid duplicates.
2019-07-07 11:23:16 -07:00
Ryan C. Gordon
aef73dd969 cocoa: Another attempt at mouse vs touch support.
This time, we make anything we think is a MacBook trackpad report its touches
as SDL_MOUSE_TOUCHID, even though they're not _actually_ synthesized events,
and let all mouse input--even if the OS synthesized it from a multitouch
trackpad on our behalf--look like physical input. This is backwards from
reality, but produces the results most apps will expect.

Note that if you have a real touch device that doesn't appear to be the
trackpad, it'll produce real touch events with unique device ids, so it's
not a total loss here, but also note that the way we decide if it was the
trackpad is an imperfect heuristic; it happens to work out right now, but
it's not impossible that a real touchscreen could come to the Mac at some
point and (incorrectly?) call it a "mouse" input, etc.

But for now, good enough.

Fixes Bugzilla #4690.
2019-07-08 13:41:01 -04:00
Sam Lantinga
8c8d26cd8f Fixed bug 4710 - audio/alsa: avoid configuring hardware parameters with only a single period
Anthony Pesch

The previous code first configured the period size using snd_pcm_hw_par-
ams_set_period_size_near. Then, it further narrowed the configuration
space by calling snd_pcm_hw_params_set_buffer_size_near using a buffer
size of 2 times the _requested_ period size in order to try and get a
configuration with only 2 periods. If the configured period size was
larger than the requested size, the second call could inadvertently
narrow the configuration space to contain only a single period.

Rather than fixing the call to snd_pcm_hw_params_set_buffer_size_near
to use a size of 2 times the configured period size, the code has been
changed to use snd_pcm_hw_params_set_periods_min in order to more
clearly explain the intent.
2019-07-07 09:10:56 -07:00
Sam Lantinga
f19f7b7741 Fixed bug 4707 - SDL_SetRelativeMouseMode fails on Vivante
Cameron Gutman

The bugfix in https://hg.libsdl.org/SDL/rev/ba1a66b57385 caused SDL_SetRelativeMouseMode() to begin failing on Vivante (Steam Link). Even though Vivante doesn't have a SetRelativeMouseMode() or WarpMouse() function, it's in relative mode already (because it uses evdev) so the function was actually working as intended.

I think providing a no-op SetRelativeMouseMode() function for Vivante is a reasonable fix. Since it's already getting relative events through evdev, it really is a no-op to "enter relative mode".

In fact, this is probably the right thing to do for all backends that use evdev (vivante, raspberry, and kmsdrm). Raspberry and kmsdrm both have WarpMouse() implementations so SDL_SetRelativeMouseMode() isn't failing there, but it still seems to make sense not to have to do the fake warping if they're evdev-based anyway.
2019-07-03 15:57:55 -07:00
Sylvain Becker
f937c8e7b4 Fixed bug 4702 - Android back button does not send SDL_KEYDOWN event
fallback when event.getSource() is SOURCE_UNKNOWN
2019-07-03 13:37:54 +02:00
Sam Lantinga
41ee61e718 Fixed bug 4708 - testdropfile: double-free
Juha Niemimäki

SDLTest_CommonEvent seems to free the file name so testdropfile prints some garbage to console and crashes when freeing the name again.
2019-07-03 02:37:15 -07:00
Ryan C. Gordon
bba68b14bb raspberry: Actually commit the whole patch. :) (Thanks, Joe!)
Fixes Bugzilla #4699.
2019-07-02 16:49:35 -04:00
Ryan C. Gordon
9fd62317a4 cocoa: Don't report trackpad mouse events as synthesized touches.
Fixes Bugzilla #4690, sort of. I guess.
2019-07-02 12:29:36 -04:00
Ryan C. Gordon
81ed2b286b raspberry: Fixed missing mouse cursor (thanks, Joe!)
"Starting with changeset 12433, the mouse cursor is not displayed on the
Raspberry Pi platform, due to a bug in the handling of the new
"global_cursor" in RPI_ShowCursor(). Currently, if cursor == global_cursor,
the function immediately returns 0. The function should not return here.
Instead, if cursor == global_cursor, it shouldn't try to hide the current
cursor and update global_cursor = cursor. However, it *should* still continue
through the rest of the function."

Fixes Bugzilla #4699.
2019-07-02 10:26:54 -04:00
Ryan C. Gordon
df3ddbe0b2 dbus: Don't SimulateUserActivity if we're already inhibiting the screensaver. 2019-07-02 09:43:26 -04:00
Ryan C. Gordon
6ebf6310e0 dbus: Add org.freedesktop.ScreenSaver.SimulateUserActivity support. 2019-07-02 09:38:31 -04:00
Alex Szpakowski
da0ede5e21 iOS: Fix the window size not being set properly when Split View is used on an iPad (bug #4586). 2019-07-01 14:52:56 -03:00
Sam Lantinga
6356c53dc5 Made it more explicit that 2.0.10 and newer are required for the SDL_RW* functions 2019-07-01 09:05:15 -07:00
Sam Lantinga
e40047c710 Documented that the SDL_RW* macros no longer exist, and you can't use an older SDL library if you build with SDL 2.0.10. 2019-07-01 09:02:04 -07:00
Sam Lantinga
ebf3889389 Fixed memory barrier macro check so it isn't quite so fragile 2019-06-30 23:58:31 -07:00
Sam Lantinga
16a348fb07 Limit the compile error to the case where we actually define the memory barrier macro as the function 2019-06-30 23:55:28 -07:00
Sam Lantinga
68d873f3e6 Fixed bug 4683 - SDL_atomic infinite recursion on armv6/armv5 w/ thumb
The real problem is that SDL_atomic.c was built in thumb mode instead of ARM mode, which is required to use the mcr instruction on ARM platforms. Added a compiler error to catch this case so we don't generate code that does infinite recursion.

I also added a potentially better way to handle things on Linux ARM platforms, based on comments in the Chromium headers, which we can try out after 2.0.10 ships.
2019-06-30 23:26:16 -07:00
Sam Lantinga
d950b33ffd Fixed bug 4436 - [OpenBSD] fix D-pad
daniel.c.sinclair

Hi, this patch breaks dpad/hat input on my PS4 controller.  The attached patch restores functionality.  Calling SDL_PrivateJoystickHat() at the end of BSD_JoystickUpdate was setting the hat state to zero on every kind of input, instead of just the HUG_DPAD events.
2019-06-30 22:48:13 -07:00
Sylvain Becker
fda772abf9 Android: concurrency issues, make sure Activity is in running State when calling
functions like SDL_CreateWindow, SDL_CreateRenderer, Android_GLES_CreateContext

Bugs 4694, 4681, 4142
2019-06-28 16:38:42 +02:00
Sylvain Becker
75e9a99364 Add an "error" label in SDL_CreateRenderer (no op) 2019-06-28 16:14:50 +02:00
Sylvain Becker
8f0a89740b Android: explicitly expand Android_GLES_MakeCurrent/Android_GLES_CreateContext
from SDL_egl_c.h
2019-06-28 16:05:20 +02:00
Ryan C. Gordon
8ace14e824 cocoa: Check for capslock in -[NSResponder flagsChanged], not with IOKit.
Using IOKit for this pops up a warning at startup on macOS 10.15 ("Catalina"),
asking the user to authorize the app to listen to all keyboard input in the
system, which is unacceptable.

I _think_ we were using IOKit under incorrect presumptions here; the Stack
Overflow link mentioned in it was complaining about not being able to use
flagsChanged to differentiate between left and right mod keys, but that's not
an issue for capslock.

It's also possible this code was trying to deal with capslock changing when
the window didn't have focus, but we handle this elsewhere now, if we didn't
at the time.
2019-06-26 13:21:43 -04:00
Ryan C. Gordon
c73c997142 windows: Call GetWindowText() with the correct parameters (thanks, Zebediah!)
GetWindowText() wants you to tell it the size of the buffer--including the
terminating NULL char--but we weren't counting that last char, losing the
last char of the string in the process. This was only seen with the special
case of SDL_CreateWindowFrom() to use an existing native window, not
the usual SDL_CreateWindow() codepath.

Fixes Bugzilla #4696.
2019-06-26 01:29:01 -04:00
Ozkan Sezer
01ec6cbd48 define __ARM_NEON for Windows only if _M_ARM or _M_ARM64 is defined. fixes Visual Studio builds. 2019-06-25 11:47:02 +03:00
Ozkan Sezer
99aea49466 update version in os/2 makefile 2019-06-24 23:51:10 +03:00
Ozkan Sezer
499158df05 fix permissions 2019-06-24 23:50:20 +03:00
Sylvain Becker
abaa112349 Android: export Lock/Unlock activity API 2019-06-24 18:08:11 +02:00
Sam Lantinga
7623d36d47 Fixed bug 4684 - GLES1 variables missing under Android with CMake
Braden Obrzut

https://hg.libsdl.org/SDL/file/9d3f245739f8/CMakeLists.txt#l911

I believe the following should also be specified there:

set(SDL_VIDEO_OPENGL_ES 1)
set(SDL_VIDEO_RENDER_OGL_ES 1)

As it is now GLES1 support is missing when building for Android despite it linking to the library.
2019-06-21 22:01:27 -07:00
Ryan C. Gordon
f7e53b25ae direct3d: Use D3DPOOL_DEFAULT for vertex buffers after all, release correctly.
Fixes Bugzilla #4679.
Fixes Bugzilla #4537.
2019-06-21 15:07:39 -04:00
Sam Lantinga
af46b86d33 Enable Raspberry Pi video by default 2019-06-21 10:58:30 -07:00
Cameron Gutman
f68723004a direct3d: Fix dirty textures failing to update
Even if the texture itself has not changed since last time, the data may have
so we must call UpdateDirtyTexture() to handle that possibility.
2019-06-20 19:51:00 -07:00
Sam Lantinga
dd94e4031d Fixed bug 4672 - Warnings in SDL_LogEvent() 2019-06-19 17:11:20 -07:00
Sam Lantinga
f36c6a4c04 Rolling back GameCube HIDAPI support
It causes the HIDAPI devices to always be opened on enumeration, which causes crashes in the Windows drivers when multiple applications are reading and writing at the same time. We can revisit this after 2.0.10 release.
2019-06-19 15:54:21 -07:00
Zack Middleton
6ceac6bc59 Handle GameCube WaveBird controller differences
Make wireless GameCube controllers use unknown power level instead of
wired and don't allow rumble (it doesn't have hardware for it).
2019-06-19 06:43:54 -07:00
Zack Middleton
130f27d59f Make GameCube controllers only rumble if both USB cables are connected
The Nintendo USB GameCube Adapter has two USB connectors. Black for data
and grey for additional power for rumble. The Wii U and other software
require both cables to use rumble. The rumble is weaker without the
second USB cable. Other than that I don't know if there is any negative
side affects from using rumble with only one cable.
2019-06-19 06:43:36 -07:00
Zack Middleton
3ebbdad9ba Fix GameCube controller power level being reset to unknown
HIDAPI_DriverGameCube_OpenJoystick() set power level to wired and then
it was set to unknown in SDL_JoystickOpen().
2019-06-19 06:43:04 -07:00
Sam Lantinga
53fc78ad46 Use SDL C runtime functions 2019-06-19 06:40:50 -07:00
Sylvain Becker
5ac3101d1e KMSDRM: fix inverted strcmp, remove useless if test (Bug 4624) 2019-06-19 10:11:38 +02:00
Sylvain Becker
1bf91c2b1c KMSDRM: fix compilation on linux, no d_namlen (Bug 4624) 2019-06-19 09:16:53 +02:00
Ryan C. Gordon
722b55525f wayland: Fixed C99-style variable declaration inside for-loop.
--HG--
extra : rebase_source : c167ae06ec50963308603d42c67d0582a394e0ec
2019-06-19 00:52:34 -04:00
Sam Lantinga
86fcba56a8 Fixed building DMG archive on Mac OS X 2019-06-18 21:50:57 -07:00
Ryan C. Gordon
79594b7263 opengl: Be more robust in failing cases.
Load all possible symbols, not just until one fails, in case they get used
during shutdown, etc.

Fixes Bugzilla #4093.

--HG--
extra : rebase_source : eb274afa860e5900a4e1a49b4c2815cfa4f86f33
2019-06-18 18:58:39 -04:00
Sam Lantinga
1eef5fc724 Only warp the mouse to set focus if we're definitely going into relative mode 2019-06-18 14:24:26 -07:00
Sam Lantinga
7d96a311c0 Fixed compiler warning 2019-06-18 14:24:24 -07:00
Sam Lantinga
ac43b01bf1 Fixed bug 4624 - KMS/DRM fails on FreeBSD because /dev/dri/card* nodes are symlinks
Jan Martin Mikkelsen

Patch to scan /dev/dri based on names rather than file type

Loading KMS/DRM on FreeBSD fails because the "available" code in the driver checks for character device nodes under /dev/dri and the /dev/dri/card* files are symlinks rather than device nodes nodes on FreeBSD. The symlink points to /dev/drm/0.

The attached patch counts /dev/dri/card* entries rather than directory entries which are character devices.
2019-06-18 14:15:10 -07:00
Ryan C. Gordon
8283e44c63 cocoa: Patched to compile and also handle possible malloc failure. 2019-06-18 16:53:49 -04:00
Sam Lantinga
cb0044cc7d Fixed potential double-free in mouse cleanup code 2019-06-18 13:41:38 -07:00
Sam Lantinga
2d5d813cd9 Fixed 4669 - Using the software SDL_Renderer on Android leads to GL errors & black screen when window resizes
Sylvain

I think what happening with the software renderer is:

* you're somehow in background (so texture creation is not possible)
* it resizes and wants to push a SDL_WINDOWEVENT_SIZE_CHANGED
It call:
https://hg.libsdl.org/SDL/file/45b56ed51919/src/render/SDL_render.c#l683
* GetOutputSize
* SW_GetOutputSize
* SW_ActivateRenderer
* SDL_GetWindowSurface
* SDL_CreateWindowFramebuffer which is mapped to SDL_CreateWindowTexture
and it ends up re-creating the surface/a texture, while being in background
2019-06-18 10:08:19 -07:00
Sylvain Becker
22700a93c3 Android: resize with software rendering, reverted again (Bug 4669) 2019-06-18 18:53:58 +02:00
Sylvain Becker
5e0cb53c28 Android: try to fix resize with software rendering (bug 4669) 2019-06-18 18:40:40 +02:00
Sylvain Becker
e82ac1f059 Android: revert commit SW_GetOutputSize, again (Bug 4669) 2019-06-18 18:22:18 +02:00
Sam Lantinga
900a682a92 Added a patch note about batched rendering 2019-06-18 08:35:31 -07:00
Sam Lantinga
a5ff497595 Added patch notes for 2.0.10 2019-06-18 07:55:30 -07:00
Sam Lantinga
973ced4ffe Make sure we haven't changed the size of the SDL_Event structure and broken binary compatibility. 2019-06-18 06:53:32 -07:00
Sylvain Becker
47c068debe Android: prevent ignoring surfaceChanged() in MultiWindow 2019-06-18 11:35:30 +02:00
Sylvain Becker
9b0781c5e0 Android: prevent using SW_GetOutputSize with software renderer (Bug 4669) 2019-06-18 10:41:11 +02:00
Sylvain Becker
ba509cc7d1 Android: revert previous commit (Bug 4669)
(Refs #1)
2019-06-18 10:23:19 +02:00
Sylvain Becker
6040d1f809 Fixed bug 4669: Android software renderer, black screen when window resizes
Using the software SDL_Renderer on Android leads to GL errors & black screen when window resizes
2019-06-17 22:31:36 +02:00
Sam Lantinga
6b7a50ec40 Removed extraneous fprintf() call 2019-06-17 11:10:20 -07:00
Sam Lantinga
a288bb0eca Updated version to 2.0.10 2019-06-17 10:13:28 -07:00
Sam Lantinga
b33ebe02d3 Fixed bug 4667 - Build errors on Linux when building without Threads support
Manuel Sabogal

There is an issue on the latest commit of the mercurial repo when SDL_THREADS_DISABLED is set:

src/core/linux/SDL_threadprio.c:79:28: error: unknown type name 'Sint64'; did you mean 'int'
2019-06-17 08:38:33 -07:00
Alex Szpakowski
faf508a095 Fix synthetically generated mouse events getting lost forever after the device orientation changes (or the window is otherwise resized) while a finger is touching the screen. 2019-06-16 14:10:30 -03:00
Alex Szpakowski
7903b02cde iOS: remove some code which could affect the state of UIViews that aren't owned by SDL.
It was originally added to work around an input event problem in the code of a specific app which mixed SDL and native UIViews, but that app solved its problems in a better manner since then.
2019-06-16 13:52:27 -03:00
Ryan C. Gordon
5d5c2d3c44 assert: Another attempt to quiet compiler warnings. 2019-06-14 22:29:13 -04:00
Ryan C. Gordon
171a98db60 assert: Possibly fixing compiler warning on Android. 2019-06-14 21:39:51 -04:00
Ryan C. Gordon
b642a170c7 cocoa: ignore compiler warnings about OpenGL being deprecated.
--HG--
extra : rebase_source : 03fdc2f8505ae6d664d46f82a58423b4170e256c
2019-06-14 21:18:53 -04:00
Ryan C. Gordon
9935079f99 A few minor changes to placate static analysis.
--HG--
extra : rebase_source : ef8116836b0d9d8e9f6e919221968d8c0d5844a6
2019-06-14 18:23:51 -04:00
Sam Lantinga
4fbcde6f13 Added support for Xbox and PS4 wireless controllers on iOS and tvOS
Also implemented SDL_JoystickGetDevicePlayerIndex() on iOS and tvOS, and added support for reading the new menu button state available in iOS and tvOS 13.
2019-06-14 13:56:52 -07:00
Sam Lantinga
1e112238be Worked around "Undefined symbol: ___isPlatformVersionAtLeast()" link error on Xcode 11 beta 2019-06-14 13:56:42 -07:00
Ryan C. Gordon
542a139882 audio: Attempt to fix build on ARM versions of Visual Studio. 2019-06-14 16:52:42 -04:00
Ryan C. Gordon
fce6b0efba audio: Fix ARM NEON audio converter bugs.
(Patch from Sylvain, I'm just applying it.)

Fixes Bugzilla #4186.
2019-06-14 15:52:48 -04:00
Ryan C. Gordon
c6bda24fa6 audio: patched to compile. 2019-06-14 15:47:32 -04:00
Ethan Lee
97b9dbbf09 Check src alignment for S32_to_F32 conversions 2019-06-14 09:51:22 -04:00
Ryan C. Gordon
fe2bef018f cocoa: Another attempt at synthesized mouse/touch events. 2019-06-13 21:31:03 -04:00
Ryan C. Gordon
5949bfe3ca cocoa: Revised synthesized mouse/touch event strategy.
I _think_ I understand what Sylvain is working on here now, so hopefully I
got this right.

Fixes Bugzilla #4576.

(I think!)
2019-06-13 01:57:13 -04:00
Alex Szpakowski
5e15950a40 macOS: Fix the coordinate space of SDL_GetDisplayUsableBounds (thanks Tim!)
Fixes bug #4518.
2019-06-12 19:57:30 -03:00
Alex Szpakowski
7a2672555d iOS: Remove didAddSubview override in NSWindow, its code breaks things which rely on focus changing within SDL's UIWindow (bug #4659). 2019-06-12 19:15:56 -03:00
Ryan C. Gordon
c168d7e714 wave: Fixed static analysis warning about dead assignment.
(technically, this function never returns an error at this point, but since
it _does_ have an "uhoh, is this corrupt data?" comment that it ignores, we
should probably make sure we handle error cases in the future.  :)  )
2019-06-12 15:43:08 -04:00
Ryan C. Gordon
40ba80fec2 vulkan: Fixed use-after-free bug. 2019-06-12 15:37:07 -04:00
Ryan C. Gordon
e6f2a420e7 assert: Fixed some compiler warnings. 2019-06-12 15:35:06 -04:00
Sam Lantinga
3837a1233c Better patch to make it more clear what's going on 2019-06-12 10:38:49 -07:00
Sam Lantinga
7bb3e6b87c The hat index passed to the application should be zero-based with no holes 2019-06-12 10:35:47 -07:00
Sam Lantinga
300437765f Fixed bug 4486 - Segfault when pressing a trigger on the Steam Controller (Linux)
Matteo Beniamino

Pressing a trigger button on a Steam Controller causes a segmentation fault both with stable version and latest mercurial head on Linux. I'm using the recent hid_steam kernel module with lizard_mode disabled (that is no keyboard/mouse emulation). I suspect this is what's happening: the driver exposes two hats. The two hats have indices 0 and 2. Inside linux/SDL_sysjoystick.c two hats are allocated in allocate_hatdata for joystick->hwdata->hats. In HandleHat function the hat parameter (that can be 2) is directly used as the index of the array that only has two elements, causing an out of bounds access. SDL is not expecting to have "holes" between hats indices.

The index 2 is calculated in HandleInputEvents() as (ABS_HAT2X - ABS_HAT0X) / 2 where ABS_HAT2X is the value associated to the hat inside the hid_steam module.
2019-06-12 10:32:36 -07:00
Sam Lantinga
d197c26349 Fixed bug 4665 - Add support for single touch evdev devices
Jan Martin Mikkelsen

The attached patch adds support for single-touch evdev devices.

These devices report ABS_X, ABS_Y and BTN_TOUCH events. This patch sets them up as MT devices with a single slot and handles the appropriate messages.
2019-06-12 07:55:48 -07:00
Sebastian Krzyszkowiak
173c6882cd wayland: HiDPI support 2019-06-12 00:55:05 +02:00
Ozkan Sezer
dcd3dc4c03 fix permissions 2019-06-12 13:56:20 +03:00
Sylvain Becker
9be0b70ee9 SDL_Wave: missing field 'length' initializer 2019-06-12 10:42:02 +02:00
Ryan C. Gordon
dc9780679d assert: mark SDL_ExitProcess as SDL_NORETURN again.
Put in a hack to (hopefully) make MingW happy.

Fixes Bugzilla #4100.

--HG--
extra : rebase_source : c40bcd9feb71b38c277d690e611d211b9f629a2b
2019-06-11 21:57:30 -04:00
Ryan C. Gordon
064b2d9818 cocoa: Backed out CVDisplayLink code for macOS vsync.
This was to deal with broken vsync support in macOS 10.14, which we assumed
would remain broken indefinitely, but a later 10.14 released fixed it.

This is a loss of late-swap support, but there are several subtle problems
in our CVDiplayLink code that are also evaporating, to be fair.

Fixes Bugzilla #4575.

(Backed out changeset 73f3ca85ac0e)

--HG--
extra : rebase_source : 0904a47668287aa612a5a5cb21e720d460b730f3
2019-06-11 16:19:01 -04:00
Sam Lantinga
13647c8935 Fixed bug 4615 - RPM Build fails due to unpackaged files
devbeer

The current SDL2.spec fails to build with:

Checking for unpackaged file(s): /usr/lib/rpm/check-files /tmp/build/rpmbuild/BUILDROOT/SDL2-2.0.9-2.x86_64
error: Installed (but unpackaged) file(s) found:
   /usr/lib64/cmake/SDL2/sdl2-config.cmake


RPM build errors:
    Installed (but unpackaged) file(s) found:
   /usr/lib64/cmake/SDL2/sdl2-config.cmake
2019-06-11 19:58:10 -07:00
Sam Lantinga
7982263c9c Fixed bug 4570 - Support Vulkan Portability rather than MoltenVK specifically
Dzmitry Malyshau

Current code, search paths, and error messages are written to only consider MoltenVK on macOS as a Vulkan Portability implementation. It's not the only implementation available to the users. gfx-portability [1] has been shown to run a number of titles well, including Dota2, Dolphin Emulator, and vkQuake3, often out-performing MoltenVK in frame rate and stability (see Dolphin benchmark [2]).

There is no reason for SDL to be that specific, it's not using any MVK-specific functions other than the WSI initialization ("VK_MVK_macos_surface"). gfx-portability exposes this extension as well, and a more generic WSI extension is in process. It would be good if SDL was written in a more generic way that expect a Vulkan Portability library as opposed to MoltenVK specifically.

[1] https://github.com/gfx-rs/portability
[2] https://gfx-rs.github.io/2019/03/22/dolphin-macos-performance.html
2019-06-11 18:13:46 -07:00
Ryan C. Gordon
37dd347b8b software: Fixed compiler warning and dos2unix'd the endlines. 2019-06-11 15:06:35 -04:00
Ryan C. Gordon
b432350fc9 software: Correctly track viewport and cliprect.
Fixes Bugzilla #4457.
2019-06-11 14:09:53 -04:00
Ryan C. Gordon
1bfe8fadc9 direct3d: Use D3DPOOL_MANAGED for vertex buffers.
Fixes Bugzilla #4537.
2019-06-11 13:02:56 -04:00
Sam Lantinga
5eff051a09 Fix build with the 10.10 SDK 2019-06-11 08:33:30 -07:00
Ryan C. Gordon
39f5a59c7e direct3d: Fixed SDL_RenderSetClipRect usage.
Fixes Bugzilla #4459.
2019-06-11 10:12:47 -04:00
Ryan C. Gordon
ad14c4654c direct3d: don't dereference bogus pointer if current texture was destroyed.
Fixes Bugzilla #4460.
2019-06-11 09:29:48 -04:00
Sylvain Becker
fcb3684025 Android: fix coordinates for Surface.ROTATION_180
https://discourse.libsdl.org/t/android-screen-orientation-issues-2-0-9/26262
2019-06-11 11:01:15 +02:00
Sylvain Becker
3a4db15e17 Android: revert wrong fix typo calling onBackPressed() (Bug 4657) 2019-06-11 10:19:26 +02:00
Ryan C. Gordon
c827b5db23 testoverlay2: Changed some C runtime calls to be SDL equivalents. 2019-06-11 02:32:43 -04:00
Ryan C. Gordon
6480984e0a direct3d: Fixed more compiler warnings on Visual Studio 64-bit builds. 2019-06-11 02:31:57 -04:00
Ryan C. Gordon
c753f01b69 video: fixed compiler warning on Visual Studio. 2019-06-11 02:14:59 -04:00
Ryan C. Gordon
76209ea774 windows: Don't let Visual Studio insert an implicit dependency on memset().
Fixes Bugzilla #4662.
2019-06-11 02:08:31 -04:00
Ryan C. Gordon
1fe85c6de8 windows: Drop WM_ACTIVATE when window is hidden, but only if being activated.
Fixes Bugzilla #4571.

--HG--
extra : amend_source : 89c8a4221e3f10b5c873c0a14cc6dc7ca11be20a
2019-06-11 01:14:24 -04:00
Sylvain Becker
fa9722ea01 Android: add MinimizeWindow function (Bug 4580, 4657)
shouldMinimizeOnFocusLoss is un-activated (return false)
2019-06-10 21:58:03 +02:00
Sylvain Becker
608dc4f6ce Android: fix typo calling onBackPressed() (Bug 4657) 2019-06-10 21:41:22 +02:00
Benjamin Valentin
27c86d94f6 Add mapping for Chinese-made Xbox Controller
This device is a copy of the Xbox Controller S and currently the one most sold
when shopping for a 'new' Xbox gamepad on eBay and AliExpress.
Except for the quirky USB ID id behaves just like a normal Xbox controller (when
ignoring the subpar build quality)
2019-03-17 23:47:12 +01:00
Sam Lantinga
8f0fea0f08 Fixed bug 4662 - SDL failed to build due to error LNK2019: unresolved external symbol _memset referenced in function _IMA_ADPCM_Decode with MSVC on Windows
LinGao

We build SDL with Visual studio 2017 compiler on Windows Server 2016, but it failed to build due to error LNK2019: unresolved external symbol _memset referenced in function _IMA_ADPCM_Decode on latest default branch. And we found that it can be first reproduced on a39d8cdf50f4 changeset. Could you please help have a look about this issue? Thanks in advance!
2019-06-10 08:49:26 -07:00
Sam Lantinga
b689dae897 Fixed bug 4641 - clang and clang-cl builds on windows create -Wpragma-pack warnings 2019-06-10 08:46:20 -07:00
Ryan C. Gordon
4cd26373d6 cocoa: report proper input IDs for mouse/touch events.
Otherwise, we generate incorrect mouse events for MacBook trackpads (which
are also multitouch devices), etc.

Partially fixes Bugzilla #4576.

--HG--
extra : rebase_source : 03dee8e7eca900c7995a90d0507c1a2325df55c4
2019-06-09 19:27:25 -04:00
Sam Lantinga
6c473135a3 Fixed bug 4658 - iOS 12 fullscreen flag and SDL_HINT_IOS_HIDE_HOME_INDICATOR not working
Caleb Cornett

On iOS 12, creating a window with the SDL_WINDOW_FULLSCREEN flag does not dim the home indicator or defer system gestures. The same goes for setting the SDL_HINT_IOS_HIDE_HOME_INDICATOR to "2" -- it has no effect at all.

I've tracked down the source of this misbehavior to a timing issue. The initial `setNeedsUpdate...` calls were happening too early and getting applied to the launch screen by mistake. In the attached patch, I've added a call to those functions right after the launch screen is hidden so that they apply to the main view controller instead. This appears to fix the issue, at least on my iPhone 6s Plus.
2019-06-09 14:08:18 -07:00
Ethan Lee
d7ef1c6933 Add notes for SDL_WinRTRunApp and SDL2-WinRTResources for non-C++ projects 2019-06-09 11:54:51 -04:00
Sam Lantinga
03746a249a Cleanup on bug 3894 - Fuzzing crashes for SDL_LoadWAV
Simon Hug

Attached is a minor cleanup patch. It changes the option name of one hint to something better, puts one or two more checks in, and adds explicit casting where warnings could appear otherwise.

I hope the naming of the hints and their options is acceptable. It would be kind of awkward to change them after they get released with an official SDL version.
2019-06-09 12:46:10 -07:00
Sam Lantinga
3eee84f9c3 Fixed compiler warning
warning C4018: '<' : signed/unsigned mismatch
2019-06-08 19:12:05 -07:00
Sam Lantinga
8981c38815 Fixed build 2019-06-08 19:09:43 -07:00
Sam Lantinga
6d795666a9 Fixed bug 3894 - Fuzzing crashes for SDL_LoadWAV
Simon Hug

I had a look at this and made some additions to SDL_wave.c.

The attached patch adds many checks and error messages. For some reason I also added A-law and µ-law decoders. Forgot exactly why... but hey, they're small.

The WAVE format is seriously underspecified (at least by the documents that are publicly available on the internet) and it's a shame Microsoft never put something better out there. The language used in them is so loose at times, it's not surprising the encoders and decoders behave very differently. The Windows Media Player doesn't even support MS ADPCM correctly.

The patch also adds some hints to make the decoder more strict at the cost of compatibility with weird WAVE files.

I still think it needs a bit of cleaning up (Not happy with the MultiplySize function. Don't like the name and other SDL code may want to use something like this too.) and some duplicated code may be folded together. It does work in this state and I have thrown all kinds of WAVE files at it. The AFL files also pass with it and some even play (obviously just noise). Crafty little fuzzer.

Any critique would be welcome. I have a fork of SDL with a audio-loadwav branch over here if someone wants to use the commenting feature of Bitbucket:

https://bitbucket.org/ChliHug/SDL

I also cobbled some Lua scripts together to create WAVE test files:

https://bitbucket.org/ChliHug/gendat
2019-06-08 19:02:42 -07:00
Sam Lantinga
747361d982 Fixed bug 4041 - Android, SDL_Renderer OpenGLES 1 is loading GLESv2 library
Sylvain

On Android, if you set no attribute using SDL_GL_SetAttribute(), and try to create a SDL Render OpenGLES 1:

- it loads first by default GLESv2 libraries
- creates the rendere OpenGLES 1
- recreates the Window to have a context 1.1 ( https://hg.libsdl.org/SDL/file/00fb5966c44f/src/render/opengles/SDL_render_gles.c#l298 )

But it doesn't unload libraries, then reload GLESv1 lib. So the SDL_Renderer OpenGLES 1 is working with GLES 2 libs, which seems inconsistent.


If you, at first, set
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 1);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);
It will correctly load GLES v1 libraries.

Here's a small patch to reload egl libs when SDL_RecreateWindow() is called.
It fixes the issue, also the case from bug 4042

( SDL_RecreateWindow() is used by SDL_Renderer gl, gles1, gles2. )
2019-06-08 18:40:11 -07:00
Sam Lantinga
badd09dfb5 Temporary fix for bug 4254 - a _lot_ of strict aliasing warnings
Ozkan Sezer

A horde of strict aliasing violation warnings are emitted from joystick
layer, and also from a few other places. This happens with gcc-4.4.7 on
Linux CentOS 6.10.  Some other sysjoystick would possibly have the same
warnings.

Attached my full log here. Example entry:
src/joystick/SDL_joystick.c: In function 'SDL_GetJoystickGUIDInfo':
src/joystick/SDL_joystick.c:1094: warning: dereferencing pointer '({anonymous})' does break strict-aliasing rules
2019-06-08 18:32:29 -07:00
Sam Lantinga
6cc3ac38aa Fixed bug 4294 - Audio: perform more validation on conversion request
janisozaur

There are many cases which are not able to be handled by SDL's audio conversion routines, including too low (negative) rate, too high rate (impossible to allocate).

This patch aims to report such issues early and handle others in a graceful manner. The "INT32_MAX / RESAMPLER_SAMPLES_PER_ZERO_CROSSING" value is the conservative approach in terms of what can _technically_ be supported, but its value is 4'194'303, or just shy of 4.2MHz. I highly doubt any sane person would use such rates, especially in SDL2, so I would like to drive this limit further down, but would need some assistance to do that, as doing so would have to introduce an arbitrary value. Are you OK with such approach? What would a good value be? Wikipedia (https://en.wikipedia.org/wiki/High-resolution_audio) lists 96kHz as the highest sampling rate in use, even if I quadruple it for a good measure, to 384kHz it's still an order of magnitude lower than 4MHz.
2019-06-08 18:22:18 -07:00
Sam Lantinga
e13b11ab00 CVE-2019-7578: Fix a buffer overread in InitIMA_ADPCM
If IMA ADPCM format chunk was too short, InitIMA_ADPCM() parsing it
could read past the end of chunk data. This patch fixes it.

CVE-2019-7578
https://bugzilla.libsdl.org/show_bug.cgi?id=4494

Signed-off-by: Petr Písař <ppisar@redhat.com>
2019-06-08 18:07:58 -07:00
Sam Lantinga
f86e93c579 Fixed bug 4526 - replace SDL_RW* macros with functions for using in bindings
ace

I got this bug in SDL_ttf:
https://bugzilla.libsdl.org/show_bug.cgi?id=4524
Sylvain proposed solution:
SDL_RWseek(RWops, 0, RW_SEEK_SET);

And it works, but i can use it my project, because it written in C# with SDL2-CS wrapper and there not export for macroses:
#define SDL_RWsize(ctx)         (ctx)->size(ctx)
#define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence)
#define SDL_RWtell(ctx)         (ctx)->seek(ctx, 0, RW_SEEK_CUR)
#define SDL_RWread(ctx, ptr, size, n)   (ctx)->read(ctx, ptr, size, n)
#define SDL_RWwrite(ctx, ptr, size, n)  (ctx)->write(ctx, ptr, size, n)
#define SDL_RWclose(ctx)        (ctx)->close(ctx)

Therefore, I suggest replacing this macros with functions so that they can be exported and used in bindings
2019-06-08 17:43:23 -07:00
Sam Lantinga
0f9fb9f312 Fixed bug 4533 - Update ANGLE to load d3dcompiler_47.dll instead of d3dcompiler_46.dll
msmshazan

Update ANGLE Libraries to support d3dcompiler_47.dll since chrome does not ship with d3dcompiler_46.dll and d3dcompiler_43.dll
2019-06-08 15:10:20 -07:00
Ethan Lee
3a12655881 cocoa: Fix assert to use SDL_assert 2019-03-04 12:16:43 -05:00
Sam Lantinga
41abc0637c Backed out Ben's chinese Xbox controller patch, as the generic catch-all for Xbox controllers should handle it. 2019-06-08 14:58:49 -07:00
Benjamin Valentin
43f9ad6e83 Add mapping for Chinese-made Xbox Controller
This device is a copy of the Xbox Controller S and currently the one most sold
when shopping for a 'new' Xbox gamepad on eBay and AliExpress.
Except for the quirky USB ID id behaves just like a normal Xbox controller (when
ignoring the subpar build quality)
2019-03-17 23:47:12 +01:00
Sam Lantinga
37e8ee2808 Fixed bug 4557 - SDL_SIMDAlloc and *Free should be in the public interface
Martin Gerhardy

These functions are really useful and should get exposed imo.
2019-06-08 14:54:37 -07:00
Sam Lantinga
94dbd89561 Fixed bug 4583 - PollAllValues appears to use an incorrect index for all axes above 0x18
Noam Preil

In src/joystick/linux/SDL_sysjoystick.c:

The ConfigJoystick function's axes detection starts with a for loop using an index i for Linux's axes names. When i gets to ABS_HAT0X, it's set to ABS_HAT3Y and a continue statement appears, to skip the hats. This makes sense, as SDL handles hats separately from axes.

However, in PollAllValues, *two* indices are used: a and b. Both start out the same, and remain so until the hats are reached. At that point, a becomes identical to the i from ConfigJoystick's loop, but b is equal to a - (ABS_HAT3Y - ABS_HAT0X), or a - 8.

While all the joystick->hwdata->abs_* structures in ConfigJoystick used i - which would here be a - as both the index and the ioctl argument, PollAllValues uses b for the structure index and a as the ioctl argument.

It would appear, however, that no joystick HAS such axes, and that the b index is entirely unnecessary.

I tested three separate joysticks, and while that was far from a complete listing, I was unable to find a joystick with an axis above 0x08.
2019-06-08 14:40:27 -07:00
Sam Lantinga
252adc0f0a Fixed bug 4593 - Respect CMake's BUILD_SHARED_LIBS default behavior
tschwinger

Respect the BUILD_SHARED_LIBS variable when defined, and build either shared or static libs, which is CMake's default behavior (See https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html).

If the variable is not defined, the current behavior remains unchanged and both variants are built where the platform supports it. This way, it remains possible to build both in one shot, which seems convenient for distro builds and useful to promote some consistency between them.
2019-06-08 14:36:03 -07:00
Sam Lantinga
f9cca459c8 Fixed bug 4594 - Fix install location of CMake targets on Apple platforms
tschwinger

Followup to #3651

As already noted by Ryan, no framework is being built, so we better install to lib/cmake.

That code was originally part of a patch submitted by David Demelier, whose credit BTW got lost (I combined his patch for #3572 with fixes for #2576 and #3613 resulting in #3651 because things started to depend on another).

I tested that the configuration files are found correctly in the new location on MacOS X based on a hint to the root (see https://cmake.org/cmake/help/latest/command/find_package.html#search-procedure).
2019-06-08 14:34:38 -07:00
Sam Lantinga
c1fc2cc1e5 Fixed bug 4600 - Dualshock 4 touchpad press is not detectable with SDL_JoystickGetButton
Dexter Friedman

When using a Dualshock 4 controller (model numbers CUH-ZCT1U and CUH-ZCT2U), pressing anywhere on the center touchpad does not send an SDL_JOYBUTTONDOWN event. I have verified this with testjoystick:

Repro steps:
1. Plug in a DS4 over USB
2. Compile testjoystick and run: testjoystick.exe 0
3. Press and hold the touchpad. Observe that no lime green box appears

Expected behavior:
A lime green box appears while the touchpad is pressed.

Notes:
I've attached a patch here that works on my PC and produces the expected behavior in testjoystick, for both DS4 model numbers I listed earlier.

If I understand correctly, by exposing this as a joystick button, the gamecontroller API mapping can be modified with a change to gamecontrollerdb.txt in the future.
2019-06-08 14:32:19 -07:00
Sam Lantinga
8c6947f3e5 Fixed bug 4603 - The iOS Test Xcode project file needs to add the metal framework
Dominik Reichardt

Similar to bug #4088 the iOS test suite needs the metal framework to link. Same linking error in the final linking phase.
2019-06-08 14:29:05 -07:00
Sam Lantinga
a35382ebce Fixed bug 4605 - WASAPI_WaitDevice hang
Matt Brocklehurst

We've noticed that if you are playing audio on Windows via the WASAPI interface and you unplug and reconnect the device a few times the program hangs.

We've debugged the problem down to

static void
WASAPI_WaitDevice(_THIS)
{

   ... snip ...
 if (WaitForSingleObjectEx(this->hidden->event, INFINITE, FALSE) == WAIT_OBJECT_0) {
   ... snip ...
}

This WaitForSingleObjectEx does not havbe a time out defined, so it hangs there forever.

Our suggested fix we found was to include a time out of say 200mSec

We have done quite a bit of testing with this fix in place on various hardware configurations and it seems to have resolved the issue.
2019-06-08 13:41:46 -07:00
Zack Middleton
2b3540e8f2 hidapi: Use GameCube adapter controller port for player index
The Nintendo USB GameCube adapter has four controller ports. Return
the port number as 0 to 3 from SDL_JoystickGetPlayerIndex() and
SDL_JoystickGetDevicePlayerIndex().
2019-06-08 13:36:59 -07:00
Cameron Cawley
d5cdd91525 riscos: Fix iconv warnings 2019-01-13 23:36:31 +00:00
Sam Lantinga
b7cdad1831 Fixed bug 4642 - Rework SDL_netbsdaudio to improve performance
Nia Alarie

The NetBSD audio driver has a few problems. Lots of obsolete code, and extremely bad performance and stuttering.

I have a patch in NetBSD's package system to improve it. This is my attempt to upstream it.

The changes include:

* Removing references to defines which are never used.
* Using the correct structures for playback and recording, previously they were the wrong way around.
* Using the correct types ('struct audio_prinfo' in contrast to 'audio_prinfo')
* Removing the use of non-blocking I/O, as suggested in #3177.
* Removing workarounds for driver bugs on systems that don't exist or use this driver any more.
* Removing all usage of SDL_Delay(1)
* Removing pointless use of AUDIO_INITINFO and tests that expect AUDIO_SETINFO to fail when it can't.

These changes bring its performance in line with the DSP audio driver.
2019-06-08 13:03:36 -07:00
Sam Lantinga
75d4ce77df Fixed bug 4443 - Incorrect scan code reported for numpad 5
bplu4t2f

When num lock is on, the scancode reported for numpad 5 is SDL_SCANCODE_KP_5, which is correct. However, when num lock is off, windows reports the VK_CLEAR virtual key code, which is incorrectly translated into SDL_SCANCODE_CLEAR inside of the VKeytoScancode(WPARAM vkey) function.
2019-06-08 10:47:43 -07:00
Cameron Gutman
397bf7158d Ignore Xbox One S gamepads with older firmware in HIDAPI
This older firmware had a different HID report style that we don't support.
2019-04-30 20:37:49 -07:00
Sam Lantinga
1ebaa25ce8 Fixed Android build warning 2019-06-08 10:23:52 -07:00
Sam Lantinga
53c7444aff OpenSL ES audio cleanup and added a note with low latency audio discussion 2019-06-08 10:21:38 -07:00
Sam Lantinga
4218bbe052 Fixed surround sound channel setup for Android OpenSL ES audio driver 2019-06-07 15:09:15 -07:00
Sam Lantinga
7a40efae86 Protect against NULL device in the Android hidapi implementation 2019-06-07 09:00:26 -07:00
Sam Lantinga
5a8cfeff3d Potential fix for a crash we're seeing on Android that should in theory never happen. 2019-06-07 09:00:24 -07:00
Sam Lantinga
8a883702e8 Added support for the Rotor Riot gamepad, and upcoming Xbox and PS4 controller support on iOS and tvOS
Patch contributed by Nat Brown
2019-06-06 08:20:53 -07:00
Sam Lantinga
646f7d2b3a Fixed bug 4655 - evdev is available on FreeBSD, check in 'configure' limited to Linux
Jan Martin Mikkelsen

The evdev interface is available on FreeBSD, with the xf86-input-evdev for include files in /usr/local/include/linux, so <linux/input.h> works, or when build with the native evdev option, where <dev/evdev/input.h> is available.
2019-06-05 12:03:45 -07:00
Sam Lantinga
3aa03480db Use SDL sized types 2019-06-05 12:01:26 -07:00
Sam Lantinga
a170be9ebe Fixed bug 4656 - SDL_evdev.c uses Linux specific integer types
Jan Martin Mikkelsen

The file src/core/linux/SDL_evdev.c uses the Linux specific types __u32 and __s32. This breaks things on FreeBSD when building with evdev.
2019-06-05 08:54:07 -07:00
Sam Lantinga
6c8016eaf7 Fixed bug 4171 - SDL_GetQueuedAudioSize is broken with WASAPI
Cameron Gutman

I was trying to use SDL_GetQueuedAudioSize() to ensure my audio latency didn't get too high while streaming data in from the network. If I get more than N frames of audio queued, I know that the network is giving me more data than I can play and I need to drop some to keep latency low.

This doesn't work well on WASAPI out of the box, due to the addition of GetPendingBytes() to the amount of queued data. As a terrible hack, I loop 100 times calling SDL_Delay(10) and SDL_GetQueuedAudioSize() before I ever call SDL_QueueAudio() to get a "baseline" amount that I then subtract from SDL_GetQueuedAudioSize() later. However, because this value isn't actually a constant, this hack can cause SDL_GetQueuedAudioSize() - baselineSize to be < 0. This means I have no accurate way of determining how much data is actually queued in SDL's audio buffer queue.

The SDL_GetQueuedAudioSize() documentation says: "This is the number of bytes that have been queued for playback with SDL_QueueAudio(), but have not yet been sent to the hardware." Yet, SDL_GetQueuedAudioSize() returns > 0 value when SDL_QueueAudio() has never been called.

Based on that documentation, I believe the current behavior contradicts the documented behavior of this function and should be changed in line with Boris's patch.

I understand that exposing the IAudioClient::GetCurrentPadding() value is useful, but a solution there needs to take into account what of that data is silence inserted by SDL and what is actual data queued by the user with SDL_QueueAudio(). Until that happens, I think the best approach is to remove the GetPendingBytes() call until SDL is able to keep track of queued data to make sense of it. This would make SDL_GetQueuedAudioSize() possible to use accurately with WASAPI.
2019-06-04 17:32:15 -07:00
Ryan C. Gordon
3d85deba6b test: unify all the command line usage logging.
--HG--
extra : rebase_source : dd9a05d9ee69ae14e8462bee898c5df4e372424b
2019-05-28 17:39:13 -04:00
Alex Szpakowski
eebad73d2f iOS: return SDL_GetWindowSize from SDL_GL_GetDrawableSize if there's no GLES view in the window (matches the behaviour of SDL_GL_GetDrawableSize on other platforms). Addresses bug #4629. 2019-05-26 18:53:36 -03:00
Sam Lantinga
2a7ab1ac16 Added a function to get the current Android SDK version at runtime 2019-05-23 14:19:00 -07:00
Sam Lantinga
1a7a3ae6ba Use the OpenSL ES audio driver by default on Android, as it has the lowest latency. 2019-05-23 13:47:30 -07:00
Sam Lantinga
8d824a7bdb Fixed static and buzzing when trying to use floating point audio on the OpenSL ES audio driver. 2019-05-23 13:47:27 -07:00
Sam Lantinga
64101f5c09 Return an error if both mouse relative mode and mouse warping are unavailable, instead of asserting. 2019-05-23 11:32:36 -07:00
Sam Lantinga
a5f7e64dd3 Fixed hiding the Android virtual keyboard when the return key is pressed 2019-05-23 11:05:43 -07:00
Sylvain Becker
417eeb55b6 Android: minimum size for IME, so that it takes focus
In API 28, 0 width views can't take focus, so if someone tries to position the IME without setting a width, they'll stop getting text events.

Tested on Android 9: with a 0 size, it would send correctly letters a, b, c, etc. but not numbers.
2019-05-23 09:08:40 +02:00
Sam Lantinga
4d1a66bc9a Improved iOS Bluetooth keyboard support
* Don't stop text input after the return key is pressed
* Handle arrow and escape keys
2019-05-22 17:39:51 -07:00
Sam Lantinga
0ece0e936d Fixed bug 4639 - CMake build does not generate libhidapi.so for Android
Manuel Sabogal

I noticed that the current Android.mk builds a libhidapi.so library for Android but the CMake build hasn't been updated to do so. I'll attach a patch that fixes this issue.
2019-05-21 17:33:31 -07:00
Cameron Gutman
7c72111e48 Fix use-after-free when pumping the event loop after SDL_DestroyWindow()
Closing the window is asynchronous, but we free the window data immediately,
so we can get an updateLayer callback before the window is really destroyed which
will cause us to access the freed memory.

Clearing the content view will cause it to be immediately released, so no further
updateLayer callbacks will occur.
2019-04-28 17:37:49 -07:00
Sam Lantinga
d6cd568cbb Added support for Bluetooth keyboards on iOS
In this case the keyboard is shown and immediately hidden, but we still want to accept text input
2019-05-20 14:31:03 -07:00
Sam Lantinga
bff24524aa Fixed mouse focus for touch events on iOS 2019-05-20 14:08:35 -07:00
Ryan C. Gordon
0d85e34204 vulkan: Swapped out a free() that should have been an SDL_free().
Fixes (for real this time!) the Visual Studio builds.
2019-05-20 00:41:18 -04:00
Ryan C. Gordon
fdc5505560 vulkan: Patched to compile on Visual Studio. 2019-05-19 23:29:50 -04:00
Ryan C. Gordon
0a0838b805 Patched to compile in C89 mode. 2019-05-19 20:25:02 -04:00
Sam Lantinga
2c68d6325e Fixed bug 4474 - Add support for an ASUS Gamepad variation
Trent Gamblin

This patch adds a variation of the ASUS Gamepad to the game controller DB. All the values are the same except the GUID.
2019-05-19 12:06:58 -07:00
Sam Lantinga
4ad10528f2 Fixed bug 4469 - make SDL_CreateTextureFromSurface pick a more appropriate format
Sylvain

Currently SDL_CreateTextureFromSurface picks first valid format, and do a conversion.

    format = renderer->info.texture_formats[0];
    for (i = 0; i < renderer->info.num_texture_formats; ++i) {
        if (!SDL_ISPIXELFORMAT_FOURCC(renderer->info.texture_formats[i]) &&
            SDL_ISPIXELFORMAT_ALPHA(renderer->info.texture_formats[i]) == needAlpha) {
            format = renderer->info.texture_formats[i];
            break;

It could try to find a better format, for instance :

 if SDL_Surface has no Amask, but a colorkey :
   if surface fmt is RGB888, try to pick ARGB8888 renderer fmt
   if surface fmt is BGR888, try to pick ABGR8888 renderer fmt
 else
   try to pick the same renderer format as surface fmt

if no format has been picked, use the fallback.


I think it goes with bug 4290 fastpath BlitNtoN
when you expand a surface with pixel format of size 24 to 32, there is a fast path possible.


So with this issue:

- if you have a surface with colorkey (RGB or BGR, not palette), it takes a renderer format where the conversion is faster.
  (it avoids, if possible, RGB -> ABGR which means switching RGB to BGR)

- if you have a surface ABGR format, it try to take the ABGR from the renderer.
  (it avoids, if possible, ABGR -> ARGB, which means switch RGB to BGR)
2019-05-19 12:04:06 -07:00
Sam Lantinga
dca2cd0383 Fixed bug 4436 - [OpenBSD] fix D-pad
Thomas Frohwein

Hi,

If a gamepad lists the Dpad as 4 buttons (Dpad Up,Down, Left, Right) like with the Xbox 360 gamepad / XInput report descriptor used by OpenBSD (https://github.com/openbsd/src/blob/master/sys/dev/usb/uhid_rdesc.h#L184), this is not recognized by the SDL BSD backend and no hat or any other listing for the D-pad exists, e.g. in sdl2-jstest (https://gitlab.com/sdl-jstest/sdl-jstest).

The attached diff fixes this and makes the D-pad on my Xbox 360 and Logitech F310 controllers usable. It adds a hat to nhats when usage HUG_DPAD_UP is found, reads the state of the D-pad buttons into array dpad[], and turns the value of dpad[] into an SDL hat direction (dpad_to_sdl()).

Tested and works with Xbox 360 controller and Logitech F310 in XInput mode. Software-side tested with sdl2-jstest and Owlboy where this worked without problems or regressions.

I don't know if this would be applicable to other *BSDs and don't have an install to test it with, therefore wrapped it in __OpenBSD__ ifdefs.

Thanks,

thfr
2019-05-19 11:56:26 -07:00
Serhii Charykov
f39fcaf980 Fix WORKING_DIR parameter 2018-12-03 20:14:35 +02:00
Sam Lantinga
16333a90c1 Fixed bug 4401 - SDL_GetWindowPosition() wrong after SDL_SetWindowPosition() until window is moved on macOS
Removed incorrect call to SDL_SendWindowEvent(window, SDL_WINDOWEVENT_MOVED, x, y);
If the position of the window isn't adjusted in the SetWindowPosition() call, then sending the window event would have no effect because x and y equals the window x and y. If the position of the window is adjusted in the SetWindowPosition() call, then we don't want to clobber it with values that the user passed in.
2019-05-19 11:52:25 -07:00
Sam Lantinga
322af82c04 Fixed bug 4025 - SDL_Renderer OpenGL : add support for textures ABGR, RGB, BGR
Sylvain

OpenGLES2 SDL renderer has support for textures ARGB, ABGR, RGB and BGR, whereas OpenGL SDL renderer only had ARGB.

If you think it's worth adding it, here's a patch. I quickly tried and it worked, but there may be missing things or corner case.
2019-05-19 11:01:36 -07:00
Sam Lantinga
56fb49c9af Fixed bug 3911 - SYSWM generic X11 events missing event data
Andrei Drexler

For X11 GenericEvents, the associated data is only available between a call to XGetEventData and the matching XFreeEventData, i.e. in X11_HandleGenericEvent. Trying to call XGetEventData a second time on the same event will fail, so an application that wants to inspect XInput2 events (e.g. for stylus pressure) has no way of retrieving its data from queued SYSWM events.

The attached patch (based on SDL-2.0.7-11629) sends SYSWM messages from X11_HandleGenericEvent while the data is still available, allowing client code to register an event filter/watcher and process the event inside the callback.
2019-05-19 10:44:14 -07:00
"Wladimir J. van der Laan"
f824828427 video: Add Vulkan support for vivante fb
Vivante drivers use the VK_KHR_display extension for rendering directly
to the frame buffer. This patch adds support to the video driver for
Vulkan rendering using that method.

- Add an utility function SDL_Vulkan_Display_CreateSurface that creates
a surface using this extension. The display to use (if there are
multiple) can be overridden using the environment variable
"SDL_VULKAN_DISPLAY".

- Use this function in a new compilation unit SDL_vivantevideo.c,
which implements the SDL_VIDEO_VULKAN methods of the driver structure.
2019-05-19 10:36:44 -07:00
Ryan C. Gordon
7e89e2dcd4 test: added SDLTest_CommonDefaultArgs()
This is for test apps that don't need custom command line arguments; it lets
us reduce the boilerplate code a tiny bit.
2019-05-19 01:45:15 -04:00
Ryan C. Gordon
86819b840e test: configure/make shouldn't build GL/GLES1/GLES2 programs if unsupported.
--HG--
extra : rebase_source : d9c00eb8bec76420696cd6c107109ec47f205b85
2019-05-18 23:47:57 -04:00
Sam Lantinga
4b1691765d Windows are not in a minimized state when they are shown
This fixes https://github.com/ValveSoftware/steam-for-linux/issues/4313
"Exiting game a in Steam Big Picture Mode gets semi-windowed BPM"
2019-05-15 14:01:15 -07:00
Sam Lantinga
d3f8626247 [SDL] iOS fix bug with audio interrupted by a phone call not restoring. 2019-05-14 14:20:54 -07:00
Sam Lantinga
d3d41ffc44 [SDL] ios Touch Fix. 2019-05-14 07:55:42 -07:00
Ryan C. Gordon
93f4fb503c Patched to compile. 2019-05-11 12:41:21 -04:00
Charlie Birks
36bc67cf2a Emscripten: Use EMSCRIPTEN_EVENT_TARGET_* 2019-05-09 12:09:45 +01:00
Charlie Birks
6715912ca3 Emscripten: Switch from canvas[XY] to target[XY]
Allows mouse/touch events to work on non-default canvases
2019-05-09 12:09:40 +01:00
Charlie Birks
e7bc640ec4 Emscripten: Store canvas id in WindowData
Also replace all hardcoded uses of "#canvas" or NULL
2019-05-09 12:09:34 +01:00
Sam Lantinga
efee635e24 Fixed bug 4608 - Android: not getting SDL_WINDOWEVENT_FOCUS_GAINED on start of our app
Dan Ginsburg

I've seen this on several devices including Moto Z running Android 7 and a Snapdragon 845 running Android 9.

What happens is as follows:

SDLActivity.onWindowFocusChanged(true) happens pretty early on, but it's before we've done SDL_CreateWindow and so Android_Window is 0x0 thus this message does not get sent:

JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeFocusChanged)(
                                    JNIEnv *env, jclass cls, jboolean hasFocus)
{
    SDL_LockMutex(Android_ActivityMutex);

    if (Android_Window) {
        __android_log_print(ANDROID_LOG_VERBOSE, "SDL", "nativeFocusChanged()");
        SDL_SendWindowEvent(Android_Window, (hasFocus ? SDL_WINDOWEVENT_FOCUS_GAINED : SDL_WINDOWEVENT_FOCUS_LOST), 0, 0);
    }

    SDL_UnlockMutex(Android_ActivityMutex);
}

When the window does get created, in Android_CreateWindow it does this:

 window->flags &= ~SDL_WINDOW_RESIZABLE;     /* window is NEVER resizeable */
    window->flags &= ~SDL_WINDOW_HIDDEN;
    window->flags |= SDL_WINDOW_SHOWN;          /* only one window on Android */
    window->flags |= SDL_WINDOW_INPUT_FOCUS;    /* always has input focus */

    /* One window, it always has focus */
    SDL_SetMouseFocus(window);
    SDL_SetKeyboardFocus(window);

The SDL_SetKeyboardFocus does send an SDL_WINDOWEVENT_FOCUS_GAINED message, but it gets eaten in SDL_SendWindowEvent because we've forced SDL_WINDOW_INPUT_FOCUS beforehand:

 case SDL_WINDOWEVENT_FOCUS_GAINED:
        if (window->flags & SDL_WINDOW_INPUT_FOCUS) {
            return 0;
        }
        window->flags |= SDL_WINDOW_INPUT_FOCUS;
        SDL_OnWindowFocusGained(window);
        break;

I can fix the problem if I comment out this line from Android_CreateWindow:

    window->flags |= SDL_WINDOW_INPUT_FOCUS;    /* always has input focus */

I would propose that as a fix unless there is a reason not to.
2019-04-25 14:17:07 -07:00
Sam Lantinga
e1571a9923 Fixed bug 4566 - Hot-plugging Bluetooth controller causes force-quit on Android
Anthony @ POW Games

I tried adding different configChanges and sure enough, "navigation" worked! Now bluetooth controllers hot-plug nicely. So shall we add it as a default to the AndroidManifest.xml?

Funny that this is how this activity is described:

	"navigation" The navigation type (trackball/dpad) has changed. (This should never normally happen.)

I think the reason behind this is because the bluetooth game controller I was testing doubles-up as a keyboard, which probably comes with a DPAD? It's a MOCUTE-032X_B63-88CE
2019-04-24 12:53:15 -07:00
Sam Lantinga
ec88d33573 Don't redefine __SSE__ and related macros if they're already defined 2019-04-23 16:57:34 -07:00
Sam Lantinga
1b77525040 Change my previous fix based on feedback from dev @saml 2019-04-23 14:08:14 -07:00
Sam Lantinga
8227163786 Created Xcode schemes for building on iOS and tvOS 2019-04-23 14:08:09 -07:00
Sam Lantinga
597de77bf3 Fix compile errors I hit when building org.libsdl in source2 (part 2 of 2) @saml 2019-04-23 12:59:28 -07:00
Sam Lantinga
e117f3c8fa Fix compile errors I hit when building org.libsdl in source2 (part 1 of 2) 2019-04-23 12:59:20 -07:00
Sam Lantinga
0f77e6c119 Use _Exit() when available 2019-04-23 07:59:31 -07:00
Hugh McMaster
da3ddaf8fa Add a configure option allowing users to choose whether to install sdl2-config
sdl2-config is installed by default if no flag is specified.
2019-04-07 23:01:07 +10:00
Sylvain Becker
2ae3c2cc55 Android: add static variable initialization in non blocking event loop 2019-04-23 14:24:58 +02:00
Sam Lantinga
d3bb4f2da6 Added a helper function to tell whether or not a window can be minimized 2019-04-22 16:34:42 -07:00
Sam Lantinga
66f65d77f5 Only leave fullscreen mode if we're actually going to minimize 2019-04-22 16:25:49 -07:00
Sam Lantinga
3524165d24 Fixed bug 4580 - Android 8: immersive fullscreen notification causes flickering between fullscreen and non-fullscreen and app is unresponsive
Sylvain 2019-04-18 21:22:59 UTC

Changes:
- SDL_WINDOWEVENT_FOCUS_GAINED and SDL_WINDOWEVENT_FOCUS_LOST are sent when the java method onWindowFocusChanged() is called.

- If we have support for MultiWindow (eg API >= 24), SDL event loop is blocked/un-blocked (or simply egl-backed-up or not), when java onStart()/onStop() are called.

- If not, this behaves like now, SDL event loop is blocked/un-blocked when onPause()/onResume() are called.

So if we have two app on screen and switch from one to the other, only FOCUS events are sent (and onPause()/onResume() are called but empty. onStart()/onStop() are not called).
The SDL app, un-focused, would still continue to run and display frames (currently the App would be displayed, but paused).
Like a video player app or a chronometer that would still be refreshed, even if the window hasn't the focus.
It should work also on ChromeBooks (not tested), with two apps opened at the same time.


I am not sure this fix Dan's issue. Because focus lost event triggers Minimize function (which BTW is not provided on android).
https://hg.libsdl.org/SDL/file/8703488687ca/src/video/SDL_video.c#l2653
https://hg.libsdl.org/SDL/file/8703488687ca/src/video/SDL_video.c#l2634

So, in addition, it would need to add by default SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS to 0.
So that the lost focus event doesn't try to minimize the window. And this should fix also the issue.
2019-04-22 16:19:52 -07:00
Ryan C. Gordon
7057d3fa91 configure: Cleaned up audio/video summaries when building for Windows. 2019-04-21 21:34:14 -04:00
Alex Szpakowski
930c7c8632 iOS: Remove code trying to support compilation on the iOS 7 SDK, the deployment target has been set to iOS 8 for years and there's other unconditionally compiled code that depends on newer SDKs so that code is useless. 2019-04-17 20:41:05 -03:00
Alex Szpakowski
022c7f0ac5 macOS: Fix compilation when using the 10.9 SDK or older. 2019-04-17 20:14:40 -03:00
Sam Lantinga
10186659df Explicitly load hidapi as a dependency of the SDL library
This fixes loading on Android 4.2
2019-04-16 20:00:14 -07:00
Ethan Lee
4d0dd1384b hidapi: Add GCN L/R buttons, just in case someone wants them... 2019-03-17 12:36:40 -04:00
Sylvain Becker
7a8bcac27b Android: when event loop is not blocking in pause, backup EGL context (Bug 4578)
Backup the EGL context when SDL_APP_DIDENTERBACKGROUND has been removed from the
event queue.
2019-04-12 23:15:26 +02:00
Alex Szpakowski
d82ed4186e Fix disabling OpenGL vsync on macOS 10.14.4+ (bug #4575). 2019-04-10 22:30:58 -03:00
Sylvain Becker
60832b7b71 Fixed bug 4581 - generate synthetic mouse events at window boundaries
when real touch events are actually outside the window.
2019-04-10 10:59:53 +02:00
Sylvain Becker
98eeaf9bc5 Fixed bug 4581 - mouse events with SDL_TOUCH_MOUSEID make window lost focus
Virtual mouse events should never leave the window or change focus for single window applications.
2019-04-08 21:27:24 +02:00
Sylvain Becker
9e9ef0bf36 Fixed bug 4582 - Maximize/Resize not working on Windows 10
When viewport is set, projectionAndView changes, but ID3D11DeviceContext_UpdateSubresource was not called.
2019-04-08 13:43:48 +02:00
Sylvain Becker
ad0b1b7b34 SDL_HINT_MOUSE_TOUCH_EVENTS: move tracking appart in case of 'window' is null 2019-04-06 21:52:51 +02:00
Sylvain Becker
7e59dbabda Bug 4581: move tracking appart so it doesn't require the window to have focus 2019-04-06 21:43:16 +02:00
Sam Lantinga
173b3a5113 Fixed bug 4579 - SDL_android.c s_active not being atomic
Isaias Brunet

This bug cause a false assert due to multiple threads modifying the same variable without any atomic operation.
2019-04-05 08:15:01 -07:00
Sam Lantinga
973c06f2a5 Set SDL_HINT_MOUSE_TOUCH_EVENTS for iPhone and iPad as well 2019-04-05 08:10:12 -07:00
Sam Lantinga
c9a297db4f https://bugzilla.libsdl.org/show_bug.cgi?id=4577
SDL_GetWindowDisplayMode was returning an incorrect result on iPhone Plus devices (tested on iOS 12.1/12.2).  The problem was that the value returned by UIScreenMode was assumed to be the physical pixels on the display, rather than the scaled retina pixels.  The fix is to use the scale returned by UIScreen.scale rather than the nativeScale.
2019-04-05 07:51:11 -07:00
Sylvain Becker
102108aea3 Android: add hint SDL_HINT_ANDROID_BLOCK_ON_PAUSE
to set whether the event loop will block itself when the app is paused.
2019-04-05 09:16:30 +02:00
Sylvain Becker
cbc5a31a9f Android: default SDL_HINT_MOUSE_TOUCH_EVENTS to 1 as previous behaviour 2019-04-05 08:36:31 +02:00
Sylvain Becker
a86fca805f Update WhatsNew.txt 2019-04-04 20:24:22 +02:00
Sylvain Becker
b8d46cbace Update WhatsNew.txt 2019-04-04 20:10:55 +02:00
Sylvain Becker
e20e39b3d9 Android: remove SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH
java layer runs as if separate mouse and touch was 1,
Use SDL_HINT_MOUSE_TOUCH_EVENTS and SDL_HINT_TOUCH_MOUSE_EVENTS
for generating synthetic touch/mouse events
2019-04-04 17:01:02 +02:00
Sylvain Becker
1d1eceb6ab Add hint SDL_HINT_MOUSE_TOUCH_EVENTS for mouse events to generate touch events
controlling whether mouse events should generate synthetic touch events
By default SDL will *not* generate touch events for mouse events
2019-04-04 16:51:50 +02:00
Sylvain Becker
d16648f8ce Bug 4576: track both FingerId and TrackId 2019-04-04 15:19:00 +02:00
Sylvain Becker
066a2112b3 Bug 4576: fix wrong scaling 2019-04-03 10:14:42 +02:00
Sylvain Becker
46212a1fa2 Bug 4576: one more warning 2019-04-02 18:07:27 +02:00
Sylvain Becker
9fc58c044c Bug 4576: fix warning and compile 2019-04-02 17:57:27 +02:00
Sylvain Becker
489c8573c2 Bug 4576: remove touch/mouse duplication for Android 2019-04-02 17:23:55 +02:00
Sylvain Becker
fb49e85bf6 Bug 4576: remove touch/mouse duplication for IOS 2019-04-02 17:18:47 +02:00
Sylvain Becker
d29be58504 Bug 4576: remove touch/mouse duplication for WinRT 2019-04-02 17:13:22 +02:00
Sylvain Becker
9e69244d5d Bug 4576: remove touch/mouse duplication for Emscripten 2019-04-02 17:10:29 +02:00
Sylvain Becker
e8431d6d53 Bug 4576: remove touch/mouse duplication for Wayland 2019-04-02 17:07:54 +02:00
Sylvain Becker
a25d2bcfc5 Bug 4576: remove touch/mouse duplication for linux/EVDEV 2019-04-02 17:03:58 +02:00
Sylvain Becker
2c8b5f513a Bug 4576: remove touch/mouse duplication for Windows 2019-04-02 16:58:11 +02:00
Sylvain Becker
fb5d1a1602 Bug 4576: handle mapping of TouchEvents to MouseEvents at higher level 2019-04-02 16:46:17 +02:00
Sam Lantinga
0b8f778883 configure.in: Rename configure.ac to fix an 'aclocal' warning
--HG--
rename : test/configure.in => test/configure.ac
2019-04-02 05:31:08 -07:00
Hugh McMaster
acdce30bc5 docs: Replace references to configure.in with configure.ac 2019-03-27 20:58:33 +11:00
Hugh McMaster
f386148e47 configure.in: Rename to configure.ac to fix an 'aclocal' warning
Also rename references in related files.
2019-03-25 23:01:32 +11:00
Sam Lantinga
98db267344 Handle potentially calling SDL_JoystickUpdate() and SDL_JoystickQuit() at the same time. 2019-03-27 08:17:05 -07:00
Ryan C. Gordon
cc94b3330b coreaudio: Set audio callback thread priority.
Fixes Bugzilla #4155.
2019-03-25 12:59:30 -04:00
Ryan C. Gordon
5f18108aec Backed out changeset ffd52bb02bcc
This was meant to migrate CoreAudio onto the same SDL_RunAudio() path that
most other audio drivers are on, but it introduced a bug because it doesn't
deal with dropped audio buffers...and fixing that properly just introduces
latency.

I might revisit this later, perhaps by reworking SDL_RunAudio to allow for
this sort of API better, or redesigning the whole subsystem or something, I
don't know. I'm not super-thrilled that this has to exist outside of the usual
codepaths, though.

Fixes Bugzilla #4481.
2019-03-25 12:24:38 -04:00
Ryan C. Gordon
abdc48613d opengles2: Fix static analysis warning.
Not clear if this could ever dereference NULL in real life, but better safe
than sorry!
2019-03-21 10:39:49 -04:00
Sam Lantinga
b1b373cac7 Hopefully fixed the mingw32 build 2019-03-19 17:20:54 -07:00
Sam Lantinga
3fdd9cc679 Fixed Visual Studio build 2019-03-19 17:05:22 -07:00
Sam Lantinga
3d95e53a1d Didn't need to add SDL_windows.h include, that was already included 2019-03-19 16:53:55 -07:00
Sam Lantinga
2085fa0bd7 Fixed Windows RT build 2019-03-19 16:52:09 -07:00
Sam Lantinga
1012683362 Fixed archiving the SDL dynamic library on iOS and tvOS 2019-03-19 11:02:43 -07:00
Sam Lantinga
0a821ec9ae Fixed building with C++ 2019-03-19 10:59:41 -07:00
Sam Lantinga
25398bff28 Fixed building with C++ 2019-03-19 10:56:46 -07:00
Sam Lantinga
eb84b8f20c Fixed declaration of SDL_main_func for C++ 2019-03-19 08:29:34 -07:00
Sam Lantinga
77b8382c1f Added support for building SDL as a dynamic library on tvOS 2019-03-19 07:53:39 -07:00
Sam Lantinga
597d8d450b Added support for building SDL as a dynamic library on iOS 2019-03-19 07:53:33 -07:00
Ryan C. Gordon
7da64b962d testgesture: Make the background gray.
This is so you can see it on systems that have a minimal window manager and
a black background.
2019-03-17 12:45:19 -04:00
Sam Lantinga
993d589b2d Fixed Visual Studio build 2019-03-16 19:46:37 -07:00
Sam Lantinga
d078f4d1aa Fixed iOS build 2019-03-16 19:46:27 -07:00
Sam Lantinga
0e6e04a833 Fixed Mac OS X build 2019-03-16 19:44:04 -07:00
Sam Lantinga
6f8f79f648 Fixed configure error if pkg modules aren't available 2019-03-16 19:32:59 -07:00
Sebastian Krzyszkowiak
fac19b06bb emscripten: force resize event when pixel ratio changes
Without this, applications can't react to changed canvas size on window zoom.
2019-03-16 19:08:59 -07:00
Sam Lantinga
4542d16cbf Fixed bug 4450 - SDL_mouse.c fails to compile with CMake generated Visual Studio files if SDL_VIDEO_VULKAN 0/undefined
Max Waine

SDL_mouse.c, if compiled for Windows, requires GetDoubleClickTime to compile (available from winuser.h). Without Vulkan present this fails to compile as the include chain for winuser.h is the following.

SDL_mouse.c -> SDL_sysvideo.h -> SDL_vulkan_internal.h -> SDL_windows.h -> windows.h -> winuser.h.
Problem is that SDL_vulkan_internal.h doesn't include SDL_windows.h if Vulkan isn't present, so under MinGW/GCC it will give a -Wimplicit-function-declaration warning for GetDoubleClickTime, and under MSVC fails to compile completely.

The solution to this would be to simplify the include chain: including SDL_windows.h under the same condition as GetDoubleClickTime (#ifdef __WIN32__) in SDL_mouse.c (or another file that isn't quite so indirectly included).
2019-03-16 19:07:34 -07:00
Sam Lantinga
7dc21399a0 Fixed bug 4511 - SDL_gamecontrollerdb Mapping for Sony Playstation USB controller
Renaud Lepage

Simply submitting a new mapping.
2019-03-16 19:03:13 -07:00
Silent
2a2ccad040 Fixed DualShock 3 mapping 2019-02-14 20:46:58 +01:00
Sam Lantinga
42f18ab3a6 Fixed bug 4525 - Fix crash in ALSA_HotplugThread caused by bad return value check
Anthony Pesch

Fix snd_device_name_hint return value check

According to the ALSA documentation, snd_device_name_hint returns 0 on
success, otherwise a negative error code. The code previously only
considered -1 to be an error, which let other error codes through
resulting in a segfault when hints (which was NULL) was dereferenced
2019-03-16 18:48:21 -07:00
Sam Lantinga
31c6c491c3 Fixed bug 4544 - SDL2.m4 SDL2.framework patch made it impossible to fail detection
Stian Skjelstad

check if $sdl_framework is set, before checking if directory exists

Patch that was merged here https://hg.libsdl.org/SDL/rev/9befd0acb9ef made it impossible for the SDL2 detection to fail, since one of the if statements fails to check if a variable is set or not.

if test -d $sdl_framework; then

can evaluate to true in some shells. I guess it falls into undefined behaviour when looking at the POSIX standard.
2019-03-16 18:45:10 -07:00
Sam Lantinga
74e23455ab Fixed CVE-2019-7635 and bug 4498 - Heap-Buffer Overflow in Blit1to4 pertaining to SDL_blit_1.c
Petr Pisar

The root cause is that the POC BMP file declares 3 colors used and 4 bpp palette, but pixel at line 28 and column 1 (counted from 0) has color number 3. Then when the image loaded into a surface is passed to SDL_DisplayFormat(), in order to convert it to a video format, a used bliting function looks up a color number 3 in a 3-element long color bliting map. (The map obviously has the same number entries as the surface format has colors.)

Proper fix should refuse broken BMP images that have a pixel with a color index higher than declared number of "used" colors. Possibly more advanced fix could try to relocate the out-of-range color index into a vacant index (if such exists).
2019-03-16 18:34:33 -07:00
Jimb Esser
b7be1a9526 Fix polling left trigger reporting right trigger's values. 2019-03-16 18:12:26 -07:00
Jimb Esser
2da2a90694 Fix DirectInput error codes being lost 2019-03-16 18:11:09 -07:00
Ethan Lee
cc665e2a57 hidapi: Add support for Wii U/Switch USB GameCube controller adapter.
Note that a single USB device is responsible for all 4 joysticks, so a large
rewrite of the DeviceDriver functions was necessary to allow a single device to
produce multiple joysticks.
2019-03-12 20:27:54 -04:00
Sam Lantinga
66ce732407 Fixed bug 4452 - Please replace AC_HELP_STRING with AS_HELP_STRING
Hugh McMaster

AC_HELP_STRING is deprecated and is considered an obsolete macro in autoconf 2.69.

Please replace AC_HELP_STRING with AS_HELP_STRING.
2019-03-16 17:47:59 -07:00
Sam Lantinga
145857ab85 Added missing PKG_CONFIG macros 2019-03-16 17:39:15 -07:00
Hugh McMaster
4413f7ae79 Use host system pkg-config when (cross-)compiling and convert to PKG_CHECK_MODULES
Fixes Bug 3575
2019-02-03 20:06:18 +11:00
Ryan C. Gordon
40130d3208 Fix compiler warnings. 2019-03-16 00:08:19 -04:00
Ryan C. Gordon
f7f527c9d0 testgesture: Add dependency to SDLtest to Visual Studio project. 2019-03-15 23:54:42 -04:00
Ryan C. Gordon
a629bd2e6f testgesture: cleaned up code formatting, etc. 2019-03-15 22:39:31 -04:00
Ryan C. Gordon
6c61e6ee73 testgesture: minor cleanups. 2019-03-15 22:17:21 -04:00
Ryan C. Gordon
369d62ff41 test: Moved testgesture.c over to the common SDLtest framework. 2019-03-15 22:16:02 -04:00
Ryan C. Gordon
35ccceb805 events: Disable all the signal-handling code on platforms without support.
So on Windows, for example, this mostly becomes a few empty functions.
2019-03-15 16:13:19 -04:00
Ryan C. Gordon
26afcb485a events: Let arbitrary signals to simulate iOS/Android backgrounding events.
This lets you build a custom embedded device that roughly offers the "this
process is going to the background NOW" semantics of SDL on a mobile device.
2019-03-15 15:51:05 -04:00
Ryan C. Gordon
64d44bc32f events: Make debug logging of the event queue a hint instead of an #ifdef.
This makes it easy to toggle it on when debugging a new platform (or just
getting more visibility into an app) without having to rebuild SDL.

--HG--
extra : rebase_source : b8676f90fbb0b57a6d210ba17af0f69b3e543fe4
2019-03-15 14:08:30 -04:00
Sylvain Becker
dde12980b1 KMSDRM: valid file descriptors could positive or 0. -1 is invalid. (Bug 4530) 2019-03-13 14:54:51 +01:00
Sylvain Becker
6c6f081a3e Android: minor comment update 2019-03-13 14:08:21 +01:00
Sylvain Becker
1a45c58431 Android: check SDL is initialized before sending the event
Avoid error message:
SDLActivity thread ends (error=Video subsystem has not been initialized)
2019-03-13 09:39:30 +01:00
Sam Lantinga
d7e04b16d7 [iOS DAC] Fix touch events getting from SDL2 to source2. 2019-03-12 14:45:04 -07:00
Sam Lantinga
0f79ef9a72 Fixed initial display orientation at Android app start 2019-03-12 14:44:25 -07:00
Sam Lantinga
4f7d417d71 HIDAPI: fix bug that caused non-HID class parts of composite devices to have windows HID functions called on them. 2019-03-12 14:44:12 -07:00
Sylvain Becker
340a13885b Fixed bug 4513 - Wayland, fix crash when remove event is sent (from Sebastian Krzyszkowiak) 2019-03-12 20:04:08 +01:00
Sylvain Becker
41de2fd2a0 SDL_EVDEV_kbd_init: uninitialized data for ioctl (Bug 4530)
Only two chars are used but the full prototype is:

int tioclinux(struct tty_struct *tty, unsigned long arg)

==5010== Syscall param ioctl(TIOCLINUX) points to uninitialised byte(s)
==5010==    at 0x53E73C7: ioctl (syscall-template.S:78)
==5010==    by 0x4A887DA: SDL_EVDEV_Init (SDL_evdev.c:163)
==5010==    by 0x4A7D157: KMSDRM_VideoInit (SDL_kmsdrmvideo.c:509)
==5010==    by 0x497D959: SDL_VideoInit_REAL (SDL_video.c:529)
==5010==    by 0x487ACBC: SDL_InitSubSystem_REAL (SDL.c:171)
==5010==    by 0x487B052: SDL_Init_REAL (SDL.c:256)
==5010==    by 0x488F7D6: SDL_Init (SDL_dynapi_procs.h:85)
2019-03-12 14:20:37 +01:00
Sylvain Becker
d12de4fc50 Fixed bug 4542 - Image flipped vertically when rendering on texture
Have to recompute  viewport because projection/glOrtho is different
wether rendering is on target texture or not
2019-03-12 07:59:53 +01:00
Sylvain Becker
6459df3bb7 SDL_MouseQuit(): clear mouse->cur_cursor (Bug 4530) 2019-03-11 15:31:46 +01:00
Sylvain Becker
ae05c2a19a KMSDRM: missing return value in VideoInit() (Bug 4530) 2019-03-11 15:27:42 +01:00
Sylvain Becker
ac5db2a7bd KMSDRM: change calls free() to SDL_free() (Bug 4529) 2019-03-11 15:22:40 +01:00
Sylvain Becker
eef44efa4c Un-activate some routine on mips because they are slowers (Bug 4503) 2019-02-23 09:36:56 +01:00
Sylvain Becker
9004c45b2e BlitNtoN BlitNtoNKey: remove non-aligned word read/store (bpp 3<->4) (Bug 4503)
Mips and (old) ARM doesn't allow word read/write when adress isn't 4bytes
aligned. So just remove that.
2019-02-22 09:30:45 +01:00
Ryan C. Gordon
6825a01478 raspberry: expose second display.
This lets apps see and choose between both an HDMI and DSI-connected display,
such as a television and the Pi Foundation's official touchscreen. It only
exposes the second display if the hardware reports that it is connected.

--HG--
extra : histedit_source : 10e02ab4f4e59329d69838e12d76ec2e88312014
2019-02-19 23:46:54 -05:00
Sylvain Becker
7a61dbc2ce Fix windows build 2019-02-18 22:48:14 +01:00
Sylvain Becker
89a4f6847a Fix bug 4053: Blit issues on Big Endian CPU 2019-02-18 22:06:53 +01:00
Sam Lantinga
6fe58e12b3 Fixed bug 4500 - Heap-Buffer Overflow in Map1toN pertaining to SDL_pixels.c
Petr Pisar

The reproducer has these data in BITMAPINFOHEADER:

biSize = 40
biBitCount = 8
biClrUsed = 131075

SDL_LoadBMP_RW() function passes biBitCount as a color depth to SDL_CreateRGBSurface(), thus 256-color pallete is allocated. But then biClrUsed colors are read from a file and stored into the palette. SDL_LoadBMP_RW should report an error if biClrUsed is greater than 2^biBitCount.
2019-02-18 07:50:33 -08:00
Sylvain Becker
ee94bad7f8 Fix invalid memory access and optimise Blit_3or4_to_3or4__*
Fix invalid write at last pixel of the surface:
  when surface has no padding (pitch == w * bpp) and bpp is 3
  with Blit, no colorkey, and NO_ALPHA same or inverse rgb triplet

Optimise by using int32 access:

BGR24 -> ARGB8888 :  faster x1.897875   (362405 -> 190953)
RGB24 -> ABGR8888 :  faster x1.660416   (363304 -> 218803)

ABGR8888 -> RGB24 :  faster x1.686319   (334962 -> 198635)
ARGB8888 -> BGR24 :  faster x1.691868   (324524 -> 191814)
BGR24 -> RGB888 :  faster x1.678459   (326811 -> 194709)
BGR888 -> RGB24 :  faster x1.731772   (327724 -> 189242)
RGB24 -> BGR888 :  faster x1.690989   (328916 -> 194511)
RGB888 -> BGR24 :  faster x1.698333   (326175 -> 192056)
2019-02-17 16:20:23 +01:00
Sylvain Becker
beb35a1b43 Better naming for the blit permutation variables 2019-02-09 17:40:32 +01:00
Sylvain Becker
dc27f8298c Faster blit colorkey or not, applied to bpp: 3->4 and 4->3
===== BlitNtoNKey ========
ABGR8888 -> BGR24 :  faster x3   (2168709 -> 562738)
ABGR8888 -> RGB24 :  faster x3   (2165055 -> 567458)

ARGB8888 -> BGR24 :  faster x3   (2169109 -> 564338)
ARGB8888 -> RGB24 :  faster x3   (2165266 -> 567081)

BGR24 -> ABGR8888 :  faster x3   (2997675 -> 891636)
BGR24 -> ARGB8888 :  faster x3   (2985449 -> 892028)
BGR24 -> BGR888 :  faster x3   (2961611 -> 891913)
BGR24 -> BGRA8888 :  faster x3   (3116305 -> 891534)
BGR24 -> BGRX8888 :  faster x3   (3179654 -> 896978)
BGR24 -> RGB888 :  faster x3   (2968191 -> 895112)
BGR24 -> RGBA8888 :  faster x3   (2998428 -> 893147)
BGR24 -> RGBX8888 :  faster x3   (2976529 -> 914853)

BGR888 -> BGR24 :  faster x3   (2161906 -> 563921)
BGR888 -> RGB24 :  faster x3   (2168228 -> 566634)

BGRA8888 -> BGR24 :  faster x4   (2270501 -> 561873)
BGRA8888 -> RGB24 :  faster x3   (2163179 -> 567330)

BGRX8888 -> BGR24 :  faster x3   (2162911 -> 562322)
BGRX8888 -> RGB24 :  faster x3   (2169617 -> 570927)

RGB24 -> ABGR8888 :  faster x3   (2977061 -> 925975)
RGB24 -> ARGB8888 :  faster x3   (2978148 -> 923680)
RGB24 -> BGR888 :  faster x3   (3001413 -> 935074)
RGB24 -> BGRA8888 :  faster x3   (2959003 -> 924096)
RGB24 -> BGRX8888 :  faster x3   (2965240 -> 927100)
RGB24 -> RGB888 :  faster x3   (2983921 -> 926063)
RGB24 -> RGBA8888 :  faster x3   (2963908 -> 925457)
RGB24 -> RGBX8888 :  faster x3   (2967957 -> 931700)

RGB888 -> BGR24 :  faster x3   (2173299 -> 563226)
RGB888 -> RGB24 :  faster x3   (2218374 -> 566164)

RGBA8888 -> BGR24 :  faster x3   (2166355 -> 561381)
RGBA8888 -> RGB24 :  faster x3   (2170322 -> 566729)

RGBX8888 -> BGR24 :  faster x3   (2168524 -> 564072)
RGBX8888 -> RGB24 :  faster x3   (2163680 -> 566956)

===== BlitNtoN ========

BGR24 -> BGRA8888 :  faster x3   (2458958 -> 797557)
BGR24 -> BGRX8888 :  faster x3   (2486085 -> 797745)
BGR24 -> RGBA8888 :  faster x3   (2422116 -> 797637)
BGR24 -> RGBX8888 :  faster x3   (2454426 -> 799085)

BGRA8888 -> BGR24 :  faster x4   (2468206 -> 524486)
BGRA8888 -> RGB24 :  faster x4   (2463581 -> 525561)

BGRX8888 -> BGR24 :  faster x4   (2583355 -> 524468)
BGRX8888 -> RGB24 :  faster x4   (2477242 -> 524284)

RGB24 -> BGRA8888 :  faster x2   (2453414 -> 818415)
RGB24 -> BGRX8888 :  faster x3   (2414915 -> 800863)
RGB24 -> RGBA8888 :  faster x3   (2461114 -> 798148)
RGB24 -> RGBX8888 :  faster x3   (2400922 -> 799203)

RGBA8888 -> BGR24 :  faster x4   (2494472 -> 526428)
RGBA8888 -> RGB24 :  faster x4   (2462260 -> 526791)

RGBX8888 -> BGR24 :  faster x4   (2541115 -> 524390)
RGBX8888 -> RGB24 :  faster x4   (2469059 -> 525416)
2019-02-09 17:20:53 +01:00
Sylvain Becker
dd36a11c64 Fix wrong access and simplify 2019-02-08 17:15:30 +01:00
Sylvain Becker
25eda01412 Some simplification of previous commit 2019-02-07 22:45:50 +01:00
Sylvain Becker
5d581abc77 Faster blit with CopyAlpha, no ColorKey
Applied to following formats:

ABGR8888 -> BGRA8888 :  faster x3   (2727179 -> 704761)
ABGR8888 -> RGBA8888 :  faster x3   (2707808 -> 705309)

ARGB8888 -> BGRA8888 :  faster x3   (2745371 -> 712437)
ARGB8888 -> RGBA8888 :  faster x3   (2746230 -> 705236)

BGRA8888 -> ABGR8888 :  faster x3   (2745026 -> 707045)
BGRA8888 -> ARGB8888 :  faster x3   (2752760 -> 727373)
BGRA8888 -> RGBA8888 :  faster x3   (2769544 -> 704607)

RGBA8888 -> ABGR8888 :  faster x3   (2725058 -> 706669)
RGBA8888 -> ARGB8888 :  faster x3   (2704866 -> 707132)
RGBA8888 -> BGRA8888 :  faster x3   (2710351 -> 704615)
2019-02-07 22:03:30 +01:00
Sylvain Becker
f77fc40749 Code factorization of the pixel format permutation 2019-02-07 21:49:24 +01:00
Sylvain Becker
f522413d61 Fix wrong comment 2019-02-07 18:52:49 +01:00
Sylvain Becker
5a641add78 Faster blit with no ColorKey
Applied to following formats:

ABGR8888 -> BGRX8888 :  faster x5   (3177493 -> 630439)
ABGR8888 -> RGBX8888 :  faster x5   (3178104 -> 628925)

ARGB8888 -> BGRX8888 :  faster x4   (3141089 -> 629448)
ARGB8888 -> RGBX8888 :  faster x5   (3216413 -> 630465)

BGR888 -> BGRA8888 :  faster x4   (3145403 -> 637701)
BGR888 -> BGRX8888 :  faster x4   (3142106 -> 630144)
BGR888 -> RGBA8888 :  faster x4   (3202685 -> 649384)
BGR888 -> RGBX8888 :  faster x4   (3170617 -> 658670)

BGRA8888 -> BGR888 :  faster x4   (3203308 -> 657697)
BGRA8888 -> RGB888 :  faster x5   (3201475 -> 631747)
BGRA8888 -> RGBX8888 :  faster x5   (3274544 -> 630409)

BGRX8888 -> ABGR8888 :  faster x4   (3149753 -> 638682)
BGRX8888 -> ARGB8888 :  faster x5   (3164101 -> 631273)
BGRX8888 -> BGR888 :  faster x4   (3144454 -> 630712)
BGRX8888 -> RGB888 :  faster x4   (3160490 -> 638047)
BGRX8888 -> RGBA8888 :  faster x5   (3308988 -> 631232)
BGRX8888 -> RGBX8888 :  faster x5   (3216775 -> 638065)

RGB888 -> BGRA8888 :  faster x4   (3143135 -> 655146)
RGB888 -> BGRX8888 :  faster x4   (3141790 -> 653771)
RGB888 -> RGBA8888 :  faster x5   (3214402 -> 637001)
RGB888 -> RGBX8888 :  faster x4   (3143082 -> 630009)

RGBA8888 -> BGR888 :  faster x3   (3157048 -> 920375)
RGBA8888 -> BGRX8888 :  faster x5   (3196692 -> 632996)
RGBA8888 -> RGB888 :  faster x4   (3141570 -> 652151)

RGBX8888 -> ABGR8888 :  faster x5   (3175401 -> 631218)
RGBX8888 -> ARGB8888 :  faster x4   (3144690 -> 639440)
RGBX8888 -> BGR888 :  faster x4   (3144250 -> 630171)
RGBX8888 -> BGRA8888 :  faster x5   (3220321 -> 630731)
RGBX8888 -> BGRX8888 :  faster x4   (3178453 -> 637445)
RGBX8888 -> RGB888 :  faster x5   (3203623 -> 632596)
2019-02-07 18:51:14 +01:00
Sylvain Becker
ce27bb3ffd Faster blit when using No Alpha or Set Alpha, + ColorKey
Applied to following formats:

ABGR8888 -> BGRX8888 :  faster x4   (2794295 -> 610587)
ABGR8888 -> RGB888 :  faster x4   (2835693 -> 615561)
ABGR8888 -> RGBX8888 :  faster x4   (2880475 -> 610479)

ARGB8888 -> BGR888 :  faster x4   (2802718 -> 610702)
ARGB8888 -> BGRX8888 :  faster x4   (2792481 -> 606311)
ARGB8888 -> RGBX8888 :  faster x4   (2821621 -> 624745)

BGR888 -> ARGB8888 :  faster x4   (2791705 -> 637889)
BGR888 -> BGRA8888 :  faster x4   (2793195 -> 652299)
BGR888 -> BGRX8888 :  faster x4   (2800713 -> 609326)
BGR888 -> RGB888 :  faster x4   (2812260 -> 610471)
BGR888 -> RGBA8888 :  faster x4   (2792327 -> 629288)
BGR888 -> RGBX8888 :  faster x4   (2799224 -> 607073)

BGRA8888 -> BGR888 :  faster x4   (2800520 -> 606897)
BGRA8888 -> RGB888 :  faster x4   (2825274 -> 616156)
BGRA8888 -> RGBX8888 :  faster x4   (2812530 -> 610340)

BGRX8888 -> ABGR8888 :  faster x4   (2793940 -> 628596)
BGRX8888 -> ARGB8888 :  faster x4   (2822686 -> 638899)
BGRX8888 -> BGR888 :  faster x4   (2818141 -> 613659)
BGRX8888 -> RGB888 :  faster x4   (2929017 -> 611794)
BGRX8888 -> RGBA8888 :  faster x4   (2799709 -> 629750)
BGRX8888 -> RGBX8888 :  faster x4   (2911010 -> 605640)

RGB888 -> ABGR8888 :  faster x4   (2800671 -> 631542)
RGB888 -> BGR888 :  faster x4   (2802644 -> 604461)
RGB888 -> BGRA8888 :  faster x4   (2801919 -> 628729)
RGB888 -> BGRX8888 :  faster x4   (2938244 -> 604135)
RGB888 -> RGBA8888 :  faster x4   (2912447 -> 642185)
RGB888 -> RGBX8888 :  faster x4   (2831676 -> 634293)

RGBA8888 -> BGR888 :  faster x4   (2928896 -> 614960)
RGBA8888 -> BGRX8888 :  faster x4   (2821422 -> 608146)
RGBA8888 -> RGB888 :  faster x4   (2825927 -> 617184)

RGBX8888 -> ABGR8888 :  faster x4   (2803852 -> 654129)
RGBX8888 -> ARGB8888 :  faster x4   (2923615 -> 642644)
RGBX8888 -> BGR888 :  faster x4   (2806523 -> 610447)
RGBX8888 -> BGRA8888 :  faster x4   (2813388 -> 630305)
RGBX8888 -> BGRX8888 :  faster x4   (2800052 -> 607881)
RGBX8888 -> RGB888 :  faster x4   (2807722 -> 610263)
2019-02-07 17:52:28 +01:00
Sylvain Becker
e931531271 Fix pointer warnings 2019-02-07 16:13:25 +01:00
Sylvain Becker
5f69b17a18 Faster blit when using CopyAlpha + ColorKey
Applied to following formats:

ABGR8888 -> ARGB8888 :  faster x7   (3959672 -> 537227)
ABGR8888 -> BGRA8888 :  faster x7   (4008716 -> 532064)
ABGR8888 -> RGBA8888 :  faster x7   (3998576 -> 530964)

ARGB8888 -> ABGR8888 :  faster x7   (3942420 -> 532503)
ARGB8888 -> BGRA8888 :  faster x7   (3995382 -> 527722)
ARGB8888 -> RGBA8888 :  faster x7   (4259330 -> 543033)

BGRA8888 -> ABGR8888 :  faster x7   (4110411 -> 529402)
BGRA8888 -> ARGB8888 :  faster x7   (4071906 -> 538393)
BGRA8888 -> RGBA8888 :  faster x6   (4038320 -> 585141)

RGBA8888 -> ABGR8888 :  faster x7   (3937018 -> 534127)
RGBA8888 -> ARGB8888 :  faster x7   (3979577 -> 537810)
RGBA8888 -> BGRA8888 :  faster x7   (3975656 -> 528355)
2019-02-07 15:12:17 +01:00
Sylvain Becker
2d3b9ae6a6 Android/openslES: fix warnings, comment out un-used interface 2019-02-05 15:14:15 +01:00
Sylvain Becker
3cbd2c7fef Android/openslES: set number of buffers of DATALOCATOR to internal NUM_BUFFER
If we increase NUM_BUFFER, Enqueue won't fail with SL_RESULT_BUFFER_INSUFFICIENT
2019-02-05 15:09:41 +01:00
Sylvain Becker
8a7599bdfc Android/openslES: prevent to run out of buffers if Enqueue() fails. 2019-02-05 15:05:32 +01:00
Ryan C. Gordon
3fa93ed3dc opengles2: patched to compile. 2019-02-04 23:35:18 -05:00
Ryan C. Gordon
32548976b8 opengles2: keep cached texturing state correct. 2019-02-04 23:32:28 -05:00
Ryan C. Gordon
bccc72020f opengles1: keep cached texturing state correct. 2019-02-04 23:24:10 -05:00
Ryan C. Gordon
b11d50936e render: Fix OpenGL draw state cache for various points of texture binding. 2019-02-04 18:55:39 -05:00
Sylvain Becker
8feff262f2 Fixed bug 4484 - use SIMD aligned memory for SDL_Surface
Surfaces are allocated using SDL_SIMDAlloc()
They are marked with SDL_SIMD_ALIGNED flag to appropriatly free them with SDL_SIMDFree()
(Flag is cleared when pixels is free'd in RLE, in case user would hijack the pixels ptr)

When providing its own memory pointer (SDL_CreateRGBSurfaceFrom()) and clearing
SDL_PREALLOC  to delegate to SDL the memory free, it's the responsability of the user
to add SDL_SIMD_ALIGNED or not, whether the pointer has been allocated with SDL_malloc() or
SDL_SIMDAlloc().
2019-02-04 09:11:07 +01:00
Sylvain Becker
ca28afb5df Fix include path compilation 2019-02-04 08:43:37 +01:00
Sylvain Becker
ad63886d12 Rename surface aligned memory flag to SDL_SIMD_ALIGNED 2019-02-04 08:34:24 +01:00
Alex Szpakowski
fbabf9bb94 iOS/tvOS: fix support for SDL_GameControllerGetButton(controller, GUIDE) with MFi controllers (thanks Caleb!)
Fixes bug #4463.
2019-01-31 19:52:47 -04:00
Sylvain Becker
7f13432340 Add SDL_MEMALIGNED flag for SDL_Surface using aligned memory.
If an SDL_Surface has an aligned memory pointers, it should be freed
using SDL_SIMDFree() (will be used by SDL_ttf).
2019-01-31 11:45:31 +01:00
Sylvain Becker
8bf1215e1b Add fast paths in BlitNtoNKey
All following conversions are faster (with colorkey, but no blending).
(ratio isn't very accurate)

ABGR8888 -> BGR888 :  faster x9   (2699035 -> 297425)

ARGB8888 -> RGB888 :  faster x8   (2659266 -> 296137)

BGR24 -> BGR24 :  faster x5   (2232482 -> 445897)
BGR24 -> RGB24 :  faster x4   (2150023 -> 448576)

BGR888 -> ABGR8888 :  faster x8   (2649957 -> 307595)

BGRA8888 -> BGRX8888 :  faster x9   (2696041 -> 297596)

BGRX8888 -> BGRA8888 :  faster x8   (2662011 -> 299463)
BGRX8888 -> BGRX8888 :  faster x9   (2733346 -> 295045)

RGB24 -> BGR24 :  faster x4   (2154551 -> 485262)
RGB24 -> RGB24 :  faster x4   (2149878 -> 484870)

RGB888 -> ARGB8888 :  faster x8   (2762877 -> 324946)

RGBA8888 -> RGBX8888 :  faster x8   (2657855 -> 297753)

RGBX8888 -> RGBA8888 :  faster x8   (2661360 -> 296655)
RGBX8888 -> RGBX8888 :  faster x8   (2649287 -> 308268)
2019-01-30 22:50:20 +01:00
Sylvain Becker
7bf5557a9b Fix blit with blending (Blit_A) to RGB332 which has no palette 2019-01-30 17:16:08 +01:00
Sylvain Becker
d2bf7b1eb7 Fixed failing SDL_ConvertSurface() when blit has failed.
Some blit combination are not supported (eg ARGB8888 -> SDL_PIXELFORMAT_INDEX1MSB)
So prevent SDL_ConvertSurface from creating a broken surface, which cannot be blitted
2019-01-30 16:36:47 +01:00
Sylvain Becker
0842ea0534 Add explicit unsigned int and char types in (for bug 4290) 2019-01-30 15:31:07 +01:00
Sylvain Becker
24de164055 Fixed bug 4290 - add fastpaths for format conversion in BlitNtoN
All following conversion are faster (no colorkey, no blending).
(ratio isn't very accurate)

ABGR8888 -> ARGB8888 :  faster x6   (2655837 -> 416607)
ABGR8888 -> BGR24 :  faster x7   (2470117 -> 325693)
ABGR8888 -> RGB24 :  faster x7   (2478107 -> 335445)
ABGR8888 -> RGB888 :  faster x9   (3178524 -> 333859)

ARGB8888 -> ABGR8888 :  faster x6   (2648366 -> 406977)
ARGB8888 -> BGR24 :  faster x7   (2474978 -> 327819)
ARGB8888 -> BGR888 :  faster x9   (3189072 -> 326710)
ARGB8888 -> RGB24 :  faster x7   (2473689 -> 324729)

BGR24 -> ABGR8888 :  faster x6   (2268763 -> 359946)
BGR24 -> ARGB8888 :  faster x6   (2306393 -> 359213)
BGR24 -> BGR888 :  faster x6   (2231141 -> 324195)
BGR24 -> RGB24 :  faster x4   (1557835 -> 322033)
BGR24 -> RGB888 :  faster x6   (2229854 -> 323849)

BGR888 -> ARGB8888 :  faster x8   (3215202 -> 363137)
BGR888 -> BGR24 :  faster x7   (2474775 -> 347916)
BGR888 -> RGB24 :  faster x7   (2532783 -> 327354)
BGR888 -> RGB888 :  faster x9   (3134634 -> 344987)

RGB24 -> ABGR8888 :  faster x6   (2229486 -> 358919)
RGB24 -> ARGB8888 :  faster x6   (2271587 -> 358521)
RGB24 -> BGR24 :  faster x4   (1530913 -> 321149)
RGB24 -> BGR888 :  faster x6   (2227284 -> 327453)
RGB24 -> RGB888 :  faster x6   (2227125 -> 329061)

RGB888 -> ABGR8888 :  faster x8   (3163292 -> 362445)
RGB888 -> BGR24 :  faster x7   (2469489 -> 327127)
RGB888 -> BGR888 :  faster x9   (3190526 -> 326022)
RGB888 -> RGB24 :  faster x7   (2479084 -> 324982)
2019-01-30 15:23:33 +01:00
Alon Zakai
7a03352caf Emscripten: No need for Runtime. for dynCalls 2019-01-29 12:21:22 +00:00
Alon Zakai
856123054a Emscripten: Avoid SDL2 in JS global scope
After this fix, closure works with the LLVM wasm backend on SDL2.
2019-01-29 12:19:36 +00:00
Charlie Birks
b7ee95c93c Emscripten: remove GLES_DeleteContext implementation
It was calling glClear without a context. The issue it was trying to
solve was actually that after destroying a window and creating a new one
, the contents of the old window were preserved. This no longer happens
since we resize the window to nothing on destroy.
2019-01-29 12:19:32 +00:00
Charlie Birks
2c7a6bb5a5 Emscripten: resize canvas to 0x0 in DestroyWindow
Closest we can get to actually destroying it
2019-01-29 12:19:23 +00:00
Charlie Birks
90c00ff7e5 Emscripten: don't zero the display mode before adding it 2019-01-29 12:19:06 +00:00
Charlie Birks
04d9fd58ed Emscripten: use UTF8ToString instead of Pointer_stringify 2019-01-29 12:19:03 +00:00
Charlie Birks
3cc0c3510f Emscripten: call emscripten_sample_gamepad_data 2019-01-29 12:19:00 +00:00
Charlie Birks
0ba2615a72 Emscripten: Use set_canvas_element_size
This will be needed for supporting multiple canvases and set_canvas_size
is deprecated anyway.
2019-01-29 12:18:56 +00:00
kichikuou
c6458411cd Emscripten: Do not consume mouseup event outside of the canvas 2019-01-29 12:14:54 +00:00
Sylvain Beucler
7100810424 Emscripten: fix duplicate mousebuttonup/mousebuttondown events when touch events are disabled 2019-01-29 12:14:44 +00:00
Charlie Birks
74c7631bd4 Emscripten: use a fake size for external sizing check
The check would fail if the canvas happened to be the correct size
already. (#66, mentioned in #58)
2019-01-29 12:14:41 +00:00
Charlie Birks
50b7f5fe78 Emscripten: reset fullscreen_window when leaving fullscreen
If the browser left fullscreen mode by the user pressing ESC, the next
call to SDL_SetWindowFullscreen(1) will fail as it thinks the window is
already fullscreen. (#65)
2019-01-29 12:14:33 +00:00
Sylvain Becker
bf51d0cd3f Fixed bug 4024 - GameController error "Unexpected controller element"
If mapping string is terminated with a comma, there is no more values to parse.
2019-01-21 23:41:43 +01:00
Sylvain Becker
a5b10978a6 Revert SDL_gamecontrollerdb.h and sort_controllers.py from bug 4024 2019-01-21 20:49:08 +01:00
Sylvain Becker
5c25e0c158 Fixed bug 3827 - issue with MapRGB, palette and colorkey
For palette surface, SDL_MapRGB() returns different values whether colorkey is
set or not.
2019-01-21 19:53:06 +01:00
Sylvain Becker
fc8c0ac5b0 Fixed bug 3827 - issue with MapRGB, palette and colorkey
For a palettized surface, prevent SDL_MapRGB() value to change whether colorkey is set or not.
2019-01-21 18:45:15 +01:00
Sam Lantinga
91cad4e8ea Fixed compiler warning 2019-01-20 13:53:16 -08:00
Sylvain Becker
a0d2344c8c Android: some typos 2019-01-20 22:17:41 +01:00
Sylvain Becker
d3dec69065 Android: automatically attach to the JVM non-SDL threads
It allows a thread created with pthread_create() to access the JNI Env
2019-01-20 22:11:56 +01:00
Sam Lantinga
751d99f1fe Fixed compiler warning on Android 2019-01-20 12:02:12 -08:00
Sylvain Becker
4deb7ba850 Fixed bug 3657 - Color-key doesn't work when an alpha channel is present
When surface format is the same as renderer format, it still needs an
intermediate conversion to transform colorkey to alpha.
2019-01-19 16:47:43 +01:00
Sylvain Becker
e6cf4a7523 Android: remove duplicate code in SDLGenericMotionListener_API24
and use parent method
2019-01-17 16:30:19 +01:00
Sylvain Becker
b331b1db3e Android: remove another hard-coded constant for Samsung DeX (no op!) 2019-01-17 14:59:46 +01:00
Sylvain Becker
2e326cb656 Android: minor change in the evaluation of SOURCE_CLASS_JOYSTICK (no op!)
InputDevice.SOURCE_CLASS_* are one bit
More readable to check that the source has this class_joystick set,
compared to the other statements, where the source is gamepad or dpad.
(Clean-up from bug 3958)
2019-01-17 13:42:13 +01:00
Sylvain Becker
d446c52322 Android: remove hard-coded constant for Samsung DeX (no op!)
12290 = 0x3002 = SOURCE_MOUSE | SOURCE_TOUCHSCREEN

SOURCE_MOUSE            Constant Value: 8194 (0x00002002)
SOURCE_TOUCHSCREEN      Constant Value: 4098 (0x00001002)
SOURCE_CLASS_POINTER    Constant Value: 2    (0x00000002)

https://developer.android.com/reference/android/view/InputDevice.html
2019-01-17 12:25:19 +01:00
Sylvain Becker
39706e04b8 Android: prevent concurrency in Android_SetScreenResolution() when exiting
by checking Android_Window validity

- SDLThread: user application is exiting:
    SDL_VideoQuit() and clearing SDL_GetVideoDevice()

- ActivityThread is changing orientation/size
    surfaceChanged() > Android_SetScreenResolution() > SDL_GetVideoDevice()

- Separate function into Android_SetScreenResolution() and Android_SendResize(),
    formating, and mark Android_DeviceWidth/Heigh as static
2019-01-17 11:05:05 +01:00
Sylvain Becker
830f87f3c5 Android: also update APP_PLATFORM to android-16 in Application.mk
https://hg.libsdl.org/SDL/rev/8db358c7a09a
https://hg.libsdl.org/SDL/rev/787e86a461f5
2019-01-17 09:28:30 +01:00
Sylvain Becker
1f0f29edc1 Fixed bug 4024 - remove trailing comma of Controller mappings
because it reports an error "Unexpected controller element"
2019-01-16 14:03:35 +01:00
Sylvain Becker
dbe91b2bcc Android: add mutex protection to onNativeOrientationChanged
it's possible receive try to send an event between the check first for SDL_GetVideoDevice
and SDL_VideoQuit is called
2019-01-16 10:48:28 +01:00
Sylvain Becker
2322ef6e6b Android: move static variable isPaused/isPausing to SDL_VideoData structure
- remove unneed check to Android_Window->driverdata
- add window check into context_backup/restore
2019-01-16 10:31:51 +01:00
Sylvain Becker
089bdbc56d Android: merge SDLJoystickHandler_API12 and SDLJoystickHandler_API16 2019-01-16 09:22:20 +01:00
Sylvain Becker
3b3d2b97ca Android: remove trailing spaces 2019-01-16 09:12:31 +01:00
Sylvain Becker
0c6417e562 Android: remove old code after Android-16 has been set as minimum requirement 2019-01-16 09:11:13 +01:00
Ryan C. Gordon
f20aabe611 evdev: don't debug log on a BTN_TOUCH from a non-touch device. 2019-01-14 19:43:25 -05:00
Ryan C. Gordon
a9d310b456 evdev: Add touchscreen mouse emulation and pressure support (thanks, Zach!).
This also solves reports of this log message:

"INFO: The key you just pressed is not recognized by SDL. To help get this
fixed, please report this to the SDL forums/mailing list
<https://discourse.libsdl.org/> EVDEV KeyCode 330"

(EVDEV KeyCode 330 is BTN_TOUCH.)

Fixes Bugzilla #4147.
2019-01-14 19:36:54 -05:00
Sylvain Becker
91f11c320e Android: create Pause/ResumeSem semaphore at higher level than CreateWindow()
- If you call onPause() before CreateWindow(), SDLThread will run in infinite loop in background.

- If you call onPause() between a DestroyWindow() and a new CreateWindow(), semaphores are invalids.

SDLActivity.java: the first resume() starts the SDLThread, don't call
nativeResume() as it would post ResumeSem. And the first pause would
automatically be resumed.
2019-01-14 23:33:48 +01:00
Sylvain Becker
b3f07fa516 Android/openslES: fix Pause/ResumeDevices when openslES is not used 2019-01-14 22:56:57 +01:00
Sylvain Becker
4408f8a713 Android: minor, remove static attributes, move mIsSurfaceReady to SDLSurface 2019-01-14 21:34:12 +01:00
Sylvain Becker
5220445fe4 Android/openslES: check for non NULL variable, some intialization.
use the previous naming
2019-01-14 14:36:13 +01:00
Sylvain Becker
2aed23fd35 Android/openslES: start playing, after creating ressources 2019-01-14 14:31:06 +01:00
Sylvain Becker
17dcd9a61c Android/openslES: set audio in paused/resumed state for Android event loop
And also in "stopped" state before closing the device.
2019-01-14 12:33:29 +01:00
Sylvain Becker
86070ac5ce Android/openslES: move a few static variables to SDL_PrivateAudioData structure 2019-01-14 10:58:57 +01:00
Sylvain Becker
84ae64fd44 Android/openslES: register and use CloseDevice function. 2019-01-14 10:16:26 +01:00
Sylvain Becker
00839d99f9 Android/openslES: some space and indentation to match SDL conventions 2019-01-14 10:04:54 +01:00
Sam Lantinga
57c735236b Initial Android OpenSL ES implementation, contributed by ANTA 2019-01-12 12:18:44 -08:00
Sam Lantinga
35dbd136d9 Fixed compiler warning 2019-01-12 12:12:43 -08:00
Sam Lantinga
986d77675f Updated minimum supported Android version to API 16, to match latest NDK toolchain 2019-01-12 12:11:06 -08:00
Sylvain Becker
c8cb2daffe Fixed bug 4453 - GLES / GLES2: first white renderer clear cmd is drawn as black 2019-01-12 13:34:03 +01:00
Sylvain Becker
cba02e3cf4 Android: move and group JNIEnv helper functions 2019-01-11 21:52:43 +01:00
Sylvain Becker
3892775b87 Android: change the way JNIEnv is retrieved
- Currently, it tries to Attach the JVM first and update the thread local storage, which are two operations.
  Now, it simply gives back the JNI Env stored for the thread.

- Android_JNI_SetupThreadi() should only be used for external.
  For internal SDL thread, it's already called in RunThread() (SDL_systhread.c),
  and other thread are Java threads which don't need to be attached. i
  (even if it doesn't hurt to do it, since it's a no-op).

- JNI_OnLoad is filled with pthread_create, GetEnv, AttachCurrentThread...
  It's called for all shared libraries which may don't want this setup,
  and loading libraries can be also modified to be done from a static context,
  or with relinker. So it's not really clear how, who and what it sets up.
  => Reduce this function to the minimal
2019-01-11 21:42:52 +01:00
Sylvain Becker
e7d87ee165 Android: use the same naming for JNI env local variables 2019-01-11 15:36:16 +01:00
Sylvain Becker
a8789be213 Android: Audio thread is already setup for the JVM
In 'src/thread/pthread/SDL_systhread.c' RunThread() calls first 'Android_JNI_SetupThread()'
2019-01-11 15:33:02 +01:00
Sylvain Becker
3be9e7756c Android: use pthread_once for creating thread key 'mThreadKey' 2019-01-11 15:27:53 +01:00
Sylvain Becker
c1d7f08a05 Android: don't call Android_JNI_ThreadDestroyed() for Java SDLThread
SDLThread is a Java Thread, it's not needed to call 'Detach' from the JVM.
Clear mThreadKey, so that the pthread_create destructor is not called for this
thread.
2019-01-11 14:50:43 +01:00
Sylvain Becker
dc75ef4090 Android: fix bad merge from previous commit 2019-01-11 14:25:32 +01:00
Sylvain Becker
86da1c0d49 Android: fix prototype of Android_JNI_InitTouch 2019-01-10 21:49:00 +01:00
Sylvain Becker
f060c105cd Android: add name for Touch devices and simplification, from bug 3958 2019-01-10 21:40:57 +01:00
Sylvain Becker
cd1266e2e0 Fixed bug 3930 - Android, set thread priorities and names
SDLActivity thread priority is unchanged, by default -10 (THREAD_PRIORITY_VIDEO).

SDLAudio thread priority was -4 (SDL_SetThreadPriority was ignored) and is now -16 (THREAD_PRIORITY_AUDIO).

SDLThread thread priority was 0 (THREAD_PRIORITY_DEFAULT) and is -4 (THREAD_PRIORITY_DISPLAY).
2019-01-10 18:05:56 +01:00
Sylvain Becker
19a116fccc Android: remove deprecated PixelFormat in surfaceChanged()
Can be check by adding in build.grable:

gradle.projectsEvaluated {
    tasks.withType(JavaCompile) {
        options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
    }
}

SDLActivity.java:1691: warning: [deprecation] A_8 in PixelFormat has been deprecated
        case PixelFormat.A_8:
SDLActivity.java:1694: warning: [deprecation] LA_88 in PixelFormat has been deprecated
SDLActivity.java:1697: warning: [deprecation] L_8 in PixelFormat has been deprecated
SDLActivity.java:1700: warning: [deprecation] RGBA_4444 in PixelFormat has been deprecated
SDLActivity.java:1704: warning: [deprecation] RGBA_5551 in PixelFormat has been deprecated
SDLActivity.java:1716: warning: [deprecation] RGB_332 in PixelFormat has been deprecated
2019-01-10 16:04:52 +01:00
Sylvain Becker
9fa4956771 Android: some simplification, don't need mExitCalledFromJava 2019-01-10 15:48:43 +01:00
Sylvain Becker
f1e0772b21 Android: nativeQuit for SDLActivity thread
- destroy Android_ActivityMutex
- display any SDL error message that may have occured in this thread,
  since SDL_GetError() is thread specific, and user has no access to it.
2019-01-10 15:43:07 +01:00
Sylvain Becker
50d8a0f65c Android: only send Quit event to SDLThread if it's not already terminated
And it avoids reporting errors using Android_Pause/ResumeSem that are NULL.
2019-01-10 15:35:46 +01:00
Sylvain Becker
1d7d7bdea4 Android: un-needed transition to Pause state.
- Don't need to go into Pause state, since onPause() has been called before.
- Don't need to call nativePause is SDLThread is already ended
2019-01-10 15:29:37 +01:00
Sylvain Becker
78896bb303 Android: prevent a dummy error message sending SDL_DISPLAYEVENT_ORIENTATION
In the usual case, first call to onNativeOrientationChanged() is done before
SDL has been initialised and would just set an error message
"Video subsystem has not been initialized" without sending the event.
2019-01-09 23:19:26 +01:00
Sylvain Becker
3e5c960536 Android: add some SetError for Android_SetWindowFullscreen
First error could happen if Android_SetWindowFullscreen somehow gets
called between SurfaceDestroyed() and SurfaceCreated()

Second error should not happen has native_window validity is guaranteed.
(It would happens previously with error -19)
2019-01-09 22:49:49 +01:00
Sylvain Becker
e9811c689e Android: native_window validity is guaranteed between surfaceCreated and Destroyed
It's currently still available after surfaceDestroyed().
And available (but invalid) between surfaceCreated() and surfaceChanged().

Which means ANativewindow_getWidth/Height/Format() fail in those cases.

https://developer.android.com/reference/android/view/SurfaceHolder.html#getSurface()
2019-01-09 22:41:52 +01:00
Sylvain Becker
ee67a08a26 Android: concurrency issue for Android_SetWindowFullscreen()
It accesses data->native_window, which can be changed by onNativeSurfacedChanged().

Currently, Android_SetWindowFullscreen() may access data->native_window after it
has been released, and before a new reference is acquired.

(can be reproduced by adding some SDL_Delay() in onNativeSurfacedChanged and
Android_SetWindowFullscreen() ).
2019-01-09 15:18:41 +01:00
Sylvain Becker
37737cf2ba Android: don't allow multiple instance of SDLActivity
Default launch mode (standard) allows multiple instances of the SDLActivity.
( https://developer.android.com/guide/topics/manifest/activity-element#lmode )

Not sure this is intended in SDL as this doesn't work. There are static
 variables in Java, in C code which make this impossible (allow one android_window) and
 also Audio print errors.

There is also some code added in onDestroy as if it would be able to
re-initialize: https://hg.libsdl.org/SDL/rev/56e9c709db7e

Bug Android activity life-cycle seems to show there is not transition to get out
of onDestroy()
https://developer.android.com/reference/android/app/Activity#ActivityLifecycle

( can be tested with "adb shell am start  my.package.org/.MainActivity"
  and "adb shell am start -n  my.package.org/.MainActivity" )

Send me a message if there are real use-case for this !
2019-01-07 17:06:50 +01:00
Sylvain Becker
027615873d Android: some robustness when quitting application from onDestroy()
Make sure there is not pending Pause accumulated, so the the application doesn't
remain paused and stucked in onDestroy().

Can be tested by adding:
 SDLActivity.nativePause();
 SDLActivity.nativePause();
 mSingleton.finish();
2019-01-07 11:35:31 +01:00
Sylvain Becker
dbdc76269a Android: better fix for bug 3186. Run those commands from SDL thread. 2019-01-06 20:25:54 +01:00
Sylvain Becker
9f8c00e07a Android: allow multiple calls to nativeResume()
Doesn't seem to happen manually, but symetrical to the pause handling.

Can be tested by adding:

mNextNativeState = SDLActivity.NativeState.PAUSED;
handleNativeState();
mNextNativeState = SDLActivity.NativeState.RESUMED;
handleNativeState();
mNextNativeState = SDLActivity.NativeState.PAUSED;
handleNativeState();
mNextNativeState = SDLActivity.NativeState.RESUMED;
handleNativeState();

Before, it ends in 'paused' state.
Now, it ends in 'resumed' state.
2019-01-06 17:35:42 +01:00
Sylvain Becker
0c8e81d10e Android: remove SURFACE_TYPE_GPU, deprecated in API level 5.
https://developer.android.com/reference/android/view/SurfaceHolder

This constant was deprecated in API level 5. this is ignored, this value is set automatically when needed.
2019-01-05 22:49:50 +01:00
Sylvain Becker
55215c7f47 Android: un-needed check of "isPausing" and minor typos 2019-01-05 22:46:52 +01:00
Sylvain Becker
c0f471d088 Android: fix wrong state after immediate sequence pause() / resume() / pause()
It may happen to have the sequence pause()/resume()/pause(), before polling
any events.

Before, it ends in 'resumed' state because as the check is greedy.
Now, always increase the Pause semaphore, and stop at each pause.
It ends in 'paused' state.

Related to bug 3250: set up a reconfiguration of SurfaceView holder.
Turn the screen off manually before the app starts
(repro rate is not 100%..)
2019-01-05 22:27:25 +01:00
Sam Lantinga
17af4584cb Fixed bug 4255 - SDL_GetGlobalMouseState() returns incorrect Y on secondary display
Julian Raschke

I use an open Mac laptop with an additional external monitor. The coordinate spaces from SDL_GetGlobalMouseState() and SDL_GetWindowPosition() match on the primary display, but not on the secondary display.

Cocoa window coordinates are vertically flipped in relation to the primary display:

https://github.com/spurious/SDL-mirror/blob/release-2.0.8/src/video/cocoa/SDL_cocoawindow.m#L219-L222

However, Cocoa_GetGlobalMouseState inverts the cursor Y coordinate per-display:

https://github.com/spurious/SDL-mirror/blob/release-2.0.8/src/video/cocoa/SDL_cocoamouse.m#L320-L323

Suggested fix: Replace the for-loop with this simpler calculation:

    *x = (int) cocoaLocation.x;
    *y = (int) (CGDisplayPixelsHigh(kCGDirectMainDisplay) - cocoaLocation.y);
2019-01-04 22:09:38 -08:00
Sam Lantinga
af32a2f4cd Updated copyright for 2019 2019-01-04 22:01:14 -08:00
Sylvain Becker
396afee0dd Android: fixed immediate transition to pause and resume.
"Pause" transition will add events:
 SDL_WINDOWEVENT_ENTER
 SDL_WINDOWEVENT_FOCUS_LOST
 SDL_WINDOWEVENT_MINIMIZED
 SDL_APP_WILL ENTER BACKGROUND
 SDL_APP_DID ENTER BACKGROUND

"Resume" transition will add events:
 SDL_APP_WILL ENTER FOREGROUND
 SDL_APP_DID ENTER FOREGROUND
 SDL_WINDOWEVENT_FOCUS_GAINED
 SDL_WINDOWEVENT_RESTORED

If Android application doesn't empty the event loop in between, it enters in
"paused" state when SDL_WINDOWEVENT_RESTORED is fetched.

See bug 3250 for pratical case.
2019-01-04 23:39:27 +01:00
Sylvain Becker
bfb1d28752 Android: make Android_PumpEvents() more readable
No behavior change in this commit.
2019-01-04 23:11:21 +01:00
Sylvain Becker
cfea04a4f9 Android: concurrency issue with egl_surface EGL_BAD_SURFACE - (bug 4142)
Occurs when application goes to background:
- Java activity is destroying SurfaceView holder and "egl_surface" (in onNativeSurfaceDestroyed())
- While native thread is in Android_GLES_SwapWindow(), prepared to call SDL_EGL_SwapBuffers()

The error is "call to eglSwapBuffers failed, reporting an error of EGL_BAD_SURFACE"

It an be reproduced easily by adding a SDL_Delay(100) at the begining of SDL_EGL_SwapBuffers(),
and putting the application into background.
2019-01-03 23:22:50 +01:00
Sylvain Becker
8edabc0c21 Android: use Mutex instead of Semphore for bug 4142 2019-01-03 20:18:29 +01:00
Sylvain Becker
e6e254c492 Android: prevent the error message from SDL_EGL_CreateSurface() to be masked. 2019-01-03 16:22:33 +01:00
Sylvain Becker
2db88f1944 Fixed bug 4142 - Concurrency issues in Android backend
Use a semaphore to prevent concurrency issues between Java Activity and Native thread code, when using 'Android_Window'.
(Eg. Java sending Touch events, while native code is destroying the main SDL_Window. )
2019-01-03 14:18:06 +01:00
Sylvain Becker
959c324fa0 Android: minor preparation for bug 4142 (concurrency issues) 2019-01-03 13:38:33 +01:00
Sylvain Becker
5d7e2a5274 Android: preparation bug 4142, reduce usage of global variable Android_Window 2019-01-03 13:14:16 +01:00
Sylvain Becker
d793997d62 Fixed bug 3250 - Wrong backbuffer pixel format on Android, keep getting RGB_565
Use the egl format to reconfigure java SurfaceView holder format.
If there is a change, it triggers a surfaceDestroyed/Created/Change sequence.
2019-01-02 18:06:33 +01:00
Sylvain Becker
2e4e3d974e Android: make sure surfaceChanged try to enter into 'resumed' state. 2019-01-02 17:41:33 +01:00
Sylvain Becker
2eef9b9e2f Fixed bug 4424 - Android windowed mode is broken (Thanks Jonas Thiem!) 2019-01-02 17:08:01 +01:00
Sylvain Becker
29b7d1f953 Android: on rare occasion, prevent Android_JNI_GetNativeWindow() from crashing
If Java getNativeSurface() returns null, then ANativeWindow_fromSurface() would crash().
2018-12-30 22:44:25 +01:00
Sylvain Becker
a4ad63e22e Android: fixed comments and spaces 2018-12-30 15:41:28 +01:00
Sylvain Becker
17b25495d1 Fixed bug 3186 - Android SW keyboard not restored when app becomes foreground. 2018-12-30 15:39:37 +01:00
Sylvain Becker
730b8eab7b Fixed bug 3511 - documentation to end an Android application 2018-12-30 14:23:25 +01:00
Sylvain Becker
15b1ff73c6 PSP renderer: use colors from 'draw' union (very likely, but un-tested) 2018-12-29 17:59:34 +01:00
Sylvain Becker
5cc44ad65c opengles 1: same fix as in bug #4433 2018-12-29 16:37:44 +01:00
Sylvain Becker
428e686eb6 opengles 1: use color from 'draw' union in SetDrawState() 2018-12-29 16:34:50 +01:00
Alex Szpakowski
15167c21db render: Fix internal state getting out of sync when destroying a texture that was just rendered and then creating a new one, in the GL and GLES2 backends. Fixes bug #4433. 2018-12-21 20:53:31 -04:00
Ryan C. Gordon
48cef1d6ac render: Prefer the Metal renderer over OpenGL.
This is the best option for macOS and iOS, the only platforms with Metal.

Pre-Metal versions of these platforms will fall back to OpenGL (ES), as
appropriate.

Huge thanks to Alexander Szpakowski, who worked incredibly hard to get the
Metal renderer to such a high-quality state!
2018-12-19 18:10:02 -05:00
Alex Szpakowski
6415608dec metal: Implement SDL_LockTexture for YUV formats. 2018-12-19 18:27:21 -04:00
Alex Szpakowski
bb030d3919 metal: Implement SDL_LockTexture for non-YUV textures. 2018-12-18 14:23:05 -04:00
Sylvain Becker
134f8f988a Gesture: remove warnings when ENABLE_DOLLAR is undefined. 2018-12-16 11:15:21 +01:00
Ryan C. Gordon
7029602ebe testgl2: Press 'o' or 'p' to decrease/increase OpenGL swap interval.
--HG--
extra : rebase_source : b720728b5767d944adc93e369b6fcf46efe37d47
2018-12-16 01:04:07 -05:00
Ryan C. Gordon
7a90573e05 cocoa: Implement OpenGL swap interval support with CVDisplayLink.
Not only does this fix macOS 10.14 ("Mojave")'s broken NSOpenGLCPSwapInterval
support, it also lets us implement "adaptive vsync" on macOS!

CVDisplayLink is supported back to macOS 10.4 ("Tiger"), so we just use it
universally without version checks and dump NSOpenGLCPSwapInterval, Mojave or
not.

--HG--
extra : rebase_source : 158673908a50df9b28519d5674c8444e078546c6
2018-12-16 01:03:17 -05:00
Sylvain Becker
9f79760557 Fixed bug 4426 - allows re-creation of software renderer
Switching between renderers "software -> opengl -> opengles2 -> software" fails.

"opengl -> opengles2" calls SDL_RecreateWindow() and frees "window->surface"
without marking it as "surface_invalid".
2018-12-15 16:21:24 +01:00
Ryan C. Gordon
c6eb3798e8 emscripten: SDL_PrivateJoystickAdded() wants an instance id, not device index. 2018-12-15 09:57:05 -05:00
Sylvain Becker
e473386e11 Fixed bug 4425 - promote to alpha format, palette surface with alpha values.
SDL_CreateTextureFromSurface() forgets to choose a texture format with alpha for
surfaces that have palettes with alpha values.
2018-12-15 14:50:12 +01:00
Sam Lantinga
bc58a01b8c Fixed building with the 10.10 SDK 2018-12-11 20:04:10 -08:00
Sam Lantinga
7fc7e354fd Handle both "Sony Interactive Intertainment" and "Sony Computer Entertainment" when ignoring motion sensors 2018-12-11 19:50:58 -08:00
Sylvain Becker
566dd8351c Rename _SDL_sensor_h in public header, not to trigger Wreserved-id-macro 2018-12-10 13:32:24 +01:00
Ethan Lee
a3cd5ede9f Linux Haptic: Fix periodic.magnitude value 2018-12-06 14:26:18 -05:00
Sam Lantinga
13bbc7e0b2 Fixed bug 4379 - fix parallel build with slibtool
orbea

I am having a parallel build problem with -j3 or higher using the autotools build and slibtool instead of GNU libtool. Basically slibtool is faster than GNU libtool and it will start working before mkdir starts or finishes creating the build/ directory.
2018-12-08 11:22:50 -08:00
Sam Lantinga
987a2f840d Fixed bug 4415 - SDL menu bar is nonstandard on Mac
foo.null

I'm on macOS 10.14 and I think I'm using or around SDL 2.0.9. This is about the menu bar that SDL sets up which looks like:

<App Name> <Window> <View>

1. View menu never proceeds after the Window menu in any Mac application (it is always before).
2. For SDL, the only purpose of the View menu is for a single fullscreen menu item, which is not justifiable enough to reserve space for a menu. The View menu should thus be removed, and the full screen menu item should be added at the end inside of Window's menu. See built in apps like Dictionary, Chess, App Store (on 10.14) that do this.
3. SDL should add a "Close" menu item to the Window's submenu, and it should be the first item. Its key equivalent should map to command w. Without this, you cannot close the game window via this shortcut, and you cannot close the app's About window via this shortcut.
4. Apps typically use "Enter Full Screen" or "Exit Full Screen" depending on context, not "Toggle Full Screen" which is less user friendly -- I personally care about this point the least.
2018-12-08 11:06:40 -08:00
Sam Lantinga
2ade6d2e8f Added the hint SDL_HINT_GAMECONTROLLERCONFIG_FILE to specify a file to load at initialization containing SDL game controller mappings 2018-12-07 12:02:08 -08:00
Sam Lantinga
d3d9a9ddd0 Made it more clear that the values being compared are floats 2018-12-06 09:09:05 -08:00
Brandon Schaefer
b1147bd31e wayland: Do not try to lock on an invalid pointer
This happens if you try to lock the pointer and (caps & WL_SEAT_CAPABILITY_POINTER) is false
Leading to input->pointer being NULL which ends up bringing the wayland client down (at lease on weston)
2018-12-06 10:39:33 -05:00
Sylvain Becker
ec677b353f Fix warnings detected on Android build 2018-12-06 15:46:40 +01:00
Sylvain Becker
a34c583513 opengles2: fix prototype of glDeleteBuffers 2018-12-06 10:24:44 +01:00
Sylvain Becker
c98ec32e0e Fix warnings detected on Android build 2018-12-06 09:22:00 +01:00
Ryan C. Gordon
f15847b00f joystick: Removed unused variable. 2018-12-05 19:03:15 -05:00
Ryan C. Gordon
e98f6428a9 Whoops, forgot to add a new source file. :/
--HG--
extra : rebase_source : 0282a35a77ab58e3e91b460355ec70ba3da032aa
2018-12-05 17:53:38 -05:00
Sam Lantinga
87928f6cbd Fixed the ROCCAT Tyon mouse showing up as a joystick on Windows 2018-12-05 14:46:03 -08:00
Ryan C. Gordon
077dec7964 joystick: Added controller config for IMS Passenger Control Unit Devices.
--HG--
extra : rebase_source : 779f3be5f33a69825b7ae53894549cdef863775c
2018-12-05 16:55:59 -05:00
Ryan C. Gordon
b6591a8ec7 egl: Don't force X11 support when testing for EGL.
Fixes building Wayland support on embedded systems without X11.

(TODO: maybe move the EGL test out of the X11 tests at some point, too.)

--HG--
extra : rebase_source : a70906fcb36821bd1578b5913de14cb5c35cb0d3
2018-12-05 16:53:15 -05:00
Ryan C. Gordon
2601ef1f2d linux: Move SDL_LinuxSetThreadPriority() elsewhere to fix build.
Fixes Bugzilla #4393.

--HG--
extra : rebase_source : 6f11be4047f8e92542f8d3d3938c76594e19cda0
2018-12-05 16:51:22 -05:00
Ryan C. Gordon
a233460a58 wayland: Send SDL_TOUCH_MOUSEID mouse events for touches.
--HG--
extra : rebase_source : 0f9b11680aa7e0d40485137b09ade272dc9de2d1
2018-12-05 16:49:38 -05:00
Sylvain Becker
56c63a1dac Warnings: fix a documentation warning and missing prototypes 2018-12-05 16:13:12 +01:00
Sam Lantinga
4011395e4a Fixed the PS4 motion controls showing up as a separate game controller on Linux 2018-12-04 14:21:29 -08:00
Sylvain Becker
909d54aadd Fix comment and end of lines 2018-12-04 18:15:45 +01:00
Sylvain Becker
4499e204fe Update comment URL of USB document (HID Usage Tables 1.12) 2018-12-04 17:13:13 +01:00
Sylvain Becker
ee4db39e2d Windows: NEON detection and intrinsic includes on Visual Studio
Visual Studio doesn't define __ARM_ARCH nor _ARM_NEON, but _M_ARM and _M_ARM64,
so SDL_HasNEON() was bypassed.

PF_ARM_NEON_INSTRUCTIONS_AVAILABLE doesn't see to be defined (but still works
 when defined as 19).
2018-12-04 16:50:31 +01:00
Sylvain Becker
feadefd971 android: use __ARM_NEON instead of __ARM_NEON__ to include <arm_neon.h>
Only __ARM_NEON is defined with Android NDK and arm64-v8a
Tested on ndk-r18, ndk-r13 and also Xcode.
(Visual Studio needs a different fix).

Fixes Bugzilla #4409.
2018-12-04 12:34:45 +01:00
Ryan C. Gordon
620f5429c4 direct3d: be more aggressive about resetting invalidated cached state.
Fixes Bugzilla #4402.
2018-12-03 09:26:05 -05:00
Ryan C. Gordon
0cf5b6222c render: fix some static analysis warnings. 2018-12-03 02:06:17 -05:00
Ryan C. Gordon
4c72dd1b02 direct3d: Make sure streaming textures update before being used for drawing.
Fixes Bugzilla #4402.
2018-12-03 01:58:23 -05:00
Ryan C. Gordon
a9b658ab1c Patched to compile on C89 compilers. 2018-12-02 21:57:33 -05:00
Ryan C. Gordon
e7b0e3e1b5 direct3d: Release and NULL out vertex buffers on reset.
Otherwise they are irretrievably lost on window resize, etc, which makes
rendering freeze and other disasters.

Fixes Bugzilla #4358.
2018-12-02 20:55:57 -05:00
Ryan C. Gordon
f77aac8e09 cmake: Comment out some debug logging that can upset build environments.
Something about the dashes, colons, numbers makes some builders believe this
is an error message.
2018-12-02 02:43:32 -05:00
Ryan C. Gordon
4375771a80 directfb: Updated render backend to new internal API.
Totally untested, beyond it now compiles again. Probably needs some fixes.

Fixes Bugzilla #4405.

--HG--
extra : rebase_source : 9a6a8b964c6140e53d7e139a768356ca6e28906b
extra : histedit_source : 7b2e68b42f05e931d371dc20c5a052d0898a26c3
2018-12-02 02:33:06 -05:00
Sergey Zhuravlevich
2cbe6f9558 kmsdrm: Check for resources when validating KMSDRM device in check_modesetting.
Fixes Bugzilla #4403.
2018-12-01 16:31:56 -05:00
Sergey Zhuravlevich
081e95ab4e kmsdrm: uninitialized KMSDRM fixes
* Search for valid encoder in connector when it doesn't have an
   encoder ID set.

 * Search for valid CRTC in resources and encoder's possible CRTCs
   when encoder doesn't have one set.

 * Select default mode if CRTC doesn't have a valid one.

 * Pick current_mode's W/H/Refresh Rate basing on current and
   valid CRTC mode, not the saved one.
2018-12-01 13:09:00 -05:00
Ryan C. Gordon
063f4fb0ee android: use cpufeatures to support SDL_HasNEON() (thanks, Sylvain!).
Fixes Bugzilla #4406.
2018-12-01 12:19:11 -05:00
Ryan C. Gordon
938d5a5b22 Added some detail to a Doxygen comment (thanks, Sylvain!). 2018-12-01 12:17:34 -05:00
Ryan C. Gordon
0884284086 Patched to compile on Linux with threads enabled. (whoops!) 2018-12-01 11:14:20 -05:00
Ryan C. Gordon
4de1ab9129 Patched to compile on Linux with --disable-threads.
Fixes Bugzilla #4393.

--HG--
extra : rebase_source : 7dcab81ff39b3345fa19e616e90ca0949373bd2d
2018-12-01 10:36:26 -05:00
Sam Lantinga
1897ec629d Added support for the Razer Raiju Mobile 2018-11-27 15:10:26 -08:00
Sam Lantinga
6d2e4bde2a Fixed the hotspot for cursors on Raspberry Pi 2018-11-27 11:16:04 -08:00
Sam Lantinga
a5a5e2cbd3 Fixed bug changing cursors on Raspberry Pi 2018-11-27 10:20:29 -08:00
Ozkan Sezer
06b24e43f6 SDL_touch.h (SDL_TouchDeviceType): remove comma at end of enumerator list. 2018-11-26 19:55:01 +03:00
Alex Szpakowski
f8efb8361a metal: use a staging texture in SDL_UpdateTexture, to make sure it doesn't stomp texture data being drawn in a previous frame on the GPU. 2018-11-25 22:13:09 -04:00
Sam Lantinga
18580909f9 Added atomics support for armv8-a (Raspberry Pi 3) 2018-11-23 21:29:42 -08:00
Sam Lantinga
41f6fc69e0 Do a second pass to find libraries without a single version digit after the .so
This finds libsndio.so.6.1 on Raspberry Pi
2018-11-23 21:11:11 -08:00
Alex Szpakowski
eaa6a12822 metal: Fix an incorrect division. 2018-11-21 23:46:37 -04:00
Alex Szpakowski
52adb7e81e metal: SDL_RenderFillRects uses one draw call per 16k rectangles (within the given FillRects call), instead of one draw call per rectangle. Reduces CPU usage when drawing many rectangles.
--HG--
extra : amend_source : 1b39afd4eaa31c151f607e4685f079a46fa6238c
2018-11-21 23:37:23 -04:00
Sebastian Krzyszkowiak
15c44098d6 wayland: ask xdg-decoration protocol extension to use server-side decorations if possible. 2018-11-04 21:08:40 +01:00
Ozkan Sezer
eb37476b4d minor update to Makefile.os2, added a test/Makefile.os2. 2018-11-20 10:55:00 +03:00
Sam Lantinga
97f778f0f3 Fixed bug 4394 - Crash in SDL_PumpEvents() after SDL_DestroyWindow()
Cameron Gutman

After updating to SDL 2.0.9, I got a user report that my app was crashing when closing a SDL_WINDOW_FULLSCREEN window to return to my Qt-based UI. It looks like the dead SDL window is getting a spurious updateLayer call which is causing SDL to dereference a null SDL_WindowData pointer.

For some reason, this only happens when using SDL_WINDOW_FULLSCREEN and not windowed or SDL_WINDOW_FULLSCREEN_DESKTOP. I was also unsuccessful in my attempt to get a simple reproducer for this crash. The Session.cpp code is available 688c4a90d9/app/streaming/session.cpp but I slightly modified it (adding a SDL_PumpEvents() call at 1179 to immediately trigger the issue, otherwise it happened when Qt next pumped the event loop).

The crashing line is:

    NSMutableArray *contexts = data->nscontexts;
2018-11-19 21:35:59 -08:00
Sam Lantinga
3a25554bb0 Fixed bug 4392 - SDL_cpuinfo.h breaks compilation with C bool type
Luke Dashjr

Bug 3993 was "fixed" by #undef'ing bool. But this breaks C99's stdbool.h bool too.

For example, mpv's build fails with:

../audio/out/ao_sdl.c:35:5: error: unknown type name ‘bool’

It seems ill-advised to be #undef'ing *anything* here - what if the code including SDL_cpuinfo.h actually wants to use altivec?
2018-11-19 21:28:52 -08:00
Sam Lantinga
70916714eb Fixed bug 4391 - hid_enumerate() sometimes causes game to freeze for a few seconds
Daniel Gibson

Even though my game (dhewm3) doesn't use SDL_INIT_JOYSTICK, SDL_PumpEvent() calls SDL_JoystickUpdate() which ends up calling hid_enumerate() every three seconds, and sometimes on my Win7 box hid_enumerate() takes about 5 seconds, which causes the whole game to freeze for that time.
2018-11-19 21:17:00 -08:00
Ozkan Sezer
c1da1f116b os/2 bits for SDL_malloc.c -- from libffi 2018-11-18 19:28:20 +03:00
Ozkan Sezer
c166586725 libm: Watcom defines huge=__huge: undefine it to fix build using Watcom. 2018-11-18 11:50:20 +03:00
Ozkan Sezer
56031584bb Makefile.os2: build libm as a static lib and add it to linkage.
in case it is needed some day.
2018-11-18 11:50:02 +03:00
Ryan C. Gordon
7ce155694c opengles: Fixed compiler warnings.
--HG--
extra : rebase_source : aef63cc80f39c9351ca39fe0c24e4f4e78bbf5d1
2018-11-17 16:24:52 -05:00
Sam Lantinga
e1d71b88e1 Back out change initializing renderer blend mode incorrectly. 2018-11-17 12:12:29 -08:00
Ryan C. Gordon
b13e7d9f99 direct3d11: Fixed missing rendering of solid primitives.
Fixes Bugzilla #4388.
2018-11-17 14:39:42 -05:00
Ryan C. Gordon
5186bd4a84 Fixed a few compiler warnings. 2018-11-17 14:37:51 -05:00
Sam Lantinga
f1b7d53e6c The default draw blendmode is SDL_BLENDMODE_NONE 2018-11-17 00:58:45 -08:00
Sylvain Beucler
5a3f2fc79e Emscripten: make CloseAudio actually close audio
cf. https://bugzilla.libsdl.org/show_bug.cgi?id=4176
2018-11-15 18:22:30 +00:00
Ozkan Sezer
6520a3dbe0 fix permissions 2018-11-15 07:20:02 +03:00
Ryan C. Gordon
8cac51aa90 software: fix blits with color mods that change during a command queue run.
--HG--
extra : rebase_source : f1b4087bb0bbf8955a9d418158b28b066ae79402
2018-11-14 22:38:58 -05:00
Sam Lantinga
2005ea6ca2 Fixed bug 3193 - Dualshock 3's motion sensors overwrite analog stick
maxxus

The Dualshock 3's motion sensors don't seem to be reported by the call to EVIOCGBIT but they still send EV_ABS events.  Because they're not reported by EVIOCGBIT they're not assigned a proper axis ids and the default of 0 is used, which is the valid id for the left analog sticks left/right axis.
2018-11-14 13:37:22 -08:00
Sam Lantinga
e53c04a3e6 Fixed bug 4377 - SDL_PIXELFORMAT enum is anonymous, which prevents its use in a templated function
zen3d

While trying to build Pixie lisp (https://github.com/pixie-lang/pixie), which uses SDL for multimedia output, the mandelbrot example won't build. The problem is that internally pixie uses a templated function to dump a value, and gcc chokes because SDL_PIXELFORMAT_RGA8888 is an anonymous enum.

I solved the problem locally by changing from:
   enum {
      SDL_PIXELFORMAT_UNKNOWN,
      ... etc. ...
      SDL_PIXELFORMAT_YUYV = ... etc ...
   };
to:
   typedef enum {
      SDL_PIXELFORMAT_UNKNOWN,
      ... etc. ...
      SDL_PIXELFORMAT_YUYV = ... etc ...
   } SDL_PIXELFORMAT_ENUM;
The net result of this change is that the enum containing SDL_PIXELFORMAT_* is no longer an anonymous enum and can now be used by a templated function.

This local change fixes Pixie lisp for me.

I did notice that you use the idiom
   typedef enum {
      ... etc ...
   } SDL_FOO;
elsewhere in your code, so that change to SDL_PIXELFORMAT doesn't look like it would have a negative impact.
2018-11-12 19:23:49 -08:00
Sam Lantinga
6e92b4109f Fixed bug 4366 - Compile throws a warning on RPI (Raspbian Stretch)
midwan

When trying to compile on a Raspberry Pi 3, running Raspbian Stretch (fully updated), a warning appears:

/home/pi/projects/SDL/src/test/SDL_test_memory.c: In function ‘SDL_TrackAllocation’:
/home/pi/projects/SDL/src/test/SDL_test_memory.c:112:109: warning: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘unw_word_t {aka unsigned int}’ [-Wformat=]
                 snprintf(entry->stack_names[stack_index], sizeof(entry->stack_names[stack_index]), "%s+0x%llx", sym, offset);
2018-11-12 16:42:49 -08:00
Sam Lantinga
91cb5f655b Fixed bug 4367 - compatibility version decreased between 2.0.8 and 2.0.9
Joshua Root

The change resulting from Bug 4208 changed the compatibility_version of libSDL2 from 9.0.0 to 1.0.0. This is simply wrong.

This means that programs linked against 2.0.9 are considered by the dynamic linker to be compatible with all previous versions of libSDL2. This is not the case since new public symbols have been added.

The way compatibility_version and current_version are meant to work is:
 * current_version increases every time the library changes in any way.
 * compatibility_version is increased to match current_version whenever new public symbols are added.

Thus both versions should only ever increase. The solution to the Xcode project and autotools not having matching versions should have been to increase the version(s) in the Xcode project.

Reference: https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/VersionInformation.html
2018-11-12 16:34:58 -08:00
Alex Szpakowski
fb12641435 cocoa: fix building with the macOS 10.7 SDK (thanks Riccardo!)
Fixes bug #4368
2018-11-10 20:56:23 -04:00
Alex Szpakowski
8760526f85 Add SDL_TouchDeviceType enum and SDL_GetTouchDeviceType(SDL_TouchID id).
Touch device types include SDL_TOUCH_DEVICE_DIRECT (a touch screen with window-relative coordinates for touches), SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE (a trackpad-style device with absolute device coordinates), and SDL_TOUCH_DEVICE_INDIRECT_RELATIVE (a trackpad-style device with screen cursor-relative coordinates).

Phone screens are an example of a direct device type. Mac trackpads are the indirect-absolute touch device type. The Apple TV remote is an indirect-relative touch device type.
2018-11-10 16:15:48 -04:00
Sam Lantinga
51a10d7f68 Used confflags +=, so each option can be enabled individually, if desired 2018-11-07 07:52:39 -08:00
Sam Lantinga
54d22a6fe8 The Debian maintainers aren't using these rules, so enable dynamic loading of shared libraries by default for the Steam Linux Runtime 2018-11-07 07:38:11 -08:00
Sam Lantinga
1e59f48daf Added Vulkan headers version 1.1.91
Downloaded from https://github.com/KhronosGroup/Vulkan-Headers
2018-11-06 16:57:07 -08:00
Sebastian Krzyszkowiak
b204de6c4b wayland: fix resizing and fullscreen toggling
For starters, we need to correctly respond to 0,0 configure after unsetting
fullscreen. Also, turns out that there should be no drawing calls at all
in between eglSwapBuffers and wl_egl_window_resize, as otherwise EGL can
already allocate a wrongly sized buffer for a next frame, so handle those
together.
2018-11-07 01:08:35 +01:00
Ozkan Sezer
6dfc2e7fa0 close_code.h: #error if included without matching begin_code.h 2018-11-06 23:45:50 +03:00
Ozkan Sezer
cc035dcc4f fix bug #4362 - SDL_syswm.h with SDL_PROTOTYPES_ONLY broken in C++ mode 2018-11-06 20:50:24 +03:00
Ryan C. Gordon
1c98dea86b os2: Do a distclean instead of removing files manually in buildbot script. 2018-11-04 21:11:07 -05:00
Ryan C. Gordon
09ca1f4018 os2: Added a script for the buildbot. 2018-11-04 20:47:17 -05:00
Alex Szpakowski
afbbecdd0a metal: SDL_RenderReadPixels on macOS synchronizes the render target's texture data if it's managed, before reading from it. 2018-11-04 14:31:56 -04:00
Alex Szpakowski
f6643dadd7 metal: fix the SDL_RENDERER_PRESENTVSYNC flag not being set on the renderer info on macOS, when vsync is used. 2018-11-04 12:31:02 -04:00
Alex Szpakowski
e82b90e740 metal: fix the size of the buffer used for constant data. 2018-11-04 12:24:05 -04:00
Ryan C. Gordon
8a700e7a89 mir: Removed mir client support.
Fixes Bugzilla #4288.
2018-11-02 21:34:17 -04:00
Sam Lantinga
4f55e0fc37 Fixed bug 4308 - Prebuilt SDL.dll files not compiled with ASLR support (DYNAMICBASE)
Cameron Gutman

The current SDL 2.0.8 and the prerelease SDL 2.0.9 are compiled without the DYNAMICBASE flag to indicate that ASLR may relocate the DLL at load-time. https://docs.microsoft.com/en-us/cpp/build/reference/dynamicbase-use-address-space-layout-randomization?view=vs-2017

When I build SDL.dll myself using the VS2010 project, the DLL has the DYNAMICBASE flag set (as is the default). Similarly, MinGW-w64 also enables ASLR by default on all binaries for a couple years now (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=836365)
2018-11-02 18:07:11 -07:00
Sam Lantinga
688cb2b847 Fixed bug 4320 - Android remove reflection for HIDDeviceBLESteamController
Sylvain

Uneeded use of reflection to access connectGatt method in HIDDeviceBLESteamController.java

The method is API 23

https://developer.android.com/reference/android/bluetooth/BluetoothDevice.html#connectGatt(android.content.Context,%20boolean,%20android.bluetooth.BluetoothGattCallback,%20int)
2018-11-02 17:25:00 -07:00
Sam Lantinga
ceee262245 Fixed bug 4319 - Android remove reflection for PointerIcon
Sylvain

Since SDL2 min requirement is Android SDK 26, and PointerIcon is 24. We don't need reflection to access it.
2018-11-02 17:22:15 -07:00
Sam Lantinga
176a57bcc3 Fixed bug 4315 - little Warning in Android_JNI_CaptureAudioBuffer
Sylvain

SDL_android.c
src/core/android/SDL_android.c:1302:5: warning: variable 'br' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
    default:
    ^~~~~~~
src/core/android/SDL_android.c:1306:12: note: uninitialized use occurs here
    return br;
           ^~
src/core/android/SDL_android.c:1270:12: note: initialize the variable 'br' to silence this warning
    jint br;
           ^


Maybe we could add some basics warning flags, not to see all warnings, but so that new warnings are caught sooner.

I would go for -Wall -Wextra, and some -Wno-warning for the allowed warnings.
2018-11-02 17:18:03 -07:00
Cameron Gutman
c136db0528 Remove machine-specific IncludePath from SDL.vcxproj
These IncludePath values seem to not actually be needed since nobody
noticed they were wrong for the past couple months.
2018-10-12 22:05:58 -07:00
Alex Szpakowski
dbdf655d67 metal: avoid an extra buffer allocation and GPU data copy in RunCommandQueue, it's not needed. Improves overall performance. 2018-11-01 20:24:21 -03:00
Alex Szpakowski
f2a29eea94 metal: remove an obsolete section of a constant buffer. 2018-11-01 19:49:01 -03:00
Ozkan Sezer
eb11815341 fix build using Watcom :
./src/render/SDL_render.c(2168): Error! E1054: Expression must be constant
./src/render/SDL_render.c(2168): Error! E1054: Expression must be constant
./src/render/SDL_render.c(2175): Error! E1054: Expression must be constant
./src/render/SDL_render.c(2175): Error! E1054: Expression must be constant
./src/render/SDL_render.c(2322): Error! E1054: Expression must be constant
./src/render/SDL_render.c(2322): Error! E1054: Expression must be constant
./src/render/SDL_render.c(2322): Error! E1054: Expression must be constant
./src/render/SDL_render.c(2322): Error! E1054: Expression must be constant
./src/render/SDL_render.c(2329): Error! E1054: Expression must be constant
./src/render/SDL_render.c(2329): Error! E1054: Expression must be constant
./src/render/SDL_render.c(2329): Error! E1054: Expression must be constant
./src/render/SDL_render.c(2329): Error! E1054: Expression must be constant

./src/render/software/SDL_render_sw.c(602): Error! E1054: Expression must be constant
./src/render/software/SDL_render_sw.c(602): Error! E1054: Expression must be constant
./src/render/software/SDL_render_sw.c(602): Error! E1054: Expression must be constant
./src/render/software/SDL_render_sw.c(602): Error! E1054: Expression must be constant
2018-11-01 20:04:24 +03:00
Ryan C. Gordon
2b3489261e merge fallout: Patched to compile, fixed some compiler warnings, etc.
--HG--
extra : amend_source : db5107c02c210087f25dea7f0407d09be10e24ba
2018-11-01 12:31:45 -04:00
Ryan C. Gordon
9f99a9c642 Merge SDL-ryan-batching-renderer branch to default.
--HG--
extra : rebase_source : 83b86d35497a01be6f48055490580bbba19ccc7a
extra : amend_source : faae1a04859499ede43aba3ba50fc4f62b5afbcb
2018-10-31 15:03:41 -04:00
Ryan C. Gordon
7ac65007de Closing SDL-ryan-batching-renderer branch.
--HG--
branch : SDL-ryan-batching-renderer
extra : close : 1
2018-10-31 14:50:20 -04:00
Ryan C. Gordon
25e38e5a3e wayland: ask KDE protocol extension to use server-side decorations if possible.
--HG--
branch : SDL-ryan-batching-renderer
2018-10-29 10:14:59 -04:00
Ryan C. Gordon
538f2f7649 render: Add floating point versions of various draw APIs.
--HG--
branch : SDL-ryan-batching-renderer
2018-10-23 01:34:03 -04:00
Steven M. Vascellaro
0d5be75013 joystick: Add Linux mappings for "Xbox One Wireless Controller (Model 1708)"
Adds controller bindings to support the "Xbox One Wireless Controller
(Model 1708)" on Linux. The Model 1708 was released in 2016 alongside the
Xbox One S. It is the current model being sold by Microsoft as of writing.
(October 22, 2018)
2018-10-22 10:55:18 -04:00
Ozkan Sezer
e8cad22d6a fix NetBSD C90 build failure
src/vendor/SDL2/src/joystick/bsd/SDL_sysjoystick.c:353:5: error:
ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]

reported by 'bch' at https://discourse.libsdl.org/t/25231
2018-11-01 12:35:00 +03:00
Cameron Gutman
030c9068a7 Fix crash when GL_LoadFunctions()/GLES2_LoadFunctions() fails
https://bugzilla.libsdl.org/show_bug.cgi?id=4350

We can't safely call GL_DestroyRenderer() until GL_LoadFunctions()
succeeds because we will be missing functions that we try to use
when activating the renderer for destruction if we have an GL context.
2018-10-31 20:17:53 -07:00
Sam Lantinga
4cd4ad8df6 Fixed bug 4349 - SDL_CreateWindow fails with KMS/DRM after upgrading Mesa to 18.2.3
Rainer Sabelka

After I did an upgrade of my arch Linux installation (resulting in an update of Mesa to version 18.2.3), all my SDL2 applications which use the KMS/DRM driver stopped working.
Reason: Creating a Window with SDL_CreateWindow failed because the call to EGL
eglCreateWindowSurface() returns an error "EGL_BAD_MATCH".
After investigating with the debugger I figured, that the configuration, which has been selected from the output of eglChooseConfig(), has an "EGL_NATIVE_VISUAL_ID" which does not match the "format" of the underlying gbm surface.

The attached patch fixes the problem. It does so, by mimicking Weston's behavior.
All configurations returned from eglChooseConfig() which have an visual_id different from the gbm format are discarded, and only from the remaining ones the "best" match is selected.
2018-10-31 15:16:51 -07:00
Sam Lantinga
9d7e7f0951 Fixed bug 4347 - Keyboard LEDs don't work on linux console
Rainer Sabelka

When using SLD2 on a Linux console with the KMS/DRM video backend and Linux evdev keyboard support, the caps lock, scroll lock, and num lock leds do not work.

The attached patch adds ioctls for setting the LED state in SDL_evdev_kbd.c
2018-10-31 15:01:20 -07:00
Sam Lantinga
369252785a Added tag release-2.0.9 for changeset 8feb5da6f2fb 2018-10-31 10:18:05 -07:00
Ozkan Sezer
8a812a2427 rename os2 makefile so that 'make dist' catches it; update it a bit.
--HG--
rename : OWMakefile.os2 => Makefile.os2
2018-10-30 20:11:02 +03:00
Sam Lantinga
8561b13616 Fixed bug 4188 - Software renderer SDL_RenderCopyEx blits corrupt image under certain cases
Sylvain

Re-opening this issue.

It fixes the test-case, but it introduces a regression with another bug (bug #4313).

So here's a new patch that activate cropping of the source surface to solve the issue.
It also reverts the wrong changeset.
It prevents unneeded colorkey error message.
2018-10-30 07:00:03 -07:00
Sam Lantinga
b4b9d8f2ec Backed out changeset 9bb50edccc46, SDL_JOYSTICK_HIDAPI is only used on iOS for Steam Controller support, which is not publicly available. 2018-10-29 19:58:59 -07:00
Ryan C. Gordon
455993b5f7 winmain: Patched to compile on C89 compilers. 2018-10-29 20:18:50 -04:00
Ryan C. Gordon
0aa93ce8fd winmain: Don't use SDL_malloc (or SDL_stack_alloc, which might be malloc).
Otherwise, we are using the allocator before the app can set up its own hooks.

Now we use VirtualAlloc, and WideCharToMultiByte (because SDL_iconv uses
SDL_malloc, too!) to get ready to call into SDL_main.

This also makes console_wmain() call into the same routines as everything
else, so we don't have to deal with those allocations, too. Hopefully we
end up with the same results from GetCommandLine() as we do in wargv.

Fixes Bugzilla #4340.
2018-10-29 20:00:03 -04:00
Ryan C. Gordon
d548956257 README-ios: added a note about enabling hidapi. 2018-10-29 15:51:38 -04:00
Michał Janiszewski
fee5c91f4a Add and update include guards
Include guards in most changed files were missing, I added them keeping
the same style as other SDL files. In some cases I moved the include
guards around to be the first thing the header has to take advantage of
any possible improvements compiler may have for inclusion guards.
2018-10-28 21:36:48 +01:00
Sam Lantinga
1ce6f5502a Fixed bug 4335 - Android NDK build error
dmuratshin

LOCAL_SRC_FILES shouldn't use $(LOCAL_PATH)
2018-10-28 14:17:21 -07:00
Sam Lantinga
925eba4300 Updated Android project files and documentation 2018-10-28 10:31:06 -07:00
Sam Lantinga
99a161adc7 This change looks okay in the general case.
If we run into problems where these events aren't dispatched (initialized on a different thread than the main thread?) we may need to create a separate thread to handle device notifications like we do with the windows joystick subsystem.
2018-10-26 20:20:28 -07:00
Ryan C. Gordon
c81e3972ba hidapi: Don't run a separate event loop for device notifications.
Fixes Bugzilla #4286.
2018-10-26 14:43:39 -04:00
Sam Lantinga
ada6e9687a Added patch note for SDL_GameControllerGetPlayerIndex() and friends 2018-10-26 09:49:27 -07:00
Sam Lantinga
c52506c862 Don't build SDL_JOYSTICK_HIDAPI by default on iOS
If you enable this, you'll need to link with CoreBluetooth.framework and add something like this to your Info.plist:
<key>NSBluetoothPeripheralUsageDescription</key>
<string>MyApp would like to remain connected to nearby bluetooth Game Controllers and Game Pads even when you're not using the app.</string>
2018-10-26 09:27:31 -07:00
Sam Lantinga
678ba78382 Generalized the XInput user index into a player index 2018-10-25 16:53:14 -07:00
Sam Lantinga
222a3ed235 Fixed initializing XInput user index 2018-10-25 13:22:34 -07:00
Sam Lantinga
0485c938d7 Added SDL_JoystickGetXInputUserIndex() 2018-10-25 12:54:42 -07:00
Sam Lantinga
2dc55a9175 Added vi style for the Emscripten joystick code 2018-10-25 12:54:39 -07:00
Ozkan Sezer
ea9baa6056 CMakeLists.txt: set dylib version numbers properly. (bug #2915.) 2018-10-25 11:11:02 +03:00
Sam Lantinga
1880564264 Fixed reinitializing the SDL joystick subsystem on Android 2018-10-23 12:40:25 -07:00
Ozkan Sezer
0f6d45f840 fix permissions 2018-10-23 09:10:02 +03:00
Sam Lantinga
9198904285 Change our fullscreen wait logic to only wait if we need to. (thanks Rachel!) 2018-10-22 14:55:47 -07:00
Sam Lantinga
cb0aa75cfe Handle failure to load hidapi gracefully 2018-10-22 14:55:45 -07:00
Sam Lantinga
c47d44bc42 Add exception handling to Android hidapi. 2018-10-22 14:55:42 -07:00
Ryan C. Gordon
698ad82c1f wasapi/win32: Sort initial device lists by device GUID.
This makes an unchanged set of hardware always report devices in the same
order on each run.
2018-10-21 22:40:17 -04:00
Ryan C. Gordon
0330891d77 x11: Fixed incorrect function signature for XkbSetDetectableAutoRepeat.
It needs to use Bool (which is an int) and not BOOL (which is CARD8), which
causes problems on platforms with different byte order and alignment, etc.

Fixes Bugzilla #4326.
2018-10-20 21:35:48 -04:00
Ryan C. Gordon
e5132f9f98 cocoa: Put a mutex around GL_SwapBuffers.
Prevents deadlock when swapping two different GL contexts on two different
threads at the same time on macOS 10.14 ("Mojave").

Fixes Bugzilla #4278.
2018-10-18 23:38:27 -04:00
Ryan C. Gordon
dc792b46b9 cocoa: Fix OpenGL rendering on macOS 10.14 ("Mojave").
Fixes Bugzilla #4272.
(transplanted from 86dcfbbcacaf0c4a556501644af11b7f99b4352d)

--HG--
branch : SDL-ryan-batching-renderer
extra : transplant_source : %86%DC%FB%BC%AC%AF%0CJUe%01dJ%F1%1B%7F%99%B45-
2018-10-18 12:05:05 -04:00
Ryan C. Gordon
c025d6c10e cocoa: GL_GetDrawableSize only uses -[NSView convertRectToBacking] for highDPI.
On Mojave, this will report large numbers for retina displays in fullscreen
mode, which isn't how it works on previous versions.
(transplanted from a02aa66a76d84f7cb4181125c926e978b2284a57)

--HG--
branch : SDL-ryan-batching-renderer
extra : transplant_source : %A0%2A%A6jv%D8O%7C%B4%18%11%25%C9%26%E9x%B2%28JW
2018-10-18 11:59:48 -04:00
Ryan C. Gordon
637cfa5d6b Small stack allocations fall back to malloc if they're unexpectedly large.
--HG--
branch : SDL-ryan-batching-renderer
2018-10-22 20:50:32 -04:00
Ryan C. Gordon
1c7254cb58 opengles2: Fixed several incorrect things.
--HG--
branch : SDL-ryan-batching-renderer
2018-10-06 17:08:04 -04:00
Ryan C. Gordon
41007ab39f opengles2: removed useless memcpy.
--HG--
branch : SDL-ryan-batching-renderer
2018-10-04 21:10:42 -04:00
Ryan C. Gordon
3b9a14d823 opengles2: Fixed incorrect cliprect state.
--HG--
branch : SDL-ryan-batching-renderer
2018-10-04 20:22:28 -04:00
Ryan C. Gordon
ceefc68ccb metal: CopyEx transform matrix must be aligned for constant buffer access.
--HG--
branch : SDL-ryan-batching-renderer
2018-10-04 20:21:58 -04:00
Ryan C. Gordon
b7db24b141 metal: Don't try to create a zero-byte vertex buffer.
(Which will cause a crash in Metal, or an assert in the validation layer.)

--HG--
branch : SDL-ryan-batching-renderer
2018-10-04 20:21:23 -04:00
Ryan C. Gordon
7d96cb5cef render: Added SDL_RenderFlush().
--HG--
branch : SDL-ryan-batching-renderer
2018-10-04 16:34:44 -04:00
Ryan C. Gordon
5f11d18f0d render: Move PSP backend to new interface.
I have no idea if this works (or if it ever worked, having now examined this
code), as I have no way to compile or test this.

If it's broken, send patches.  :)

--HG--
branch : SDL-ryan-batching-renderer
2018-10-04 16:11:43 -04:00
Ryan C. Gordon
49670f5555 render: moved software renderer to new interface.
--HG--
branch : SDL-ryan-batching-renderer
2018-10-03 23:37:29 -04:00
Ryan C. Gordon
a0efc7ab09 render: D3D11 now cycles through 8 vertex buffers.
This means it doesn't have to block while the current frame finishes using the
vertex buffer; it just moves on to the next, probably-not-in-use buffer.

--HG--
branch : SDL-ryan-batching-renderer
2018-10-03 19:05:20 -04:00
Ryan C. Gordon
c1de5c9555 render: D3D11 renderer patched to compile.
--HG--
branch : SDL-ryan-batching-renderer
2018-10-03 18:23:53 -04:00
Ryan C. Gordon
048c707bc7 render: first (untested!) shot at converting D3D11 renderer to new interfaces.
Probably doesn't even compile yet.

--HG--
branch : SDL-ryan-batching-renderer
extra : histedit_source : a386a4b001a3cc26ea67e75b607b43b8343ea955
2018-10-03 00:52:37 -04:00
Ryan C. Gordon
e33a87b4e6 render: Make the GL backends cache and defer more state changes.
--HG--
branch : SDL-ryan-batching-renderer
extra : histedit_source : 9989445300dd74771e6143b70ef194e88d123c18
2018-10-01 22:53:45 -04:00
Ryan C. Gordon
c60a01a082 render: D3D9 doesn't need to check for stream offset support anymore.
We don't use offsets at all now. Too slow.

--HG--
branch : SDL-ryan-batching-renderer
extra : histedit_source : bf5eafc07800e64529ffc423abf3e605aa965264
2018-10-01 13:41:15 -04:00
Ryan C. Gordon
7aab4dc8b9 render: Set the D3D9 stream source once and choose offsets during draw calls.
This is _much_ faster than setting the offsets with SetStreamSource!

--HG--
branch : SDL-ryan-batching-renderer
2018-10-01 11:32:08 -04:00
Ryan C. Gordon
d6753c690b render: Patched to compile.
--HG--
branch : SDL-ryan-batching-renderer
2018-10-01 03:02:54 -04:00
Ryan C. Gordon
8a2013f1c2 render: first shot at moving Direct3D 9 backend to new interface. Untested!
--HG--
branch : SDL-ryan-batching-renderer
2018-10-01 01:23:02 -04:00
Ryan C. Gordon
8e76fc1c37 render: patched to compile on C89 compilers, other untested code fixes.
--HG--
branch : SDL-ryan-batching-renderer
2018-09-29 04:00:38 +00:00
Ryan C. Gordon
454906e0b9 opengles1: set some non-zero drawstate defaults.
--HG--
branch : SDL-ryan-batching-renderer
2018-09-28 19:48:14 -04:00
Ryan C. Gordon
3fb340541a render: moved opengles2 over to new interface.
--HG--
branch : SDL-ryan-batching-renderer
2018-09-28 19:47:44 -04:00
Ryan C. Gordon
4741821e57 cocoa: Force an OpenGL context update when the window becomes key.
Fixes missing rendering on macOS 10.14 ("Mojave").

Fixes Bugzilla #4272.
(transplanted from 55489adbb75c8eb7c7719a3f9c85a15d06df2f27)

--HG--
branch : SDL-ryan-batching-renderer
extra : transplant_source : UH%9A%DB%B7%5C%8E%B7%C7q%9A%3F%9C%85%A1%5D%06%DF/%27
2018-09-26 20:10:32 -04:00
Ryan C. Gordon
1da21e6740 render: Do state cache improvements for GLES1, too.
--HG--
branch : SDL-ryan-batching-renderer
2018-09-25 21:35:09 -04:00
Ryan C. Gordon
e523763256 render: OpenGL renderer now caches some state, to improve non-batching mode.
(other minor bug fixes in here, too)

--HG--
branch : SDL-ryan-batching-renderer
extra : amend_source : 1232922bfab60e6b4f23f1c2a35275716ed273bb
2018-09-25 19:20:31 -04:00
Ryan C. Gordon
6292445c7a render: Move non-batching flushes to different place.
This lets us batch up a few commands that are all related to the same API
call.

--HG--
branch : SDL-ryan-batching-renderer
2018-09-25 17:04:47 -04:00
Ryan C. Gordon
d96daf4a28 render: opengles renderer actually works now. :)
--HG--
branch : SDL-ryan-batching-renderer
2018-09-25 16:17:10 -04:00
Ryan C. Gordon
0675f2fa39 render: First shot at converting opengles renderer to new interfaces.
--HG--
branch : SDL-ryan-batching-renderer
extra : source : db6a2cf729c557a192ec767944bae3168dde3960
2018-09-25 10:41:25 -04:00
Ryan C. Gordon
dbf1408ad8 render: get rid of the predeclared functions in the GL and Metal renderers.
(others to come as I continue to update render backends!)

--HG--
branch : SDL-ryan-batching-renderer
extra : source : 17cc45c0b2e4274617a5ed8ac06f819d3eb40717
2018-09-24 12:30:47 -04:00
Ryan C. Gordon
7b78f799ae render: Make opengl backend take advantage of new high-level features.
--HG--
branch : SDL-ryan-batching-renderer
extra : source : f4665fc62a607285c0c2352dadeb3b290c29d097
2018-09-24 02:08:34 -04:00
Ryan C. Gordon
b8773215d9 render: Add command queue debug logging.
--HG--
branch : SDL-ryan-batching-renderer
extra : source : 7b514b380529e2e8d77cd63eda3fb81cc96d42a9
2018-09-24 02:07:35 -04:00
Ryan C. Gordon
6fdeb95d0c render: Update Metal and GL backends to use new high-level features, etc.
Now nothing is uploaded as dynamic data with Metal's setVertexBytes, etc; it's
all in the one big vertex buffer, now.

--HG--
branch : SDL-ryan-batching-renderer
extra : source : 67011faccbdbdff56162a9eb25a2bc964c064a03
2018-09-23 23:22:56 -04:00
Ryan C. Gordon
b288df490b render: A bunch of high-level improvements.
- high-level filters out duplicate render commands from the queue so
  backends don't have to.
- Setting draw color is now a render command, so backends can put color
  information into the vertex buffer to upload with everything else instead
  of setting it with slower dynamic data later.
- backends can request that they always batch, even for legacy programs,
  since the lowlevel API can deal with it (Metal, and eventually Vulkan
  and such...)
- high-level makes sure the queue has at least one setdrawcolor and
  setviewport command before any draw calls, so the backends don't ever have
  to manage cases where this hasn't been explicitly set yet.
- backends allocating vertex buffer space can specify alignment, and the
  high-level will keep track of gaps in the buffer between the last used
  positions and the aligned data that can be used for later allocations
  (Metal and such need to specify some constant data on 256 byte boundaries,
  but we don't want to waste all that space we had to skip to meet alignment
  requirements).

--HG--
branch : SDL-ryan-batching-renderer
extra : source : a3d62fbb80e46d9d544fa52944c3bac5375b5489
2018-09-23 23:20:40 -04:00
Ryan C. Gordon
c5dd072e01 render: First shot at moving metal backend over to new batching system.
--HG--
branch : SDL-ryan-batching-renderer
extra : source : 5e5ee5e583af6e120a84df5b2b48118bbadd5bb4
2018-09-20 16:40:04 -04:00
Ryan C. Gordon
2316f6a784 render: first shot at reworking opengl backend for new batching system.
--HG--
branch : SDL-ryan-batching-renderer
extra : source : 5208dec7e274c9036cdb7ea205682f82f3ac2f7c
2018-09-20 16:36:54 -04:00
Ryan C. Gordon
e7e52b63c0 render: Move to a batching system for rendering (work in progress).
--HG--
branch : SDL-ryan-batching-renderer
extra : source : 6160933718a85a6c45cf63723b404c49579b44f1
2018-09-20 15:46:02 -04:00
Ryan C. Gordon
b06aace296 testsprite2: report average FPS in blocks of five seconds.
This makes the reporting more accurate, vs startup inefficiencies and other
scheduling burps.

--HG--
branch : SDL-ryan-batching-renderer
extra : source : 6c2ad028778a96a0e34436ab7de121ecae4da0d8
2018-09-20 15:41:57 -04:00
Ryan C. Gordon
8353a58143 gles2: Make render command queue dynamic.
It now uses a growable linked list that keeps a pool of allocated items for
reuse, and reallocs the vertex array as necessary. Testsprite2 can scale to
20,000 (or more!) draws now without drama.

--HG--
branch : SDL-ryan-batching-renderer
extra : source : a4d56fdc03aa55ae4e04dc1bf7091b5dddc95fae
2018-09-09 15:09:38 -04:00
Ryan C. Gordon
cc9ee08b65 gles2: Major renderer optimization. Work in progress!
This moves all the rendering to a command list that is flushed to the GL as
necessary, making most common activities upload a single vertex buffer per
frame and dramatically reducing state changes. In pathological cases,
like Emscripten running on iOS's Safari, performance can go from a dozen
draw calls killing your performance to 1000 draw calls running smoothly.

This is work in progress, and not ready to ship. Among other things, it has
a hardcoded array that isn't checked for overflow. But the basic idea is
sound!

--HG--
branch : SDL-ryan-batching-renderer
extra : source : eae4631409c03d3b7ab2e87526193d86ce996ba8
2018-09-08 18:26:11 -04:00
Ryan C. Gordon
961a84f88e Created SDL-ryan-batching-renderer branch for the WIP renderer rewrite.
--HG--
branch : SDL-ryan-batching-renderer
2018-09-25 10:45:37 -04:00
Ryan C. Gordon
411f83f9a0 metal: Make sure layer drawableSize is adjusted on resize.
Fixes Bugzilla #4250.
2018-09-06 00:56:13 -04:00
Ryan C. Gordon
f3fc17b647 Fixed a comment typo.
--HG--
extra : rebase_source : 1fa59a26a2119f196ec2ac739f41f4b3fe22fbbe
2018-09-05 21:24:13 -04:00
Sam Lantinga
1e90b4fa70 Fixed bug 4002 - Android, nativeRunMain() fails on some phone with arm64-v8a
Sylvain

The issue is totally reproducible on P8 Lite.

"The dlopen() call doesn't include the app's native library directory. The behavior of  dlopen() by Android is not guaranteed".

Workaround in getMainSharedObject()

Just replace
    return library;
with
    return getContext().getApplicationInfo().nativeLibraryDir + "/" + library;
2018-09-05 15:54:46 -07:00
Sam Lantinga
b622604370 Speculatively disable rumble on the Razer Panthera Evo, which doesn't have rumble motors and probably hangs in the same way the Panthera does. 2018-09-05 15:28:06 -07:00
Sam Lantinga
89e2d81425 Updated Xcode library version to match libtool output with Ozkan's change 2018-09-05 13:04:50 -07:00
Sam Lantinga
303054db9e Don't overwrite the default binding when changing the binding for a controller that was using the default. 2018-09-05 12:16:01 -07:00
Sam Lantinga
756da8b068 Added binding for Mad Catz FightStick TE S+ (PS3) on Mac OS X 2018-09-05 11:24:23 -07:00
Sam Lantinga
e2d5f67170 Added support for the Razer Panthera Fightstick
Fixed bindings for the Mad Catz FightStick TE S+
2018-09-05 11:18:50 -07:00
Ozkan Sezer
65c879d930 CMakeLists.txt: fix typo SDL_SENSORS_DISABLED -> SDL_SENSOR_DISABLED 2018-09-02 23:57:06 +03:00
Ryan C. Gordon
2a81de7287 test: Makefile should copy .dat files for testoverlay2. 2018-09-02 00:35:11 -04:00
Ryan C. Gordon
daaa744f78 metal: SDL_UpdateYUVTexture shouldn't swap planes based on format. 2018-09-01 20:47:12 -04:00
Sam Lantinga
cd08cc2a4e Better fix to make sure we're only returning controllers from the HIDAPI joystick API 2018-08-31 18:10:21 -07:00
Sam Lantinga
c217b37797 Removed VID/PID 0x1532/0x0037, which was listed in the Linux kernel as a Razer Sabertooth, because at least one variant of the Razer DeathAdder mouse shows up with this VID/PID. 2018-08-31 17:47:34 -07:00
Ozkan Sezer
5bafa801d0 fix permissions 2018-08-30 12:50:10 +03:00
Sam Lantinga
9145df9aff Don't show the Razer Raiju sound interface as a game controller 2018-08-29 20:55:02 -07:00
Sam Lantinga
b0c85b0612 Fixed compiler warning and use higher precision in angle calculation 2018-08-29 20:23:42 -07:00
Sam Lantinga
35697771b2 Don't rumble Bluetooth PS4 controllers by default, as that switches the controller into extended input report mode, which breaks games that use DirectInput. 2018-08-29 20:23:39 -07:00
Sam Lantinga
d4ebcc0148 Fixed whitespace 2018-08-29 20:23:36 -07:00
Sam Lantinga
442ff08d98 Fixed Xbox One S Bluetooth support on Mac OS X 2018-08-29 18:56:54 -07:00
Ozkan Sezer
ff75017830 SDL_evdev.c: undefine _THIS before redefining it.
src/core/linux/SDL_evdev.c:104:1: warning: "_THIS" redefined
In file included from src/core/linux/../../events/SDL_events_c.h:26,
                 from src/core/linux/SDL_evdev.c:45:
src/core/linux/../../events/../video/SDL_sysvideo.h:146:1: warning: this is the location of the previous definition
2018-08-29 11:04:02 +03:00
Sam Lantinga
1f4205c2fd Fixed Windows build 2018-08-28 16:19:31 -07:00
Sam Lantinga
b0e3daa599 Fixed bug 4229 - Add support for ABGR format in DirectFB renderer
Alexandre

DirectFB supports 32-bit ABGR pixel format via DSPF_ABGR, but SDL doesn't map SDL_PIXELFORMAT_ABGR8888 to DSPF_ABGR.

A patch is attached and should add support for ABGR pixel format devices.
2018-08-28 13:37:11 -07:00
Andreas Müller
d5e745d62e GLES2: Get sin/cos out of vertex shader
The only place angle is activated and causes effect is RenderCopyEx. All other
methods which use vertex shader, leave angle disabled and cause useless sin/cos
calculation in shader.

To get around shader's interface is changed to a vector that contains results
of sin and cos. To behave properly when disabled, cos value is set with offset
-1.0 making 0.0 default when deactivated.

As nice side effect it simplifies GLES2_UpdateVertexBuffer: All attributes are
vectors now.

Additional background:

* On RaspberryPi it gives a performace win for operations. Tested with
  [1] numbers go down for 5-10% (not easy to estimate due to huge variation).
* SDL_RenderCopyEx was tested with [2]
* It works around left rotated display caused by low accuracy sin implemetation
  in RaspberryPi/VC4 [3]

[1] https://github.com/schnitzeltony/sdl2box
[2] https://github.com/schnitzeltony/sdl2rendercopyex
[3] https://github.com/anholt/mesa/issues/110

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
2018-08-28 12:57:51 -07:00
Sam Lantinga
a0acea5bcc Fixed the DirectFB renderer not being enabled in autoconf builds 2018-08-27 11:51:05 -07:00
Sam Lantinga
563e2c2d71 Update the cursor clipping each frame, in case it was stolen by another application. 2018-08-26 20:37:23 -07:00
Sam Lantinga
3e67665e66 Only reset the clip rect if it's currently the rect we previously clipped.
This prevents us from clearing the clip rect globally when another application has set it.

There's also an experimental change to regularly update the clip rect for a window defensively, in case someone else has reset it. It works well, but I don't know if it's cheap enough to call as frequently as it would be called now, and might have other undesirable side effects.

Also fixed whitespace and SDL coding style
2018-08-26 10:34:23 -07:00
Sam Lantinga
8dab95ee3d Implement SDL_HapticStopEffect on Android (thanks Rachel!) 2018-08-24 10:41:57 -07:00
Jeremy Ong
69441bd02e vulkan: SDL_Vulkan_GetInstanceExtensions should accept a NULL window.
Fixes Bugzilla #4235.
2018-08-24 09:49:48 -04:00
Sam Lantinga
4ab7b3d88b Implemented SDL_GetDisplayOrientation() on Android (thanks Rachel!) 2018-08-23 14:05:25 -07:00
Ryan C. Gordon
71439d04cb cmake: add sensor subsystem to the build.
--HG--
extra : amend_source : 1bf21ac4f6adc8b9b631b6e45b46aef7640f3b9c
2018-08-23 14:32:30 -04:00
Sam Lantinga
bd663e048e Added documentation for additional Android sensors 2018-08-23 10:51:54 -07:00
Thomas Perl
485e0cf698 Fix "unresponsible application" issues in Wayland
Polling without wl_display_flush() never responds to ping requests.
In that case ping-pong works only on other events, such as user input
or on frame swapped.

From https://git.merproject.org/mer-core/libsdl/merge_requests/3
Original author: Alexander Akulich <a.akulich@omprussia.ru>
2018-08-23 14:47:38 +02:00
Sam Lantinga
07d64253a1 Fixed bug 4324 - Xcode 10 - more cleanup for macOS and iOS projects
Dominik Reichardt

Xcode warns about
"Traditional headermap style is no longer supported; please migrate to using separate headermaps and set 'ALWAYS_SEARCH_USER_PATHS' to NO."
Just doing the latter is enough to silence the warning without ill effects on compiling. This affects the macOS Xcode projects as well as the iOS projects. Definitely not a bug but an annoying warning that could go away.
2018-10-18 15:41:50 -07:00
Sam Lantinga
0a07b5b836 Fixed bug 4324 - Xcode 10 - more cleanup for macOS and iOS projects
Dominik Reichardt

Similar to bug/patch #4228, the iOS Demo Xcode project needs to add the CoreBluetooth framework.
2018-10-18 15:40:39 -07:00
Ryan C. Gordon
ad1b9e7cfc cocoa: Fix OpenGL rendering on macOS 10.14 ("Mojave").
Fixes Bugzilla #4272.

--HG--
extra : rebase_source : 897af85e5a1a52c9cba466abf980370c995b7a11
extra : amend_source : 3363fd3637833aad5621aebb7089bbabf6e7c754
2018-10-18 12:05:05 -04:00
Ryan C. Gordon
c247695f19 cocoa: GL_GetDrawableSize only uses -[NSView convertRectToBacking] for highDPI.
On Mojave, this will report large numbers for retina displays in fullscreen
mode, which isn't how it works on previous versions.

--HG--
extra : rebase_source : 175a37f93b8e582bcd3ed80b93e6d40597ce7039
2018-10-18 11:59:48 -04:00
Ozkan Sezer
4e3ee3ee71 use less ancient versions of autofoo scripts 2018-10-18 11:58:00 +03:00
Sam Lantinga
afeced9c72 Fixed bug 4318 - Android move Haptic code to API26 class
Sylvain

- Create SDLHapticHandler_API26
- No need of reflection since SDL2 compile with Android 26 as a min requirement.
- remove spaces
2018-10-16 15:00:43 -07:00
Sam Lantinga
fd48717bca Fixed updating the rumble parameters on Linux 2018-10-16 14:58:07 -07:00
Sam Lantinga
b940c2ed0d Support vibration magnitude on Android 8.0 (thanks Rachel!) 2018-10-16 08:29:27 -07:00
Ozkan Sezer
6967f6fcb9 SDL_power.c: Adjust SDL_POWER_DISABLED ifdefs to avoid zero-size array
Otherwise if SDL_POWER_DISABLED is disabled (eg with --disable-power):

... with clang -pedantic:
src/power/SDL_power.c:48:50: warning: use of GNU empty initializer extension [-Wgnu-empty-initializer]
static SDL_GetPowerInfo_Impl implementations[] = {
                                                 ^
src/power/SDL_power.c:48:50: warning: zero size arrays are an extension [-Wzero-length-array]
2 warnings generated.

... with gcc -pedantic:
src/power/SDL_power.c:48:50: warning: ISO C forbids empty initializer braces [-Wpedantic]
src/power/SDL_power.c:48:50: warning: ISO C forbids empty initializer braces [-Wpedantic]
 static SDL_GetPowerInfo_Impl implementations[] = {
                                                  ^
src/power/SDL_power.c:48:30: error: zero or negative size array ‘implementations’
 static SDL_GetPowerInfo_Impl implementations[] = {
                              ^~~~~~~~~~~~~~~

... with Watcom:
./src/power/SDL_power.c(85): Error! E1112: Initializer list cannot be empty
2018-10-15 11:01:00 +03:00
Ryan C. Gordon
6f747d79e4 x11: Don't hardcode limit on lines of text in message boxes.
Plus other text parsing fixes.

Fixes Bugzilla #4306.
2018-10-15 00:46:43 -04:00
Ozkan Sezer
87c7eb2365 add a minimal config and makefile to test watcom/os2 builds. 2018-10-14 23:56:56 +03:00
Ozkan Sezer
f0a2bead1e SDL_GetPowerInfo_Hardwired is static in SDL_power.c
.. therefore, comment out its extern declaration in SDL_syspower.h.
2018-10-14 23:55:02 +03:00
Ozkan Sezer
460ecb4500 add missing include. 2018-10-14 23:50:50 +03:00
Alex Szpakowski
88fcd97fbb iOS: Don't ignore the requested alpha bit size when determining whether to use an RGBA8 backbuffer. 2018-10-14 17:26:10 -03:00
Charlie Birks
7784f5e8b7 Emscripten: Load eglQueryString and eglGetError
This prevents an assertion on context creation failure (calling a null
function pointer).
2018-10-13 17:18:59 +01:00
Alex Szpakowski
e311ac3bdf metal: Fix SDL_RenderReadPixels to wait for the GPU to finish rendering to the active texture before reading its pixels. 2018-10-13 03:36:42 -03:00
Alex Szpakowski
7144595a99 macOS: Fixed MoltenVK dynamic library loading code. 2018-10-12 23:23:52 -03:00
Alex Szpakowski
8b260f68d2 metal: Fix high dpi and resizing on macOS, and clean up iOS code. Fixes bug #4250. 2018-10-12 17:55:42 -03:00
Sam Lantinga
100e8e727f Allow Android haptics to work when SDL is reinitialized (thanks Rachel!) 2018-10-11 15:14:48 -07:00
Ozkan Sezer
5733b6d7b9 SDL_thread.h: undefine SDL_CreateThreadWithStackSize before redefining. 2018-10-12 01:03:40 +03:00
Ryan C. Gordon
3c8fb7cfe8 thread: make SDL_CreateThreadWithStackSize() a public API.
--HG--
extra : rebase_source : 61cb2213bd8b0496a43b2175b6e526e8a1eb6a2c
2018-10-11 16:40:01 -04:00
Cameron Gutman
78fd489f4a Implement SuspendScreenSaver for Win32
Creating a full-screen SDL renderer on Windows will keep the screensaver
suspended by DirectX, as is default for full-screen DX applications. However,
for applications that render in windowed-mode, the screensaver will
still kick in, even if SDL_DisableScreenSaver() is called or
SDL_HINT_VIDEO_ALLOW_SCREENSAVER is set to 0 (default). Implementing
a SuspendScreenSaver() function for Win32 fixes this behavior.
2018-10-09 23:01:43 -07:00
Ryan C. Gordon
42e05971ed audio: All device names reported by SDL must be unique.
This means that if you have two devices named "Soundblaster Pro" in your
machine, one will be reported as "Soundblaster Pro" and the other as
"Soundblaster Pro (2)".

This makes it so you can't into a position where one of your devices can't
be opened because another is sitting on the same name.

--HG--
extra : rebase_source : 42a75cc0b282ece7097b6f524bcaccca314e0ea9
2018-10-10 15:20:56 -04:00
Ryan C. Gordon
ca08630740 audio: clean_out_device_list() already sets this flag to false for us.
--HG--
extra : rebase_source : df851854c497ef14bd6a1659b58d630aee0eebe2
2018-10-10 14:55:24 -04:00
Sam Lantinga
31490ce318 Added support for surround sound and float audio on Android 2018-10-09 20:12:43 -07:00
Sam Lantinga
223bea8f0e Removed unneeded variable qualifiers 2018-10-09 20:12:40 -07:00
Sam Lantinga
3c3dc10de5 Fixed bug 4188 - Software renderer SDL_RenderCopyEx blits corrupt image under certain cases
duckgrease

SDL_RenderCopyEx blits wrong image (in some cases it's bunch of alternating horizontal lines, some cases it's image from the wrong coordinate, and in some cases it's just a bunch of garbled pixels), when the following conditions are met:
- Use software renderer.
- Enable either horizontal or vertical flip.
- source and destination rectangles must have same width and height, and must be smaller than the size of the texture.
- source rectangle's X and Y coordinates must be 0.
2018-10-09 17:41:40 -07:00
Ryan C. Gordon
06504eb80b kmsdrm: find available card if called without index.
This work was done by Michael Grzeschik, I just cleaned up the patch a little.

Fixes Bugzilla #4241.

--HG--
extra : rebase_source : 388917b8a360cd01d53e90ccd455240653743dac
2018-10-09 00:27:55 -04:00
Sam Lantinga
ee865fc0f4 This device gets Xinput driver loaded on windows. 2018-10-08 19:46:01 -07:00
Sam Lantinga
c34c6e1474 Fixed life-cycle issues with two activities sharing HIDDeviceManager 2018-10-08 12:49:30 -07:00
Sam Lantinga
d6cb11d8cc Close on shutdown, for consistency 2018-10-08 12:49:28 -07:00
Sam Lantinga
1faa0d69ec Trying to track down NullPointerException in USB input thread 2018-10-08 12:49:26 -07:00
Sam Lantinga
3abd7b6d7a Don't flash the navigation bar when destroying a fullscreen SDL window 2018-10-08 12:49:25 -07:00
Sam Lantinga
d0433b8486 There are legitimate reasons to skip full cleanup at shutdown, don't assert in that case. 2018-10-08 12:49:23 -07:00
Sam Lantinga
ff6aab8c51 Fixed bug 4296 - kmsdrm video driver leaks 1 bo in KMSDRM_GLES_SetupCrtc()
Icenowy Zheng

One front buffer is locked in GLES_SetupCrtc() and overrides the next_bo just locked in KMSDRM_GLES_SwapWindow, then the next_bo gets lost and is not released even when quitting the video.

It may leads to problems with GLES drivers that doesn't clean up GBM correctly if there's any bo left (e.g. the Mali Utgard r6p2 blob). In the case of Mali Utgard r6p2 blob, the DRM device file is still hold by the blob, and if you try to SDL_Quit to let another program to run (this is done by EmulationStation), the new program will fail to open DRM device.
2018-10-05 17:06:05 -07:00
Ryan C. Gordon
8ca5da741d wayland: Fixed missing window sizing events.
Fixes Bugzilla #4242.

--HG--
extra : rebase_source : a4acd992b5d392711e0d4e4b8b5d73c1e0b83145
2018-10-05 17:24:03 -04:00
Sam Lantinga
a729c62a9e It turns out HIDAPI for Xbox controllers doesn't allow background input, so we won't enable it by default on Windows. 2018-10-05 01:41:59 -07:00
Sam Lantinga
cfefb1c1ed Allow SDL to use ReLinker if present.
This fixes issues for applications that have a large number of shared libraries
For more information, see https://github.com/KeepSafe/ReLinker for ReLinker's repository.
2018-10-04 16:29:17 -07:00
Sam Lantinga
61000206da Fixed updating bindings for controllers using the wildcard mappings 2018-10-04 15:23:42 -07:00
Sam Lantinga
315f87a31f Update documentation to note that this hint works on Android too (thanks Trent!) 2018-10-03 15:48:26 -07:00
Ryan C. Gordon
a6ce324072 evdev: Don't initialize struct sigaction with "{ 0 }".
It causes warnings on some platforms, depending on the actual definition of
sigaction, and since this is static data, it'll be zero'd out anyhow.

--HG--
extra : rebase_source : 5889563dfd03ef7c2a1443eace02339e4b470437
2018-10-03 16:54:24 -04:00
Sam Lantinga
ab13676713 Make sure we don't read and write to HIDAPI at the same time, it's not thread-safe on Windows 2018-10-02 20:51:33 -07:00
Sam Lantinga
4b50a017c6 The Amlogic X96 is a set-top box 2018-10-02 13:17:31 -07:00
Sam Lantinga
ebc8d2ffb2 Fixed UnsatisfiedLinkError when initializing the HIDDeviceManager in some cases 2018-10-01 14:52:28 -07:00
Sam Lantinga
daadbba5dc Working on bug 3921 - Add some Fastpath to BlitNtoNKey and BlitNtoNKeyCopyAlpha
Sylvain

I did various benches. with clang 6.0.0 on linux, and ndk-r16b on android (NDK_TOOLCHAIN_VERSION=clang).

- still see a x10 speed factor.
- with duff_loops, it does not use vectorisation (but doesn't seem to be a problem).

on linux my patch is already at full speed on -O2, whereas the duff_loops need -O3 (200 ms at -03, and 300ms at -02).

I realized that on Android, I had a slight variation which fits best.
both on linux with -O2 and -O3, and on android with 02/03 and armeabi-v7a/arm64.

Here's the patch.
2018-10-01 14:43:03 -07:00
Ozkan Sezer
475d230846 SDL_blit_N.c (BlitNtoNKeyCopyAlpha): fix -Wshadow warnings by adding _
suffix to the temp Pixel local in the DUFFS_LOOP.
SDL_blit.h (ASSEMBLE_RGB):  add _ prefix to temp Pixel locals to avoid
  any possible shadowings.


The warnings were like the following:

In file included from src/video/SDL_blit_N.c:26:0:
src/video/SDL_blit_N.c: In function 'BlitNtoNKeyCopyAlpha':
src/video/SDL_blit_N.c:2421:24: warning: declaration of 'Pixel' shadows a previous local [-Wshadow]
                 Uint32 Pixel = ((*src32 & rgbmask) == ckey) ? *dst32 : *src32;
                        ^
src/video/SDL_blit.h:475:21: note: in definition of macro 'DUFFS_LOOP8'
     case 0: do {    pixel_copy_increment; /* fallthrough */             \
                     ^
src/video/SDL_blit_N.c:2419:13: note: in expansion of macro 'DUFFS_LOOP'
             DUFFS_LOOP(
             ^
src/video/SDL_blit_N.c:2399:12: warning: shadowed declaration is here [-Wshadow]
     Uint32 Pixel;
            ^
2018-10-01 21:29:11 +03:00
Sam Lantinga
83b1e2e006 commit c6b28f46b8116552ec2b38d1d3c8535df28ba7a1
Author: Anthony Pesch <inolen@gmail.com>
Date:   Fri May 4 20:21:21 2018 -0400

    Added SDL_AUDIO_ALLOW_SAMPLES_CHANGE flag enabling users of SDL_OpenAudioDevice to get
    the sample size of the actual hardware buffer vs having a stream created to handle the
    delta
2018-10-01 09:47:10 -07:00
Sam Lantinga
300c4a6c44 Added display event files to the Visual Studio projects 2018-08-23 02:48:47 -07:00
Sam Lantinga
6410754bce Added display event files to the Mac OS X project 2018-08-23 02:24:31 -07:00
Sam Lantinga
582b07ab60 Fixed build 2018-08-23 02:21:17 -07:00
Sam Lantinga
e80bcf4a32 Moved display orientation handling on iOS out to a separate function for Qt apps 2018-08-22 23:47:29 -07:00
Sam Lantinga
f69485f745 Added SDL_GetDisplayOrientation() to get the display orientation, and added a new event SDL_DISPLAYEVENT to notify the application when the orientation changes.
Documented the values returned by the accelerometer and gyroscope sensors
2018-08-22 21:48:28 -07:00
Sam Lantinga
e1853645b8 Fixed crash trying to open HIDAPI controller as a haptics device on Windows 2018-08-22 17:44:28 -07:00
Sam Lantinga
16ffa91778 Updated required Android SDK to API 26, to match Google's new App Store requirements 2018-08-21 20:46:25 -07:00
Sam Lantinga
128af29aa5 Doh.. __IPHONEOS__ is defined on tvOS 2018-08-21 20:38:22 -07:00
Sam Lantinga
40e8a6e146 Don't use CoreMotion on tvOS 2018-08-21 20:34:09 -07:00
Sam Lantinga
429db785ea Fixed UWP build 2018-08-21 20:20:54 -07:00
Sam Lantinga
34a51417a8 Moved SDL_IsTablet() to a cross-platform API function 2018-08-21 20:03:54 -07:00
Sam Lantinga
b8c45ccb9c Removed dependency on C++ runtime on iOS
--HG--
rename : src/hidapi/ios/hid.mm => src/hidapi/ios/hid.m
2018-08-21 19:42:19 -07:00
Sam Lantinga
da334dae1a Added the iOS sensor implementation 2018-08-21 17:24:12 -07:00
Sam Lantinga
53f72becea Fixed bug 4228 - Clean-up Xcode projects
C.W. Betts

This cleans up the Xcode project by setting the Xcode groups to the corresponding directories. This also removes the Resources folder in OS X's Products group and adds the CoreBluetooth framework to the iOS tests (this is needed due to the addition of hidapi.
2018-08-21 16:47:44 -07:00
Sam Lantinga
ef50742f11 Fixed duplicate definition of SDL_JoystickID 2018-08-21 13:44:11 -07:00
Sam Lantinga
6e5c7a33a8 Added the dummy sensor driver to the Visual Studio projects 2018-08-21 13:42:44 -07:00
Sam Lantinga
2ca16d7410 Added a dummy sensor driver 2018-08-21 13:29:21 -07:00
Sam Lantinga
09c276f295 First pass on the new SDL sensor API 2018-08-21 12:11:34 -07:00
Sam Lantinga
ea0f29374b Don't crash if the app doesn't have Bluetooth permissions 2018-08-21 11:59:13 -07:00
Sam Lantinga
50719c8609 By default just build for 32-bit ARM and x86 2018-08-21 11:44:08 -07:00
Sam Lantinga
776fafab15 Add SDL_IsTablet() to Android and iOS SDL. 2018-08-21 11:23:47 -07:00
Sam Lantinga
abfa8df22d Don't crash if the app doesn't have Bluetooth permissions 2018-08-21 11:07:56 -07:00
Sam Lantinga
8a76b57970 Fixed Android build error 2018-08-21 10:37:26 -07:00
Sam Lantinga
233a8bc619 Fixed Android build error 2018-08-21 10:25:30 -07:00
Sam Lantinga
883aa6e737 Fixed warnings building on Mac OS X 64-bit 2018-08-20 21:19:17 -07:00
Sam Lantinga
4e8e3ba35c Fixed code style 2018-08-20 21:18:56 -07:00
Ryan Speets
34b4282e0f Emscripten: Fixed SDL_SYSTEM_CURSOR_SIZEALL 2018-08-18 12:30:04 +01:00
Ozkan Sezer
71027120f3 SDL_hidapi_ps4.c: define NTDDI_VISTA / _WIN32_WINNT_VISTA if not defined
it still needs a Vista or newer Platform SDK to build, though.
2018-08-16 11:01:02 +03:00
Sam Lantinga
177487e507 Use a single hint for both Xbox 360 and Xbox One controllers, since they are often the same driver. 2018-08-15 23:35:54 -07:00
Sam Lantinga
6e0f2d6619 Use the HIDAPI driver for Xbox controllers on Windows, and determine the XInput mapping at runtime for extended functionality like rumble and guide button. 2018-08-15 23:14:45 -07:00
Sam Lantinga
8235f84320 Use a unified name list for Xbox 360 and Xbox One controllers for drivers that can handle both 2018-08-15 23:14:43 -07:00
Sam Lantinga
1ac1a37f85 Added Windows Xbox controller state packet handling, for completeness. 2018-08-15 19:53:36 -07:00
Sam Lantinga
4d30496429 Fixed input from the Steam Virtual Gamepad on Mac OS X 2018-08-15 19:53:34 -07:00
Sam Lantinga
ea70c5b7a4 Use SDL specific window class to avoid conflicting with Steam 2018-08-15 19:53:31 -07:00
Sam Lantinga
5cffb66660 Catch device removal as well as device arrival on Windows 2018-08-15 19:53:30 -07:00
Sam Lantinga
242d67f07b Turned off debug messages 2018-08-15 19:53:28 -07:00
Sam Lantinga
ae47f3aa91 Remove the HIDAPI device if we get a read error from it
This fixes detecting PS4 controller disconnect on Mac OS X, where there isn't any device removed notification
2018-08-15 19:53:26 -07:00
Sam Lantinga
a7e38096ba Fixed Mac OS X build 2018-08-15 19:53:24 -07:00
Sam Lantinga
b29504064b Polling hid_enumerate() every 3 seconds causes freezes and stutters on some USB audio devices and mice.
We'll only enumerate devices when we get notification that the system devices have changed
2018-08-15 19:53:22 -07:00
Ryan C. Gordon
5733323e40 libm: one more static analysis fix. 2018-08-10 15:22:02 -04:00
Ryan C. Gordon
20e362b11e haiku: Patched to compile with new joystick interfaces. 2018-08-10 15:04:08 -04:00
Ryan C. Gordon
9440c9abd6 bsd: Patched to compile.
(I think.)
2018-08-10 14:54:26 -04:00
Ryan C. Gordon
cf7dd1d52c bsd: Update joystick code for new interfaces.
(this is an untested push to see if buildbot likes it.)
2018-08-10 14:42:40 -04:00
Ryan C. Gordon
0cd3f11834 emscripten: Patched to compile with new joystick interfaces. 2018-08-10 14:32:30 -04:00
Ryan C. Gordon
fe06d7d968 joystick: define inline to SDL_INLINE 2018-08-10 14:10:47 -04:00
Ryan C. Gordon
b44008f1ac joystick: #if 0'd out some things that aren't currently used.
Fixes some compiler warnings.
2018-08-10 14:09:44 -04:00
Ozkan Sezer
6432de4a4b SDL_hidapi_ps4.c: lowercase windows header names. 2018-08-10 11:50:55 +03:00
Ozkan Sezer
e412b58e6b chmod -x Android.mk 2018-08-10 11:50:01 +03:00
Sam Lantinga
45352c8e76 Re-enabled the HIDAPI joystick driver on Windows and Mac OS X 2018-08-09 22:53:43 -07:00
Sam Lantinga
d99ccf6754 Added missing files from previous commits 2018-08-09 16:05:48 -07:00
Sam Lantinga
414d526420 Added notes that this code was contributed by Valve 2018-08-09 16:04:45 -07:00
Sam Lantinga
fa59af0af0 There's no controller that's supported by both XInput and HIDAPI 2018-08-09 16:04:34 -07:00
Sam Lantinga
1e8a089ec1 Don't update the device list for devices we know aren't supported
This should reduce HID enumeration (hitting the USB bus) if for some reason we're getting spammed with false device insert/removal events
2018-08-09 16:04:30 -07:00
Sam Lantinga
a33cd77b54 The MINIX NEO-U1 is now being reported as Android TV 2018-08-09 16:04:25 -07:00
Sam Lantinga
da3990ef7d Sam Lantinga <slouken@libsdl.org> 2018-08-06 13:00 -0700
Backed out changeset 448e9f627e71
http://hg.libsdl.org/SDL/rev/e1f4191461a0
2018-08-09 16:04:21 -07:00
Sam Lantinga
a1be1fdcfb Sam Lantinga <slouken@libsdl.org> 2018-08-06 11:58 -0700
Removed mapping for VID/PID 0x0079/0x0006, which is a generic PCB used in many different devices
http://hg.libsdl.org/SDL/rev/448e9f627e71
2018-08-09 16:04:18 -07:00
Sam Lantinga
2b7a44c3e2 SDL: disable HIDAPI in SDL on Windows/Mac. 2018-08-09 16:03:55 -07:00
Sam Lantinga
29023f51e8 Worked around bug with Sony PS Now PS3 controller where DirectInput polling will continue to return success after the controller is unplugged.
The code is now reliant on SDL_PrivateJoystickAdded() and SDL_PrivateJoystickRemoved() being called correctly when devices are added or removed on Windows
2018-08-09 16:03:50 -07:00
Sam Lantinga
90f9ce1e41 Fixed Windows build 2018-08-09 16:03:29 -07:00
Sam Lantinga
db39b4811f Added HIDAPI joystick drivers for more consistent support for Xbox, PS4 and Nintendo Switch Pro controller support across platforms.
Added SDL_GameControllerRumble() and SDL_JoystickRumble() for simple force feedback outside of the SDL haptics API
2018-08-09 16:00:17 -07:00
Ryan C. Gordon
13edfebf3b libm: Don't let Visual Studio generate an implicit memset() call. 2018-08-08 15:39:20 -04:00
Ryan C. Gordon
fd89008004 backout INFINITY change...of course Visual Studio doesn't have it. 2018-08-08 12:36:54 -04:00
Ryan C. Gordon
87c0669163 e_exp: One more compiler warning. 2018-08-08 12:19:01 -04:00
Ryan C. Gordon
a6ccb4f336 libm: Fixed all static analysis warnings. 2018-08-08 12:13:56 -04:00
Ryan C. Gordon
0e7971862f e_exp: Fixed compiler warning on Visual Studio. 2018-08-08 10:26:22 -04:00
Ryan C. Gordon
28f6d22f39 haiku: Rename internal functions from BE_* to HAIKU_*
Fixes Bugzilla #2349.
2018-08-07 18:07:11 -04:00
Ryan C. Gordon
f04deb0b0e configure: Make wayland sources depend on generated headers.
Otherwise occasionally the sources will try to compile before the headers it
needs are generated.

Fixes Bugzilla #3977.
2018-08-07 17:28:07 -04:00
Ryan C. Gordon
ab610a7584 evdev: On sudden termination, make sure keyboard isn't lost (thanks, Tadek!)
"In release 2.0.6, when Linux evdev keyboard support has been moved to a
separate source file, a feature was added to disable normal keyboard event
processing to prevent "spilling" keystrokes to background virtual console.

This feature has one unpleasant side effect: if application fails to call
`SDL_Exit` before termination or crashes with fatal signal, console is left
in unusable state with keyboard not working and no possibility to switch
virtual console. If user has a chance, he can login remotely and restore
keyboard with `kbd_mode`, otherwise the only option is to reboot the machine.

This patch fixes that problem by intercepting fatal signals (with `sigaction`)
and process termination (with `atexit`), to restore keyboard state, if it
wasn't properly restored with `SDL_Exit`.

The function registered with `atexit` also restores original signal handlers,
to prevent leaving invalid handlers after SDL library is unloaded, if it was
loaded dynamically with `dlopen`.

No signal handlers or `atexit` function are installed if SDL boolean hint
`SDL_HINT_NO_SIGNAL_HANDLERS` is `SDL_TRUE`.

Additionally, if environment variable `SDL_INPUT_LINUX_KEEP_KBD` exists,
keyboard initialization function completely skips disabling keyboard. This
can be useful for debugging."

Fixes Bugzilla #4193.
2018-08-07 16:56:46 -04:00
Ryan C. Gordon
c041a8ab67 alsa: optionally run entire pipeline non-blocking. 2018-08-07 16:49:18 -04:00
Ryan C. Gordon
8b5143fc7d audio: Deal with device shutdown more carefully.
This would cause problems in various ways, but specifically triggers an
assert when you close a WASAPI capture device in an app running over RDP.

Related to (but not the actual bug) in Bugzilla #3924.
2018-08-07 13:04:15 -04:00
Mai Lavelle
b193f2c097 haptic: Fix initial detection of haptic devices on Linux system
SDL_UDEV_Scan must be called during SDL_SYS_HapticInit to ensure devices
outside of the 0-31 range are added to the list of haptic devices.

Fixes Bugzilla #3923.

--HG--
extra : histedit_source : 3244924c52322015bb86e5aa1168270ac457f7f7
2018-08-07 12:06:31 -04:00
Sam Lantinga
ab526d283f Backed out changeset 448e9f627e71
It turns out the mapping is correct, just the name was confusing
2018-08-06 13:00:11 -07:00
Sam Lantinga
0d0879fbfc Removed mapping for VID/PID 0x0079/0x0006, which is a generic PCB used in many different devices
Different device with same vid/pic that is kind of a Saitek shape:
https://www.trust.com/en/product/17416-gxt-24-runa-compact-gamepad

n64 with same ID
https://bbs.archlinux.org/viewtopic.php?id=163488

PS shaped with numbers for buttons
https://pineight.com/mw/index.php?title=USB_game_controller#DragonRise_Inc._Generic_USB_Joystick

fightstick with same vid/pid
https://retropie.org.uk/forum/topic/7594/bartop-2-player-zero-delay-encoders-not-working
2018-08-06 11:58:08 -07:00
Ozkan Sezer
bda34ed63c SDL_expf: return SDL_exp() instead of SDL_uclibc_exp() for consistency. 2018-08-05 10:01:01 +03:00
Ethan Lee
54ce812205 SDL_exp 2018-08-04 11:52:46 -04:00
Ryan C. Gordon
b41191fbf2 cmake: use WINDOWS instead of WIN32.
--HG--
extra : histedit_source : be7d5850d1e2d3ca834da337a4ac88dca63c0547
2018-08-02 16:21:43 -04:00
Ryan C. Gordon
45974c3953 Some drag'and'drop improvements.
First: disable d'n'd events by default; most apps don't need these at all, and
if an app doesn't explicitly handle these, each drop on the window will cause
a memory leak if the events are enabled. This follows the guidelines we have
for SDL_TEXTINPUT events already.

Second: when events are enabled or disabled, signal the video layer, as it
might be able to inform the OS, causing UI changes or optimizations (for
example, dropping a file icon on a Cocoa app that isn't accepting drops will
cause macOS to show a rejection animation instead of the drop operation just
vanishing into the ether, X11 might show a different cursor when dragging
onto an accepting window, etc).

Third: fill in the drop event details in the test library and enable the
events in testwm.c for making sure this all works as expected.

--HG--
extra : rebase_source : a8d5c21e97b34dbd6ce88237863c084d8825350a
extra : amend_source : 81c4acd9f5ca8dc5a4642b250ca6b42fd79cac87
2018-08-02 16:03:47 -04:00
Ryan C. Gordon
cb84e488f5 Backed out changeset dfebed374d73.
This change isn't correct. See comments in Bugzilla #4183.

--HG--
extra : rebase_source : a083f2f9dbda7cebffc8629e29c7205133d35c21
2018-07-22 19:42:08 -04:00
Ryan C. Gordon
d1d7e776ed libm: Fixed signature mismatches for __ieee754_rem_pio2 and __kernel_rem_pio2.
Fixes Bugzilla #4201.

--HG--
extra : rebase_source : 66bdbdda3e4821bd87fcecf9d4f10f0a522f5a2e
2018-07-22 19:40:42 -04:00
Ryan C. Gordon
50654a3801 windows: Fixed some Visual Studio warnings about shadowed variables.
Fixes Bugzilla #4118.

--HG--
extra : rebase_source : c724a73700dbbd51aae4ba885e3465cf3e5daf30
2018-07-22 19:28:27 -04:00
Vitaly Novichkov
2b79c7662d Remove "lib" prefix from DLL file on MinGW builds
closes bug #4209.
2018-06-29 18:29:17 +03:00
Marc Di Luzio
750ab3ed08 Ensure we still clear the X locale modifiers even if not compiled with ibus or fcitx support 2018-07-12 16:52:45 +01:00
Ryan C. Gordon
31b032bcc3 dbus: Deal with undefined behavior with va_args.
Parse out a copy of the varargs ourselves to get to the reply portion, since
the original passed to D-Bus might modify or not modify the caller's copy,
depending on system ABI.
2018-07-13 17:53:24 -04:00
Sam Lantinga
abfd37842e Clean up captured pointer code to avoid logcat clutter on pre-8.0 systems (thanks Rachel!) 2018-07-13 12:55:50 -07:00
Sam Lantinga
a9bf4b69ea More controller drivers support CARTESIAN coordinates.
This fixes rumble on the Saitek Cyborg V.3 Rumble Pad
2018-07-12 13:28:15 -07:00
Sam Lantinga
bbc117137c Allow trapping the back button so right mouse click can work on some Android systems (thanks Rachel!)
Also, added a function SDL_AndroidBackButton() so applications can respond to the back button directly
2018-07-12 13:28:13 -07:00
Ozkan Sezer
b8c51e817d ltmain.sh: make OSX autofoo builds' compatibility version match Xcode builds.
closes bug #4208.
2018-07-05 23:01:10 +03:00
Wohlstand
0b7134ff2c Fixed bug 4210 - SSE2-based converter makes junk result of S32 -> Float
At the HG state e604fe493d45, 64-bit assemblies are using SSE2-based resampler, produces junk sound when converting the S32 -> Float32 -> S16 chain. The `NEED_SCALAR_CONVERTER_FALLBACKS` thing works perfectly.

If I will find a reason that caused this mistake, I'll send a patch by myself.
2018-07-02 03:53:57 +03:00
Ozkan Sezer
89a9a997ec made the wasapi configury option consistent with others. 2018-07-01 19:50:00 +03:00
Ozkan Sezer
45850bad77 make WASAPI configurable in autofoo and cmake (default is on.)
closes bug #3798.
2018-07-01 17:01:04 +03:00
Ozkan Sezer
d88abddcbc SDL_windowstaskdialog.h (struct _TASKDIALOGCONFIG): make unions anonymous
otherwise build fails. (at least with my VS2005. and the code accesses the
arms of the unions anonymously anyway.)
2018-06-30 20:55:51 +03:00
Ozkan Sezer
e5213cf7df correct the comment correction.. 2018-06-30 20:10:40 +03:00
Ozkan Sezer
fca418b01b comment correction 2018-06-30 20:04:01 +03:00
Ozkan Sezer
09860178dc ran 'chmod -x' on two files 2018-06-30 20:03:23 +03:00
Ryan C. Gordon
7fbc806f83 Attempt to fix "cast from pointer to integer of different size" warnings. 2018-06-29 16:56:11 -04:00
Ryan C. Gordon
c2b083ec57 Corrected a comment. 2018-06-29 16:55:55 -04:00
Ryan C. Gordon
11298991b4 Patched to compile on Visual Studio (typo). 2018-06-25 23:00:38 -04:00
Ryan C. Gordon
d2fcd08e53 atomic: Fight with all the assemblers that don't like REP NOP. :/ 2018-06-25 16:34:16 -04:00
Ryan C. Gordon
db4f3793c0 atomic: Spin locks now try to use the x86 PAUSE instruction for short waits.
Fixes Bugzilla #4151.
2018-06-25 15:58:35 -04:00
Ryan C. Gordon
a9d21ce606 yuv: Patched to make static analysis happy (warned about unused variable). 2018-06-25 13:14:52 -04:00
Ryan C. Gordon
82f977c0b5 Deal with possible malloc(0) calls, as pointed out by static analysis. 2018-06-25 12:55:23 -04:00
Ryan C. Gordon
ecd3391777 wayland: Keep protocol XML files in-tree.
Now you don't need the latest Wayland installed to build with
newer protocols supported, as they'll build correctly; even if
your system can't use them, we can make intelligent decisions
at runtime about what's available on the current machine anyhow.

This also simplifies some logic and possible failure cases in
the configure and CMake scripts.

Fixes Bugzilla #4207.

--HG--
extra : amend_source : 1b786977f162f8a9e984f543a044e1a0da80f2bd
2018-06-25 09:37:25 -07:00
Ryan C. Gordon
c84533767a gles2: Whoops, overzealous copy/paste on my part. :) 2018-06-25 01:57:28 -04:00
Ryan C. Gordon
f881ef4e85 wayland: Implemented xdg-wm-base support.
This is just in parity with the existing zxdg-shell-unstable-v6 code. Making
the Wayland target robust (and uh, with title bars) is going to take a lot
of work on top of this.

--HG--
extra : amend_source : eb632de165fc406527a6627635382c22151223b5
2018-06-24 22:42:36 -07:00
Ryan C. Gordon
9ddbda088a android: Android.mk should only preserve debug symbols in debug builds.
Fixes Bugzilla #4111.
2018-06-24 15:21:01 -04:00
Ethan Lee
6066a1cf5f Fix Linux haptic scaling, add 2.1 FIXME 2018-05-04 21:58:39 -04:00
Ethan Lee
df8756b82e Filter both SIZE_CHANGED and RESIZED on any SIZE_CHANGED 2018-08-13 12:52:52 -04:00
Sam Lantinga
14b889610a Fixed bug 4220 - SDL_GL_CONTEXT_DEBUG_FLAG can fail silently on some Android devices 2018-10-01 09:40:58 -07:00
Sam Lantinga
41cc9b6a8f Corrected PS4 controller entry 2018-09-30 22:43:12 -07:00
Sam Lantinga
5d17c0979b Re-enable drag-and-drop events by default 2018-09-30 19:53:26 -07:00
Alex Szpakowski
a35f2b8c96 macOS: Fix a crash when the video subsystem quits, if SDL_MAC_NO_SANDBOX was defined when SDL was compiled. 2018-09-30 11:26:41 -03:00
Ryan C. Gordon
b21dca1f3c audio: disable NEON converters for now.
To be revisited after 2.0.9 ships!

(doesn't fix Bugzilla #4186, but stops the regression for the time being.)

--HG--
extra : rebase_source : f9f0740cfb6327c526e01a198a3ed049df1e9019
2018-09-29 16:48:15 -04:00
Sam Lantinga
88aa4120ba Fixed tablet detection on Android 2018-09-29 02:14:46 -07:00
Ozkan Sezer
c46431aacd fix permissions 2018-09-29 09:20:50 +03:00
Sam Lantinga
59f9488aa2 Mark a subsystem as dummy, not disabled, if it was intended to be compiled in.
From Tom Black:

I'm having problems initializing the sensor module. I'm compiling with a standard ./configure && make && sudo make install, and the module says it's enabled, but SDL_Init(SDL_INIT_EVERYTHING) is failing with SDL_GetError() returning "SDL not built with sensor support".
2018-09-28 21:19:27 -07:00
Sam Lantinga
567aeed888 commit 8f4dedc039190f5e734c47dcc4fc021b5793b659
Author: Michał Janiszewski <janisozaur+signed@gmail.com>
Date:   Fri Sep 28 20:38:04 2018 +0200

    CMake: fix building tests on Linux

    In case where libunwind.h has been found, it will be used by compiler,
    but linker wasn't updated to reflect use of this new library.
2018-09-28 21:03:39 -07:00
Sam Lantinga
744638c48c Fixed bug 4283 - SDL's version of memset is different from libc's
janisozaur

memset's documentation reads:

* The memset() function shall copy c (converted to an unsigned char) into each of the first n bytes of the object pointed to by s. (http://pubs.opengroup.org/onlinepubs/9699919799/functions/memset.html)
* Sets the first count characters of dest to the character c. (https://msdn.microsoft.com/en-us/library/1fdeehz6.aspx)
* write a byte to a byte string (https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/memset.3.html)

The highlight here is they all mean a single _byte_, even though memset receives a parameter of type int, which can hold more data than a single byte. SDL's implementation of memset, however, does not clear any of the higher bits, causing an erroneous behaviour when passed an argument bigger than 0xff.
2018-09-28 20:48:18 -07:00
Sam Lantinga
6911c8ca79 Ensure we wait on the surface resize before returning from setting fullscreen mode. 2018-09-28 20:39:57 -07:00
Ozkan Sezer
c9fd1e0c97 SDL_vsnprintf: implemented '+' flag for signed integers printing.
it is, of course, ignored for %u, %x, %o and %p.
2018-09-29 01:24:10 +03:00
Ozkan Sezer
fba16676b4 SDL_vsnprintf: fix numerics if both zero-padding and a field are given.
it used to place zeroes between the sign and the number. (space-padding
from within SDL_PrintString() seems OK:  spaces are added before sign.)

also fixed the maxlen handling if the number has a sign.
2018-09-29 00:51:24 +03:00
Ozkan Sezer
44a1eaf327 replace bool stuff in controller_type.h with SDL_bool.
remove bool<->SDL_bool dance in SDL_joystick.c:SDL_IsJoystickSteamController()
after the controller_type.h change.
2018-09-28 17:01:24 +03:00
Ozkan Sezer
775a941c1b SDL_hidapi_ps4.c: add HAVE_ENDPOINTVOLUME_H check to win32 volume code.
this makes it build with my old toolchain with mingw-w64 1.0.10 headers
2018-09-28 14:01:40 +03:00
Ozkan Sezer
51c040ed93 hidapi/windows/hid.c: comment out ntdef.h include after windows.h.
not necessary and can cause redefinition errors in some toolchains.
2018-09-28 13:44:10 +03:00
Ozkan Sezer
c85ef4d8f9 configury, cmake: add check for endpointvolume.h :
add HAVE_ENDPOINTVOLUME_H, HAVE_MMDEVICEAPI_H and HAVE_AUDIOCLIENT_H
in SDL_config.h.in, SDL_config.h.cmake, SDL_config_windows.h, and in
SDL_config_winrt.h.
2018-09-28 13:41:04 +03:00
Ozkan Sezer
91ed631b04 configury, cmake: make wasapi option independent of directx. 2018-09-28 11:30:50 +03:00
Sam Lantinga
695a3d1b65 Fixed building with Xcode 10.0 2018-09-28 01:18:54 -07:00
Ozkan Sezer
2ea7eb1b60 hidapi/windows/hid.c: fix misplaced #if 0
VendorID && ProductID are only used by the test main(),
otherwise they are unwanted globals.
2018-09-28 11:04:55 +03:00
Sam Lantinga
bbbc993a43 Fixed mingw-w64 build 2018-09-28 01:00:47 -07:00
Sam Lantinga
b77667a892 Fixed mingw-w64 build 2018-09-28 00:40:35 -07:00
Sam Lantinga
5df3c8ad49 Added patch notes for SDL 2.0.9 2018-09-27 23:54:40 -07:00
Sam Lantinga
31dde82573 Fixed bug 4277 - warnings patch
Sylvain

Patch a few warnings when using:
-Wmissing-prototypes -Wdocumentation -Wdocumentation-unknown-command

They are automatically enabled with -Wall
2018-09-27 14:56:29 -07:00
Ozkan Sezer
0bec5913e1 SDL_atomic.c, SDL_spinlock.c: use lock prefix with xchg in Watcom asm. 2018-09-27 11:55:02 +03:00
Ozkan Sezer
cef7f91ad7 SDL_vsnprintf() updates for zero-padding:
- remove force-enabling of pad_zeroes for %u for compatibility
 (was added in https://hg.libsdl.org/SDL/rev/701f4a25df89)
- ignore pad_zeroes for %s and %S
- ignore pad_zeroes for %d, %i and %u if a precision is given
2018-09-27 09:37:36 +03:00
Ryan C. Gordon
91ec11ca1c cocoa: Force an OpenGL context update when the window becomes key.
Fixes missing rendering on macOS 10.14 ("Mojave").

Fixes Bugzilla #4272.
2018-09-26 20:10:32 -04:00
Ozkan Sezer
b790f7c7f0 SDL_string.c (SDL_PrintString): avoid MSVC signed/unsigned mismatch warning 2018-09-27 01:10:50 +03:00
Ozkan Sezer
f3ab23f1b4 SDL_string.c (SDL_IntPrecisionAdjust): avoid MSVC generating a memset() 2018-09-27 01:00:50 +03:00
Ozkan Sezer
e37d95f937 SDL_vsnprintf: implement precision for the integral value printers. 2018-09-27 00:32:15 +03:00
Sam Lantinga
ff07432006 Fixed bug 4265 - SDL window falls to the bottom of the screen when dragged down and stuck there
Alexei

On WM_WINDOWPOSCHANGED event, WIN_UpdateClipCursor() is called. SDL_WINDOW_INPUT_FOCUS is set even when the mouse pointer is not inside the SDL window and therefore ClipCursor(&rect) is called. When dragging the window and rect.bottom=800 (i.e. the bottom edge of the screen) the SDL window is clipped to the bottom of the screen and it is not possible to move it back to the center of the screen.
2018-09-26 11:17:43 -07:00
Ozkan Sezer
d7099fbf16 SDL_string.c: added comments to three SDL_FormatInfo members. 2018-09-26 20:47:34 +03:00
Sam Lantinga
f355625f9c Updated version to 2.0.9 2018-09-26 10:08:14 -07:00
Ozkan Sezer
fcc9b1cd3c SDL_vsnprintf: when '.' is specified, take precision as 0 if it is < 0. 2018-09-26 17:11:40 +03:00
Ozkan Sezer
a52fce6463 SDL_vsnprintf: string printer now honors the precision. (bug #4263.) 2018-09-26 10:40:02 +03:00
Ozkan Sezer
f86cde1073 SDL_vsnprintf: %.* and %* now parse precision and width. (bug #4263.) 2018-09-26 10:38:40 +03:00
Sam Lantinga
675c561fef Fixed bug 4270 - Android HIDDeviceManager function needs to be public
Sylvain

Can't run an android app without declaring the JNI interface function as public.
2018-09-25 20:11:52 -07:00
Sam Lantinga
6631266fa4 Fixed bug 4268 - Android_JNI_OpenAudioDevice function has error
alittle

where iscapture == 1

1.param set error

(*env)->CallStaticIntMethod(env, mAudioManagerClass, midCaptureOpen, sampleRate, audioBuffer16Bit, audioBufferStereo, desiredBufferFrames)

param:audioBuffer16Bit need change to captureBuffer16Bit

2.logic error

if (is16Bit) {
        // ALITTLE Modify the source code
        if (iscapture) {
            audioBufferFrames = (*env)->GetArrayLength(env, (jshortArray)captureBuffer);
        } else {
            audioBufferPinned = (*env)->GetShortArrayElements(env, (jshortArray)audioBuffer, &isCopy);
            audioBufferFrames = (*env)->GetArrayLength(env, (jshortArray)audioBuffer);
        }
        // if (!iscapture) {
        //     audioBufferPinned = (*env)->GetShortArrayElements(env, (jshortArray)audioBuffer, &isCopy);
        // }
        // audioBufferFrames = (*env)->GetArrayLength(env, (jshortArray)audioBuffer);
    } else {
        // ALITTLE Modify the source code
        if (iscapture) {
            audioBufferFrames = (*env)->GetArrayLength(env, (jbyteArray)captureBuffer);
        } else {
            audioBufferPinned = (*env)->GetByteArrayElements(env, (jbyteArray)audioBuffer, &isCopy);
            audioBufferFrames = (*env)->GetArrayLength(env, (jbyteArray)audioBuffer);
        }
        // if (!iscapture) {
        //     audioBufferPinned = (*env)->GetByteArrayElements(env, (jbyteArray)audioBuffer, &isCopy);
        // }
        // audioBufferFrames = (*env)->GetArrayLength(env, (jbyteArray)audioBuffer);
    }
2018-09-25 20:08:51 -07:00
Sam Lantinga
9742633210 Removed redundant SDL_GetColorKey() call. (thanks Sylvain!) 2018-09-25 19:53:16 -07:00
Ethan Lee
f17afdc446 WinRT: Wait until audio device activation is complete and PrepDevice during OpenAudio 2018-09-25 01:45:12 -04:00
Sam Lantinga
ed5685aa59 Added 8bitdo SF 30 PRO controller support for Linux / DInput mode (thanks Frank Hartung) 2018-09-25 19:41:33 -07:00
Sam Lantinga
d4661b8795 Fixed building with newer Android NDK 2018-09-25 08:23:57 -07:00
Ozkan Sezer
acf03aea49 safer this way, just in case.. 2018-09-25 09:20:56 +03:00
Sam Lantinga
2e6df0aaba Fixed rare null pointer dereference 2018-09-24 20:31:24 -07:00
Sam Lantinga
3845ca6792 Fixed bug 4264 - SDL_CreateTextureFromSurface generates error message but returns ok
Anthony @ POW Games

SDL_CreateTextureFromSurface makes an internal call to SDL_GetColorKey which can return an error and spams the error log with "Surface doesn't have a colorkey" even though the original function didn't return an error.
2018-09-24 16:41:55 -07:00
Sam Lantinga
e5786b21c3 Fixed bug 4267 - linkage failure with --enable-hidapi because of missing libudev symbols
Ozkan Sezer

hidapi dynamic udev initial patch
2018-09-24 16:33:14 -07:00
Sam Lantinga
7aff227a2d Support relative mouse for Samsung DeX on Samsung Experience 9.5 or later (Android 8.1 or later) 2018-09-24 11:53:04 -07:00
Sam Lantinga
f65bdeb358 Fixed whitespace 2018-09-24 11:49:25 -07:00
Drew Pirrone-Brusse
bb213856aa Correct the name of the SDL shared library in CMake for Mac OS 2018-08-18 17:23:40 -04:00
Sam Lantinga
c4b6199246 Fixed bug 3166 - It would be nice, if SDL would support including SDL project as a subdirectory into another CMake project
Wayde Reitsma

After attempting to use SDL2 in the way described in this bug, I found the main issue was the includes not being added to the compiler command.

I found the issue was that the target_include_directories commands for the SDL2, SDL2-static and SDL2main targets only sets the public includes for installations using the INSTALL_INTERFACE generator expression.

I have written a patch to CMakeLists.txt that fixes this issue by adding another item to the target_include_directories commands, utilizing the BUILD_INTERFACE generator expression to correctly add the include directory during builds.
2018-09-24 08:41:59 -07:00
Sam Lantinga
a5c7d967d7 Removed button logging message 2018-09-21 09:41:21 -07:00
Sam Lantinga
5191684830 Added missing call to WindowsDeleteString() 2018-09-20 15:55:52 -07:00
Sam Lantinga
e11cbcfbe2 Added experimental support for Windows.Gaming.Input 2018-09-19 10:03:40 -07:00
Ryan C. Gordon
a2a70b23b1 cmake: correctly report Vulkan support at configure time (thanks, Tiago!).
Fixes Bugzilla #4262.

--HG--
extra : amend_source : 7b1ebe533fe01925ace83d32db188c2f002fc9b1
2018-09-18 11:49:42 -04:00
Sam Lantinga
dc60849e53 Fixed NullPointerException if there's no singleton 2018-09-17 12:08:05 -07:00
Sam Lantinga
105bf84a49 Store the API device refcount on the device itself, so if the device is disconnected and we have multiple application references to it, we only free it once. 2018-09-17 11:35:24 -07:00
Sam Lantinga
46e033920e Fixed creating an Android game controller mapping for HIDAPI devices on initialization 2018-09-17 11:35:22 -07:00
Ozkan Sezer
7c42592b86 do not export hidapi symbols from SDL dlls (bug #4259). 2018-09-15 14:28:10 +03:00
Ozkan Sezer
9c16559c88 acinclude: rename ax_gcc_x86_cpuid.m4.htm to ax_gcc_x86_cpuid.m4
--HG--
rename : acinclude/ax_gcc_x86_cpuid.m4.htm => acinclude/ax_gcc_x86_cpuid.m4
2018-09-15 09:24:04 +03:00
Ozkan Sezer
0a9f975af7 fix permissions 2018-09-15 08:11:50 +03:00
Sam Lantinga
6fd2001c4b Added hints SDL_HINT_MOUSE_DOUBLE_CLICK_TIME and SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS to allow tuning double-click sensitivity.
Also increased the default double-click radius to 32 pixels to be more forgiving for touch interfaces
2018-09-14 19:26:26 -07:00
Sam Lantinga
534639b3f0 Guard against Steam Controller input when we're shutting down. 2018-09-14 18:31:03 -07:00
Sam Lantinga
9f17ce1ed2 Use atomic reference counting for the HID device object 2018-09-14 18:31:01 -07:00
Sam Lantinga
81d9677756 Fixed crash launching under Steam on Mac OS X 2018-09-14 12:41:29 -07:00
Sam Lantinga
1e2bdbb7fe Fixed Chinese IME support (thanks 树子。!) 2018-09-10 23:01:33 -07:00
Sam Lantinga
0074b218ae Fixed building on tvOS 2018-09-10 23:00:09 -07:00
Sam Lantinga
a316223159 Fixed building on tvOS without any sensor support 2018-09-10 22:59:49 -07:00
Ozkan Sezer
efaed040cb hidapi/SDL_hidapijoystick.c: fix build in C90 mode:
src/joystick/hidapi/SDL_hidapijoystick.c: In function 'HIDAPI_InitializeDiscovery':
src/joystick/hidapi/SDL_hidapijoystick.c:281: error: 'true' undeclared (first use in this function)
src/joystick/hidapi/SDL_hidapijoystick.c:281: error: (Each undeclared identifier is reported only once
src/joystick/hidapi/SDL_hidapijoystick.c:281: error: for each function it appears in.)
src/joystick/hidapi/SDL_hidapijoystick.c: In function 'HIDAPI_UpdateDiscovery':
src/joystick/hidapi/SDL_hidapijoystick.c:339: error: 'true' undeclared (first use in this function)
src/joystick/hidapi/SDL_hidapijoystick.c:341: error: ISO C90 forbids mixed declarations and code
2018-09-07 11:03:24 +03:00
Ozkan Sezer
38f56226f1 SDL_sensor.h, SDL_video.h: remove comma at end of enumerator lists.
Avoids gcc -pedantic warnings, closes bug #4253.
2018-09-07 10:47:50 +03:00
Anthony Pesch
cfcef86f4d alsa: avoid hardware parameters with an excessive number of periods.
The previous code attempted to use set_buffer_size / set_period_size
discretely, favoring the parameters which generated a buffer size that was
exactly 2x the requested buffer size. This solution ultimately prioritizes
only the buffer size, which comes at a large performance cost on some machines
where this results in an excessive number of periods. In my case, for a 4096
sample buffer, this configured the device to use 37 periods with a period size
of 221 samples and a buffer size of 8192 samples. With 37 periods, the SDL
Audio thread was consuming 25% of the CPU.

This code has been refactored to use set_period_size and set_buffer_size
together. set_period_size is called first to attempt to set the period to
exactly match the requested buffer size, and set_buffer_size is called second
to further refine the parameters to attempt to use only 2 periods. The
fundamental change here is that the period size / count won't go to extreme
values if the buffer size can't be exactly matched, the buffer size should
instead just increase to the next closest multiple of the target period size
that is supported. After changing this, for a 4096 sample buffer, the device
is configured to use 3 periods with a period size of 4096 samples and a buffer
size of 12288 samples. With only 3 periods, the SDL Audio thread doesn't even
show up when profiling.

Fixes Bugzilla #4156.
2018-05-04 21:21:32 -04:00
Ryan C. Gordon
353e706a9e cmake: Look in popular places for X11 headers, export this info properly.
Fixes CMake not being able to find X11 on FreeBSD (which generally has the
headers in /usr/local/include/X11).

List of other popular places borrowed from CMake's FindX11 module.

This worked on the configure script because of magic in the AC_PATH_X macro.

Fixes Bugzilla #4815.
2018-06-24 15:12:18 -04:00
Ryan C. Gordon
a1083ef2b0 x11: Normalize x11xinput2 touch x to be 1.0 at width (thanks, Zach!).
"Applications (such as SDL's testgesture) do "event.tfinger.x * window_width"
to find window coord. Currently the X11 XInput2 backend expects application
to do "event.tfinger.x * (window_width-1)" instead.

X11 XInput2 touch events are normalized so x is 1.0 at "width - 1" but other
SDL backends appear to have x be 1.0 at "width". Same issue for touch event
y with regards to height."

Fixes Bugzilla #4183.
2018-06-24 13:57:22 -04:00
Tomeu Vizoso
3c03c0beeb egl: Don't change context when deleting current.
If we change the current context behind the app's back, those tracking
the current context to minimize context changes are going to get
confused.

This brings the EGL backend in line with the GLX one.

Fixes Bugzilla #4199.
2018-06-14 06:12:12 +00:00
Ryan C. Gordon
94500043c1 Fixed some possible malloc(0) calls reported by static analysis.
--HG--
extra : rebase_source : 8c2181ff55533bc83aab66ac7d7d1bad87cd0e6f
2018-06-24 12:16:58 -04:00
Sam Lantinga
dd4649c8fb Use a blank cursor instead of PointerIcon.TYPE_NULL since that shows the default cursor on Samsung DeX 2018-06-18 13:14:04 -07:00
Sam Lantinga
7d843b752b Added support for external mouse in Samsung DeX mode
relative mode doesn't work, but absolute coordinates are functional
2018-06-18 13:14:02 -07:00
Sam Lantinga
d8cdfc2a4b Make certain we only hide system UI when we're fullscreen for real. (thanks Rachel!) 2018-06-18 13:14:00 -07:00
Sam Lantinga
90fc4490bc Deal with situations where the system UI is shown when the keyboard pops up (thanks Rachel!) 2018-06-18 13:13:58 -07:00
Sam Lantinga
a2da3d641d Fixed race condition where Android touch events could get scaled by a render target's viewport 2018-06-18 13:13:56 -07:00
Sam Lantinga
c995f49d76 Fixed bug 4094 - No SDL_TEXTEDITING after pressing Alt key on Raspberry Pi Linux
This was reproducible by running an SDL app on the console from an ssh login. In this case the terminal wasn't owned by the user running the app, so we were using the default keymap, which didn't have state transitions defined for ctrl and alt, so once we entered that state keypresses would no longer transition out of that state, nor would they generate text.

As a workaround, we'll just reset to the default shift state if that happens, which means we'll get text for keys pressed while ctrl is held down, but I don't think that's a big problem.

Note that in this case we also can't mute the keyboard, so the keypresses go to the console, which probably isn't what you want...
2018-06-14 00:51:45 -07:00
Sam Lantinga
fd0a45865f SDL Android fullscreen code extensively tested on Steam Link with no issues reported 2018-06-13 14:24:30 -07:00
Ozkan Sezer
5b1c603dbc use the 'aborts' pragma of Watcom for SDL_NORETURN functions
SDL_ExitProcess(), SDL_AbortAssertion() and SDLTest_BailOut().

(Commit c8b4a5166613 for bug #4100 removed SDL_NORETURN from
SDL_ExitProcess() and SDL_AbortAssertion() in order to avoid
warnings from windows builds, but that's temporary I guess..)
2018-06-13 14:45:02 +03:00
Sam Lantinga
dc4b4cc9df Deal with fullscreen limitations under windowed Android environments (Chromebook, DeX, etc.) (Thanks Rachel!) 2018-06-12 13:22:58 -07:00
Ozkan Sezer
53e38a8dfc ran 'chmod -x' on many files 2018-06-12 14:00:15 +03:00
Sam Lantinga
8496fbe117 Merged in community contributed controller mappings from https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt 2018-06-12 01:04:26 -07:00
Sam Lantinga
1208c5aa55 Added common controllers used with Steam Big Picture
These are entirely untested
Several USB ids refer to multiple packaged products. In those cases I tried to use the most common name, or a general name (e.g. PS3 Controller), or a completely generic name (e.g. USB gamepad) if it wasn't clear what type of controller it was.
Patches welcome!
2018-06-12 00:18:10 -07:00
Sam Lantinga
e11ad4a284 Don't crash on exit from SDLActivity if we don't have a singleton for some reason. (Thanks Rachel!) 2018-06-07 17:07:05 -07:00
Sam Lantinga
5365d120f5 Track android device panel width & height as well as window surface & height.
Expand SDLActivity::SDLSurface::surfaceChanged() callback to grab the panel width and height at the same time and pass that along to the native code. Only works on API 17+. Duplicates surface dimensions whenever it fails.

Add Android_DeviceWidth/Android_DeviceHeight globals to native code.
Disambiguate Android_ScreenWidth/Android_ScreenHeight -> Android_SurfaceWidth/Android_SurfaceHeight
Use device width/height for all display mode settings.
2018-06-07 17:07:03 -07:00
Sam Lantinga
b524fbfa1a Added support for the PS3 controller driver in PlayStation Now 2018-06-07 10:54:54 -07:00
Sam Lantinga
5c2e9ad377 Added Android hardware feature support to the default manifest 2018-06-06 09:42:12 -07:00
Sam Lantinga
cc3eb28d4d Added improved mouse pointer capture under API 26. (Thanks Rachel!) 2018-06-05 14:08:39 -07:00
Sam Lantinga
c05c926eca Added SDL_IsChromebook() to determine if we're running on a Chromebook. 2018-06-05 12:46:13 -07:00
Sam Lantinga
971e77801b Add Android support for relative mouse mode to SDL. 2018-06-05 12:46:11 -07:00
Sam Lantinga
3fce290676 Fix creating a minimized window in SDL to not cause focus to be stolen (because ShowWindow( hwnd, SW_MINIMIZE ) would be called after creation, thus changing focus to the prior window based on some per-app list in windows, rather than the window being created with WS_MINIMIZED to start with).
This means we have to consider SDL_WINDOW_MINIMIZED a window creation flag, but on non-windows platforms we just remove it and let the normal FinishWindowCreation re-apply and do the minimize as I have no idea what is right on them or if anything should change.

CR: Phil
2018-06-05 12:46:09 -07:00
Sam Lantinga
a63126c72b Fixed bug 4184 - jack audio driver fails in presence of midi ports
Martin Širokov

Launching an SDL application with SDL_AUDIODRIVER=jack, and then calling SDL_OpenAudioDevice() with whatever parameters fails with an error like this one:

SDL_OpenAudioDevice: Couldn't connect JACK ports: SDL:sdl_jack_output_0 => system:midi_playback_1

This happens because JACK_OpenDevice in src/audio/jack/SDL_jackaudio.c blindly tries to connect to all input ports without checking whether they are for audio or midi.

The fix is to check port types and ignore all non audio ports. Also I removed devports field from struct SDL_PrivateAudioData, because it's never really used and removing unused ports from it would be PITA.
2018-06-01 19:43:53 -07:00
Sam Lantinga
7aab344396 Added support for Android relative mouse mode on API 24 and above 2018-05-29 11:18:01 -07:00
Sam Lantinga
1d6c7e96f0 Added a new GUID for DS3 controller connected over bluetooth, for both Sony and Shanwan (thanks William!) 2018-05-29 08:03:44 -07:00
Ryan C. Gordon
bdea7c958e metal: contrary to documentation, we need to set the drawableSize explicitly.
Fixes Bugzilla #4149.
2018-05-27 20:30:03 -04:00
Sam Lantinga
71f7ab88d3 Fixed bug 4169 - Crash due to audio session observer race condition
Jona

The following explains why this bug was happening:
This crash was caused because the audio session was being set as active [session setActive:YES error:&err] when the audio device was actually being CLOSED. Certain cases the audio session being set to active would fail and the method would return right away. Because of the way the error was handled we never removed the SDLInterruptionListener thus leaking it. Later when an interruption was received the THIS_ object would contain a pointer to an already released device causing the crash.

The fix:
When only one device remained open and it was being closed we needed to set the audio session as NOT active and completely ignore the returned error to successfully release the SDLInterruptionListener. I think the user assumed that the open_playback_devices and open_capture_devices would equal 0 when all of them where closed but the truth is that at the end of the closing process that the open devices count is decremented.
2018-05-24 07:30:24 -07:00
Sam Lantinga
a860abd036 Added support for the NVIDIA SHIELD handheld gaming device 2018-05-23 17:15:37 -07:00
Sam Lantinga
fd550c4788 Better fix for axis sorting with some Android controllers 2018-05-23 17:15:35 -07:00
Sam Lantinga
59d9b642c4 Actually left trigger is motion axis 17 and right trigger is motion axis 18, which will map in that order to SDL axes. 2018-05-23 17:15:33 -07:00
Sam Lantinga
1a11875150 Added additional supported Android controllers 2018-05-23 16:00:21 -07:00
Sam Lantinga
31619e7cd8 Fixed default mapping for Android controller triggers (they were reversed) 2018-05-23 16:00:19 -07:00
Ryan C. Gordon
3e6756a409 audio: Needed to fix two more instances for Visual Studio. 2018-05-21 12:05:17 -04:00
Ryan C. Gordon
09c7ceab2e thread: fixed compiler warnings on non-Linux systems that use pthread.
(static function rtkit_setpriority was unused, moved it in with rest of
__LINUX__ section.)
2018-05-21 12:00:21 -04:00
Ryan C. Gordon
8486bf2127 audio: Patched to compile on Visual Studio.
(It gets upset at the -2147483648, thinking this should be an unsigned value
because 2147483648 is too large for an int32, so the negative sign upsets the
compiler.)
2018-05-21 11:54:09 -04:00
Ryan C. Gordon
72aa5ee14c audio: Added ARM NEON versions of audio converters.
These are _much_ faster than the scalar equivalents on the Raspberry Pi that
I tested on. Often 3x to 4x as fast!

--HG--
extra : rebase_source : a9f90ef5bfdd309d6a3c8e9220ee235d7413cb5d
extra : histedit_source : 61c5ad731eed96f7bb46da40261ed8b14d474624
2018-05-16 02:03:06 -04:00
Ryan C. Gordon
8f939498c0 audio: SSE2 float-to-int converters should clamp input.
The scalar versions already do this.

--HG--
extra : rebase_source : c42a9f21fe39cbc86bcf00a3a2aab6045e93653c
extra : histedit_source : 010f977ddd95317719656840aab11bfbe4c3ba48
2018-05-15 02:29:35 -04:00
Ryan C. Gordon
4fdc866cb9 audio: Fix range on float-to-int data clamping.
I can't tell if there was a good reason for this or it was just me getting
numbers wrong due to exhaustion.

--HG--
extra : rebase_source : 89c4fdec316ae565b004f36050084ba54ad0f8e9
extra : histedit_source : 4951e6c9e873249b9f0baaffd3c9b4b2506308c4
2018-05-15 01:40:05 -04:00
Ryan C. Gordon
799afaf11c audio: float to int converters should clamp inclusively.
If we have to test if a sample is > 1.0f anyhow, we might as well use this
to avoid the unnecessary multiplication when it's == 1.0f, too. (etc).

--HG--
extra : rebase_source : efee952e0b5cd3f96c68b80158bcee6f9c66b241
extra : histedit_source : d60200ad2713377a0f8a322e5a0ce59a003fe575
2018-05-15 01:35:53 -04:00
Ryan C. Gordon
3ca98abf96 testresample: correctly output .wav files that have floating point audio.
--HG--
extra : rebase_source : 12727c9fbaead1d9e954b34dbdae5babef3f4dce
extra : histedit_source : bdee71b1310f6a427e0e03ad7c06856ad3c6299f
2018-05-15 00:04:02 -04:00
Ryan C. Gordon
d4581bb6a7 audio: converting int32 to/from float shouldn't use doubles.
The concern is that a massive int sample, like 0x7FFFFFFF, won't fit in a
float32, which doesn't have enough bits to hold a whole number this large,
just to divide it to get a value between 0 and 1.
Previously we would convert to double, to get more bits, do the division, and
cast back to a float, but this is expensive.

Casting to double is more accurate, but it's 2x to 3x slower. Shifting out
the least significant byte of an int32, so it'll definitely fit in a float,
and dividing by 0x7FFFFF is still accurate to about 5 decimal places, and the
difference doesn't appear to be perceptable.

--HG--
extra : rebase_source : 5be8fca9a33034555682eb22945744cc34cabf71
extra : histedit_source : 2b3c771dcb080326e24fdac1c8f19e5b44ef21b3
2018-05-15 01:04:11 -04:00
Ryan C. Gordon
b7560b9599 cpuinfo: Added SDL_HasAVX512F().
This checks for the "foundation" AVX-512 instructions (that all AVX-512
compatible CPUs support).

--HG--
extra : rebase_source : 2857dd04072e2f897e18665d0a4fe2837c06ed9b
extra : histedit_source : 67d0b925bceb2ed2a8f37b5783f2b755e796031f
2018-05-21 11:35:42 -04:00
Ryan C. Gordon
507f22ca69 cpuinfo: Make CPU flags easier to read and add to.
--HG--
extra : rebase_source : 4d81b3af23cee1138820a0c3f9883ec45ac711ce
extra : histedit_source : d5432ab16b6e3202735f19ecae3b959d8f3beb3f
2018-05-14 00:03:39 -04:00
Ryan C. Gordon
fbfce09170 cpuinfo: Added some internal SIMD-aligned allocation functions.
Fixes Bugzilla #4150 (sort of).

--HG--
extra : rebase_source : af4df4fe459ce28889fb225717c418e6c1ef9ae4
extra : histedit_source : aafd7e609c08ea908255e205d23e3efdc88837a1
2018-05-21 11:34:57 -04:00
Sam Lantinga
bebfd14c33 Merged latest changes from Steam Link app 2018-05-18 13:09:30 -07:00
Ryan C. Gordon
ae037005ee dynapi: don't let system loader resolve the initializer to the wrong version.
Fixes problems launching Firewatch on Linux (which statically links SDL but
also dynamically loads a system-wide copy from a plugin shared library) with
a newer SDL build.
2018-05-17 12:50:46 -04:00
Ozkan Sezer
ae0e4230a9 remove testvulkan.vcproj (was a VS2008 left-over.) 2018-05-11 09:37:00 +03:00
Ozkan Sezer
6f33890b09 make sure SDL_vsnprintf() nul terminates if it is using _vsnprintf
The change makes sure that SDL_vsnprintf() nul terminates if it is
using _vsnprintf() for the job.

I made this patch for Watcom, whose _vsnprintf() doesn't guarantee
nul termination.  The preprocessor check can be extended to windows
in general too, if required.

Closes bug #3769.
2018-05-10 09:02:39 +03:00
Ozkan Sezer
7a1c60fed4 SDL_stdinc.h: move the alloca() includes before begin_code.h 2018-05-10 08:28:00 +03:00
Ozkan Sezer
b34726884e do the direct3d tap dance for overscan hint only if SDL_VIDEO_RENDER_D3D == 1 2018-05-10 08:25:23 +03:00
Sam Lantinga
3f5220d8e8 Reverted change for bug 4152 - restrict the win10 mouse bug workaround to win10 v1709 only
Daniel Gibson

Sorry, but it seems like Microsoft didn't fix the issue properly.

I just updated my Win10 machine, it now is Version 1803, Build 17134.1

I tested with SDL2 2.0.7 (my workaround was released with 2.0.8) and still got
lots of events that directly undid the prior "real" events - just like before.
(See simple testcase in attachement)
By default it sets SDL_HINT_MOUSE_RELATIVE_MODE_WARP - which triggered (and on my machine still triggers) the buggy behavior. You can start it with -raw, then it'll not set that hint and the events will be as expected.
The easiest way to see the difference is looking at the window title, which shows accumulated X and Y values: If you just move your mouse to the right, in -raw mode the number just increases. In non-raw mode (using mouse warping) it stays around 0.

I also had a WinAPI-only testcase: https://gist.github.com/DanielGibson/b5b033c67b9137f0280af9fc53352c68
It just calls SetCursorPos(320,240); on each WM_MOUSEMOVE event, and it also
logs all those events to a mouseevents.log textfile.
This log indeed looks a bit different since the latest Win10 update: It seems like all those events with x=320 y=240 do arrive - but only after I stopped moving the mouse - even though the cursor seems to be moved back every frame (or so).
So moving the mouse to the right gives X coordinates like
330, 325, 333, 340, 330, ...
and then when stopping movement I get lots of events with X coordinate 320
2018-05-07 20:10:12 -07:00
Sam Lantinga
40f5b81553 Fixed bug 4134 - Render targets lose scale quality after minimizing a fullscreen window
Olli-Samuli Lehmus

If one creates a window with the SDL_WINDOW_FULLSCREEN_DESKTOP flag, and creates a render target with SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear"), and afterwards sets SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "nearest"), after minimizing the window, the scale quality hint is lost on the render target. Textures however do keep their interpolation modes.
2018-05-07 19:52:25 -07:00
Sam Lantinga
31a9517639 Fixed bug 4159 - Windows headers are included after packing alignment change
lectem

The SDL_syswm.h header includes the windows.h header after including begin_code.h which changes the structure packing alignment.

It seems this is not safe as suggested by the following warning :
warning C4121: 'JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE_V2': alignment of a member was sensitive to packing
2018-05-07 19:26:02 -07:00
Sam Lantinga
1a687f83fb Fixed bug 4154 - Fix three empty variable tests in configure
Zack Middleton

Running top-level SDL configure on macOS 10.11 resulted in the errors below because automake removed the brackets about the tests.

./configure: line 15756: : command not found
./configure: line 15759: -Iinclude -I/Users/zack/SDL/include -idirafter /Users/zack/SDL/src/video/khronos : No such file or directory
./configure: line 15763: : command not found
2018-05-05 10:31:03 -07:00
Sam Lantinga
39c7887375 Fixed bug 4152 - Windows 10 v1803 update seems to have fixed the jumping mouse bug (see bug #3931.) 2018-05-05 10:27:53 -07:00
Sam Lantinga
93215c489a Improved error messages when Vulkan isn't configured (thanks Daniel Gibson!) 2018-04-23 22:29:14 -07:00
Sam Lantinga
415ed707e7 Fixed build 2018-04-23 22:17:56 -07:00
Sam Lantinga
50baccfbfb Added SDL_THREAD_PRIORITY_TIME_CRITICAL 2018-04-23 22:07:56 -07:00
Sam Lantinga
a6f6cae8eb Fixed bug 4144 - CMake complains about trailing spaces in sdl2.pc
Azamat H. Hackimov

When you try use SDL2 2.0.8 in CMake project in Linux, it complains about trailing spaces in sdl2.pc:

CMake Error at CMakeLists.txt:147 (add_executable):
  Target "TestSimpleMain" links to item "-L/usr/lib64 -lSDL2 " which has
  leading or trailing whitespace.  This is now an error according to policy
  CMP0004.
2018-04-23 21:55:59 -07:00
Sam Lantinga
289db15943 TryLockMutex: Fix error handling for TryLockMutex
Christian Herzig

pthread_mutex_trylock() and by the way, pthread_mutex_lock() do not set errno.
Pthread-methods directly return error code as int. See related man-pages for
details.
2018-04-23 21:50:03 -07:00
Sam Lantinga
82f42026e7 Handle NULL return from SDL_DBus_GetContext() 2018-04-23 20:24:12 -07:00
Sam Lantinga
fbfcea8362 Handle NULL return from SDL_DBus_GetContext() 2018-04-23 19:20:12 -07:00
Sam Lantinga
9a335154f2 Added SDL_LinuxSetThreadPriority() to directly set the priority of a Linux thread (tid)
This function tries using RealtimeKit connecting over DBUS as needed.
2018-04-23 19:18:52 -07:00
Sam Lantinga
467b928af2 Added support for adjusting thread priorities using Linux RealtimeKit
Michael Sartain

This is a quick pass at adding Linux RealtimeKit thread priority support to SDL.

It allows me to bump the thread priority to high without root privileges or setting any caps, etc.

rtkit readme here:
    http://git.0pointer.net/rtkit.git/tree/README
2018-04-23 17:10:36 -07:00
Ryan C. Gordon
426d67ec76 coreaudio: Use the standard SDL audio thread instead of spinning a new one.
Fixes corner cases, like the audio callback not firing if the device is
disconnected, etc.
2018-04-16 02:11:09 -04:00
Ryan C. Gordon
a004da5bd2 wayland: zxdg_shell_v6 needs a configure event before using a surface at all.
Fixes Bugzilla #4109.
Fixes Bugzilla #4119.

--HG--
extra : rebase_source : 865cc79d9d4f9c7a3c6548ad2645dbad801cd8c9
2018-04-15 17:42:09 -04:00
Sam Lantinga
62c327d9a7 Fixed bug 4135 - Broken symlink libSDL2.so since rev11940
Tiago O.

Symlink points to the wrong folder, and target will always have debug postfix, so it'll be broken for other build types.
2018-04-15 09:37:51 -07:00
Sam Lantinga
37efb4bbb2 Added support for the GameSir G3w 2018-04-11 18:28:03 -07:00
Bastien Bouclet
88acc282f7 Fix the include path in the installed CMake target import file
Previously the include path was {INSTALL_PREFIX}/include,
it is now {INSTALL_PREFIX}/include/SDL2 to be consistent with
the other build and package configuration systems.

Fixes #4128.
2018-04-11 06:16:23 +02:00
Saad Khattak
a3d99457b8 Added debug postfix to install command and fixed library path 2018-04-10 08:03:54 -07:00
Sam Lantinga
f2a9b4d31e SDL:
On Windows, have SDL_ShowWindow() not activate the window if the window has the WS_EX_NOACTIVATE window flag.
2018-04-09 10:37:31 -07:00
Sam Lantinga
0c15c4e47e Fixed bug where an SDL window that was activated while hidden could never be shown.
Test code:
{
	SDL_Window *win = SDL_CreateWindow( "Dummy", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 128, 128, SDL_WINDOW_HIDDEN );
	SDL_SysWMinfo info;
	SDL_VERSION( &info.version );
	SDL_GetWindowWMInfo( win, &info );
	SetActiveWindow( info.info.win.window );
	{
		DWORD then = SDL_GetTicks();
		while ( ( SDL_GetTicks() - then ) < 3000 )
		{
			SDL_Event evt;
			SDL_PollEvent( &evt );
		}
		SDL_ShowWindow( win );

		then = SDL_GetTicks();
		while ( ( SDL_GetTicks() - then ) < 3000 )
		{
			SDL_Event evt;
			SDL_PollEvent( &evt );
		}
	}
	SDL_DestroyWindow( win );
}
2018-03-26 12:38:29 -07:00
Sam Lantinga
33812e3630 Fixed bug 3804 - Message box on Windows truncates button ID
Simon Hug

I just wanted to fix a simple compiler warning in SDL_ShowMessageBox on Windows (which Sam fixed recently) and ended up finding some issues.

Attached patch fixes these issues:

- Because Windows only reports the lower 16 bits of the control identifier that was pushed, the button IDs used by SDL (C type int, most likely 32 bits) can get cut off.

- The documentation states (somewhat ambiguously) that the button ID will be -1 if the dialog was closed, but the current code sets 0. For SDL 2.1, I think this should be a return code of SDL_ShowMessageBox itself. That will free up the button ID and it seems a more appropriate place for signaling this event.

- Ampersands in controls will create mnemonics on Windows (underlined letters that, if combined with the Alt key, will push the button). I was thinking of adding a hint or flag to let the users enable it, but that might have unexpected results.

- When the size of the text gets calculated, it doesn't use the same parameters as the static control. This can cut off text or wrap it weirdly.

- On Windows, the Tab key is used to switch between control groups and sometimes between buttons in dialogs. This didn't seem to work correctly.

Attached patch also adds:

- Icons. Just the system ones that can be loaded with the ordinals IDI_ERROR, IDI_WARNING and IDI_INFORMATION.

- A button limit of 2^16 - 101.

- Some more specific error messages, but they never reach the user because how SDL_ShowMessageBox handles them if an implementation returns with an error.
2018-03-24 10:26:40 -07:00
Sam Lantinga
3a8c7aa2f0 Fixed return value 2018-03-19 14:52:53 -07:00
Sam Lantinga
1182588bae Generalized the handling of instantaneous guide button presses so there's a minimum of 100 ms between guide button press and release.
This happens with at least the following controllers: All Apple MFI controllers, ASUS Gamepad, XiaoMi Bluetooth Controller
2018-03-19 14:42:51 -07:00
Sam Lantinga
9a80659d08 Added mapping for the ASUS Gamepad removing the guide button, which doesn't generate events even though it's reported in the Android APIs. 2018-03-19 13:16:11 -07:00
Sam Lantinga
7b6cc30d14 Reimplemented Android cursor API support using reflection so it builds with older SDKs 2018-03-16 11:08:53 -07:00
Sam Lantinga
b5b3a139dc Added Android custom cursor implementation
This is commented out in SDLActivity.java, with the note #CURSORIMPLEENTATION because it requires API 24, which is higher than the minimum required SDK
2018-03-15 18:22:48 -07:00
Sam Lantinga
548940ff18 Added Mac OpenGL ES configure support 2018-03-12 18:41:06 -07:00
Sam Lantinga
a4e95f8162 Fixed bug 4102 - define _WIN32_WINNT_WIN7 if not already defined
Ozkan Sezer

The following patch defines _WIN32_WINNT_WIN7 if it is not already
defined in core/windows/SDL_windows.c,  similar to what is already
there for _WIN32_WINNT_VISTA.
2018-03-10 21:22:42 -08:00
Sam Lantinga
b9ad34197f Fixed bug 4103 - SDL_cpuinfo.h provokes warnings with -Wundef on non-x86 hosts
Felix Geyer

Forwarding from https://bugs.debian.org/892087 quoting verbatim:

The SDL2 header SDL_cpuinfo.h generates gcc warnings if the program using
it compiles with the -Wundef warning. (In particular, this means that QEMU
builds using it fail on at least sparc hosts, since QEMU dev builds
use both -Wundef and -Werror.).

/usr/include/SDL2/SDL_cpuinfo.h:63:5: warning: "HAVE_IMMINTRIN_H" is not defined, evaluates to 0 [-Wundef]
 #if HAVE_IMMINTRIN_H && !defined(SDL_DISABLE_IMMINTRIN_H)
2018-03-10 21:20:25 -08:00
Michał Janiszewski
00e572e04d Fix ARM builds with MSVC 2018-03-10 21:16:14 -08:00
Sam Lantinga
a2165147d3 Temporary fix for bug 3432 - macOS 10.12: small scrolls (1 wheel notch) don't generate events
Eric Wasylishen

This bug was reintroduced by https://hg.libsdl.org/SDL/rev/68a80d7afec3

The steps to reproduce are the same: run the "testrelative" SDL demo with "--info all",
connect a USB mouse with a scroll wheel, and roll the scroll wheel one "notch". You'll get log output like:

testdraw2[1644:67222] INFO: SDL EVENT: Mouse: wheel scrolled 0 in x and 0 in y (reversed: 1) in window 1

As far as I can tell macOS doesn't have an API for getting the number of "wheel notches"; I get a deltaY of 0.100006 for one "notch", and it's heavily accelerated (if you roll the wheel quickly you'll get large deltas). So NSEvent's deltaY is only meant to be used for scrolling a scroll view, with the given distance in points, not something like selecting an item in a game.

Here's a temporary patch that at restores the foor/ceil in Cocoa_HandleMouseWheel.
Not ideal, but at least it restores the ability to scroll one notch of a mousewheel.
2018-03-10 21:13:50 -08:00
Sam Lantinga
72dc6742d0 Delay delivery of the pause button release on MFI controllers so it doesn't happen in the same frame as the button press 2018-03-08 16:32:22 -08:00
1068 changed files with 156142 additions and 33842 deletions

View file

@ -4,13 +4,34 @@ autom4te*
config.cache
config.log
config.status
libtool
Makefile
sdl-config
Makefile.rules
sdl2-config
sdl2-config.cmake
sdl2.pc
SDL2.spec
build
gen
Build
# for CMake
CMakeFiles/
CMakeCache.txt
cmake_install.cmake
cmake_uninstall.cmake
SDL2ConfigVersion.cmake
*.a
*.la
*.so
*.so.*
.ninja_*
*.ninja
# for CLion
.idea
cmake-build-*
# for Xcode
*.orig
*.swp
@ -58,7 +79,7 @@ VisualC/visualtest/testsprite2_sample.parameters
# for Android
android-project/local.properties
sdl.pc
test/aclocal.m4
test/autom4te*
test/config.cache
test/config.log
@ -112,6 +133,7 @@ test/testresample
test/testrumble
test/testscale
test/testsem
test/testsensor
test/testshader
test/testshape
test/testsprite2
@ -121,10 +143,13 @@ test/testthread
test/testtimer
test/testver
test/testviewport
test/testvulkan
test/testwm2
test/testyuv
test/torturethread
test/*.exe
test/*,e1f
test/*,ff8
test/*.dSYM
buildbot
test/buildbot

View file

@ -33,3 +33,5 @@ e12c387305129c847b3928a123300b113782fe3f release-2.0.4
8df7a59b55283aa09889522369a2b32674c048de release-2.0.6
2088cd828335797d73d151e3288d899f77204862 release-2.0.7
f1084c419f33610cf274e309a8b2798d2ae665c7 release-2.0.8
8feb5da6f2fb75703bde2c06813375af984a57f0 release-2.0.9
bc90ce38f1e27ace54b83bebf987993002504f7f release-2.0.10

View file

@ -20,6 +20,7 @@ LOCAL_SRC_FILES := \
$(wildcard $(LOCAL_PATH)/src/audio/*.c) \
$(wildcard $(LOCAL_PATH)/src/audio/android/*.c) \
$(wildcard $(LOCAL_PATH)/src/audio/dummy/*.c) \
$(wildcard $(LOCAL_PATH)/src/audio/openslES/*.c) \
$(LOCAL_PATH)/src/atomic/SDL_atomic.c.arm \
$(LOCAL_PATH)/src/atomic/SDL_spinlock.c.arm \
$(wildcard $(LOCAL_PATH)/src/core/android/*.c) \
@ -31,11 +32,13 @@ LOCAL_SRC_FILES := \
$(wildcard $(LOCAL_PATH)/src/haptic/android/*.c) \
$(wildcard $(LOCAL_PATH)/src/joystick/*.c) \
$(wildcard $(LOCAL_PATH)/src/joystick/android/*.c) \
$(LOCAL_PATH)/src/joystick/steam/SDL_steamcontroller.c \
$(wildcard $(LOCAL_PATH)/src/joystick/hidapi/*.c) \
$(wildcard $(LOCAL_PATH)/src/loadso/dlopen/*.c) \
$(wildcard $(LOCAL_PATH)/src/power/*.c) \
$(wildcard $(LOCAL_PATH)/src/power/android/*.c) \
$(wildcard $(LOCAL_PATH)/src/filesystem/android/*.c) \
$(wildcard $(LOCAL_PATH)/src/sensor/*.c) \
$(wildcard $(LOCAL_PATH)/src/sensor/android/*.c) \
$(wildcard $(LOCAL_PATH)/src/render/*.c) \
$(wildcard $(LOCAL_PATH)/src/render/*/*.c) \
$(wildcard $(LOCAL_PATH)/src/stdlib/*.c) \
@ -48,10 +51,36 @@ LOCAL_SRC_FILES := \
$(wildcard $(LOCAL_PATH)/src/video/yuv2rgb/*.c) \
$(wildcard $(LOCAL_PATH)/src/test/*.c))
LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES
LOCAL_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -llog -landroid
LOCAL_SHARED_LIBRARIES := hidapi
cmd-strip :=
LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES
LOCAL_CFLAGS += \
-Wall -Wextra \
-Wdocumentation \
-Wdocumentation-unknown-command \
-Wmissing-prototypes \
-Wunreachable-code-break \
-Wunneeded-internal-declaration \
-Wmissing-variable-declarations \
-Wfloat-conversion \
-Wshorten-64-to-32 \
-Wunreachable-code-return \
-Wshift-sign-overflow \
-Wstrict-prototypes \
-Wkeyword-macro \
# Warnings we haven't fixed (yet)
LOCAL_CFLAGS += -Wno-unused-parameter -Wno-sign-compare
LOCAL_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -lOpenSLES -llog -landroid
ifeq ($(NDK_DEBUG),1)
cmd-strip :=
endif
LOCAL_STATIC_LIBRARIES := cpufeatures
include $(BUILD_SHARED_LIBRARY)
@ -86,4 +115,22 @@ LOCAL_MODULE_FILENAME := libSDL2main
include $(BUILD_STATIC_LIBRARY)
###########################
#
# hidapi library
#
###########################
include $(CLEAR_VARS)
LOCAL_CPPFLAGS += -std=c++11
LOCAL_SRC_FILES := src/hidapi/android/hid.cpp
LOCAL_MODULE := libhidapi
LOCAL_LDLIBS := -llog
include $(BUILD_SHARED_LIBRARY)
$(call import-module,android/cpufeatures)

View file

@ -3,7 +3,7 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
endif()
cmake_minimum_required(VERSION 2.8.11)
project(SDL2 C)
project(SDL2 C CXX)
# !!! FIXME: this should probably do "MACOSX_RPATH ON" as a target property
# !!! FIXME: for the SDL2 shared library (so you get an
@ -42,10 +42,13 @@ include(${SDL2_SOURCE_DIR}/cmake/sdlchecks.cmake)
# set SDL_BINARY_AGE and SDL_INTERFACE_AGE to 0.
set(SDL_MAJOR_VERSION 2)
set(SDL_MINOR_VERSION 0)
set(SDL_MICRO_VERSION 8)
set(SDL_MICRO_VERSION 12)
set(SDL_INTERFACE_AGE 0)
set(SDL_BINARY_AGE 8)
set(SDL_BINARY_AGE 12)
set(SDL_VERSION "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}.${SDL_MICRO_VERSION}")
# the following should match the versions in Xcode project file:
set(DYLIB_CURRENT_VERSION 12.0.0)
set(DYLIB_COMPATIBILITY_VERSION 1.0.0)
# Set defaults preventing destination file conflicts
set(SDL_CMAKE_DEBUG_POSTFIX "d"
@ -61,7 +64,7 @@ set(LT_REVISION "${SDL_INTERFACE_AGE}")
set(LT_RELEASE "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}")
set(LT_VERSION "${LT_MAJOR}.${LT_AGE}.${LT_REVISION}")
message(STATUS "${LT_VERSION} :: ${LT_AGE} :: ${LT_REVISION} :: ${LT_CURRENT} :: ${LT_RELEASE}")
#message(STATUS "${LT_VERSION} :: ${LT_AGE} :: ${LT_REVISION} :: ${LT_CURRENT} :: ${LT_RELEASE}")
# General settings & flags
set(LIBRARY_OUTPUT_DIRECTORY "build")
@ -115,6 +118,8 @@ elseif(APPLE)
set(DARWIN TRUE)
elseif(CMAKE_SYSTEM_NAME MATCHES ".*MacOS.*")
set(MACOSX TRUE)
elseif(CMAKE_SYSTEM_NAME MATCHES ".*tvOS.*")
set(TVOS TRUE)
endif()
# TODO: iOS?
elseif(CMAKE_SYSTEM_NAME MATCHES "BeOS.*")
@ -124,7 +129,7 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "Haiku.*")
endif()
# Don't mistake osx for unix
if(UNIX AND NOT APPLE)
if(UNIX AND NOT APPLE AND NOT RISCOS)
set(UNIX_SYS ON)
else()
set(UNIX_SYS OFF)
@ -152,6 +157,27 @@ if(UNIX OR MINGW OR MSYS)
set(OPT_DEF_LIBC ON)
endif()
# The hidraw support doesn't catch Xbox, PS4 and Nintendo controllers,
# so we'll just use libusb when it's available. libusb does not support iOS,
# so we default to yes on iOS.
# TODO: Windows can support libusb, the hid.c file just depends on Unix APIs
if(WINDOWS OR IOS OR TVOS OR ANDROID)
set(HIDAPI_SKIP_LIBUSB TRUE)
else()
set(HIDAPI_SKIP_LIBUSB FALSE)
endif()
if (HIDAPI_SKIP_LIBUSB)
set(OPT_DEF_HIDAPI ON)
endif()
# On the other hand, *BSD specifically uses libusb only, so we make a special
# case just for them.
if(FREEBSD OR NETBSD OR OPENBSD OR BSDI)
set(HIDAPI_ONLY_LIBUSB TRUE)
else()
set(HIDAPI_ONLY_LIBUSB FALSE)
endif()
# Compiler info
if(CMAKE_COMPILER_IS_GNUCC)
set(USE_GCC TRUE)
@ -210,8 +236,14 @@ endif()
set(SDL_LIBS "-lSDL2")
set(SDL_CFLAGS "")
# Emscripten toolchain has a nonempty default value for this, and the checks
# in this file need to change that, so remember the original value, and
# When building shared lib for Windows with MinGW,
# avoid the DLL having a "lib" prefix
if(WINDOWS)
set(CMAKE_SHARED_LIBRARY_PREFIX "")
endif()
# Emscripten toolchain has a nonempty default value for this, and the checks
# in this file need to change that, so remember the original value, and
# restore back to that afterwards. For check_function_exists() to work in
# Emscripten, this value must be at its default value.
set(ORIG_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
@ -244,7 +276,7 @@ endif()
set(OPT_DEF_ASM TRUE)
if(EMSCRIPTEN)
# Set up default values for the currently supported set of subsystems:
# Emscripten/Javascript does not have assembly support, a dynamic library
# Emscripten/Javascript does not have assembly support, a dynamic library
# loading architecture, low-level CPU inspection or multithreading.
set(OPT_DEF_ASM FALSE)
set(SDL_SHARED_ENABLED_BY_DEFAULT OFF)
@ -255,13 +287,28 @@ if(EMSCRIPTEN)
set(SDL_DLOPEN_ENABLED_BY_DEFAULT OFF)
endif()
# When defined, respect CMake's BUILD_SHARED_LIBS setting:
set(SDL_STATIC_ENABLED_BY_DEFAULT ON)
if (NOT DEFINED SDL_SHARED_ENABLED_BY_DEFAULT)
# ...unless decided already (as for EMSCRIPTEN)
set(SDL_SHARED_ENABLED_BY_DEFAULT OFF)
if (NOT DEFINED BUILD_SHARED_LIBS)
# No preference? Build both, just like the AC/AM configure
set(SDL_SHARED_ENABLED_BY_DEFAULT ON)
elseif (BUILD_SHARED_LIBS)
# In this case, we assume the user wants a shared lib and don't build
# the static one
set(SDL_SHARED_ENABLED_BY_DEFAULT ON)
set(SDL_STATIC_ENABLED_BY_DEFAULT OFF)
endif()
endif()
set(SDL_SUBSYSTEMS
Atomic Audio Video Render Events Joystick Haptic Power Threads Timers
File Loadso CPUinfo Filesystem Dlopen)
File Loadso CPUinfo Filesystem Dlopen Sensor)
foreach(_SUB ${SDL_SUBSYSTEMS})
string(TOUPPER ${_SUB} _OPT)
if (NOT DEFINED SDL_${_OPT}_ENABLED_BY_DEFAULT)
@ -282,6 +329,8 @@ set_option(SSE "Use SSE assembly routines" ${OPT_DEF_ASM})
set_option(SSE2 "Use SSE2 assembly routines" ${OPT_DEF_SSEMATH})
set_option(SSE3 "Use SSE3 assembly routines" ${OPT_DEF_SSEMATH})
set_option(ALTIVEC "Use Altivec assembly routines" ${OPT_DEF_ASM})
set_option(ARMSIMD "use SIMD assembly blitters on ARM" ON)
set_option(ARMNEON "use NEON assembly blitters on ARM" ON)
set_option(DISKAUDIO "Support the disk writer audio driver" ON)
set_option(DUMMYAUDIO "Support the dummy audio driver" ON)
set_option(VIDEO_DIRECTFB "Use DirectFB video driver" OFF)
@ -292,7 +341,7 @@ set_option(VIDEO_OPENGLES "Include OpenGL ES support" ON)
set_option(PTHREADS "Use POSIX threads for multi-threading" ${SDL_PTHREADS_ENABLED_BY_DEFAULT})
dep_option(PTHREADS_SEM "Use pthread semaphores" ON "PTHREADS" OFF)
set_option(SDL_DLOPEN "Use dlopen for shared object loading" ${SDL_DLOPEN_ENABLED_BY_DEFAULT})
set_option(OSS "Support the OSS audio API" ${UNIX_SYS})
dep_option(OSS "Support the OSS audio API" ON "UNIX_SYS OR RISCOS" OFF)
set_option(ALSA "Support the ALSA audio API" ${UNIX_SYS})
dep_option(ALSA_SHARED "Dynamically load ALSA audio support" ON "ALSA" OFF)
set_option(JACK "Support the JACK audio API" ${UNIX_SYS})
@ -317,8 +366,6 @@ set_option(VIDEO_X11 "Use X11 video driver" ${UNIX_SYS})
set_option(VIDEO_WAYLAND "Use Wayland video driver" ${UNIX_SYS})
dep_option(WAYLAND_SHARED "Dynamically load Wayland support" ON "VIDEO_WAYLAND" OFF)
dep_option(VIDEO_WAYLAND_QT_TOUCH "QtWayland server support for Wayland video driver" ON "VIDEO_WAYLAND" OFF)
set_option(VIDEO_MIR "Use Mir video driver" ${UNIX_SYS})
dep_option(MIR_SHARED "Dynamically load Mir support" ON "VIDEO_MIR" OFF)
set_option(VIDEO_RPI "Use Raspberry Pi video driver" ${UNIX_SYS})
dep_option(X11_SHARED "Dynamically load X11 support" ON "VIDEO_X11" OFF)
set(SDL_X11_OPTIONS Xcursor Xinerama XInput Xrandr Xscrnsaver XShape Xvm)
@ -328,16 +375,21 @@ foreach(_SUB ${SDL_X11_OPTIONS})
endforeach()
set_option(VIDEO_COCOA "Use Cocoa video driver" ${APPLE})
set_option(DIRECTX "Use DirectX for Windows audio/video" ${WINDOWS})
set_option(WASAPI "Use the Windows WASAPI audio driver" ${WINDOWS})
set_option(RENDER_D3D "Enable the Direct3D render driver" ${WINDOWS})
set_option(RENDER_METAL "Enable the Metal render driver" ${APPLE})
set_option(VIDEO_VIVANTE "Use Vivante EGL video driver" ${UNIX_SYS})
dep_option(VIDEO_VULKAN "Enable Vulkan support" ON "ANDROID OR APPLE OR LINUX OR WINDOWS" OFF)
set_option(VIDEO_METAL "Enable Metal support" ${APPLE})
set_option(VIDEO_KMSDRM "Use KMS DRM video driver" ${UNIX_SYS})
dep_option(KMSDRM_SHARED "Dynamically load KMS DRM support" ON "VIDEO_KMSDRM" OFF)
set_option(VIDEO_OFFSCREEN "Use offscreen video driver" OFF)
option_string(BACKGROUNDING_SIGNAL "number to use for magic backgrounding signal or 'OFF'" "OFF")
option_string(FOREGROUNDING_SIGNAL "number to use for magic foregrounding signal or 'OFF'" "OFF")
set_option(HIDAPI "Use HIDAPI for low level joystick drivers" ${OPT_DEF_HIDAPI})
# TODO: We should (should we?) respect cmake's ${BUILD_SHARED_LIBS} flag here
# The options below are for compatibility to configure's default behaviour.
set(SDL_SHARED ${SDL_SHARED_ENABLED_BY_DEFAULT} CACHE BOOL "Build a shared version of the library")
set(SDL_STATIC ON CACHE BOOL "Build a static version of the library")
set(SDL_STATIC ${SDL_STATIC_ENABLED_BY_DEFAULT} CACHE BOOL "Build a static version of the library")
dep_option(SDL_STATIC_PIC "Static version of the library should be built with Position Independent Code" OFF "SDL_STATIC" OFF)
set_option(SDL_TEST "Build the test directory" OFF)
@ -376,6 +428,14 @@ else()
endif()
set(HAVE_ASSERTIONS ${ASSERTIONS})
if(NOT BACKGROUNDING_SIGNAL STREQUAL "OFF")
add_definitions("-DSDL_BACKGROUNDING_SIGNAL=${BACKGROUNDING_SIGNAL}")
endif()
if(NOT FOREGROUNDING_SIGNAL STREQUAL "OFF")
add_definitions("-DSDL_FOREGROUNDING_SIGNAL=${FOREGROUNDING_SIGNAL}")
endif()
# Compiler option evaluation
if(USE_GCC OR USE_CLANG)
# Check for -Wall first, so later things can override pieces of it.
@ -387,6 +447,11 @@ if(USE_GCC OR USE_CLANG)
endif()
endif()
check_c_compiler_flag(-fno-strict-aliasing HAVE_GCC_NO_STRICT_ALIASING)
if(HAVE_GCC_NO_STRICT_ALIASING)
list(APPEND EXTRA_CFLAGS "-fno-strict-aliasing")
endif()
check_c_compiler_flag(-Wdeclaration-after-statement HAVE_GCC_WDECLARATION_AFTER_STATEMENT)
if(HAVE_GCC_WDECLARATION_AFTER_STATEMENT)
check_c_compiler_flag(-Werror=declaration-after-statement HAVE_GCC_WERROR_DECLARATION_AFTER_STATEMENT)
@ -444,6 +509,8 @@ if(USE_GCC OR USE_CLANG)
if(APPLE)
list(APPEND EXTRA_LDFLAGS "-Wl,-undefined,error")
list(APPEND EXTRA_LDFLAGS "-Wl,-compatibility_version,${DYLIB_COMPATIBILITY_VERSION}")
list(APPEND EXTRA_LDFLAGS "-Wl,-current_version,${DYLIB_CURRENT_VERSION}")
else()
set(CMAKE_REQUIRED_FLAGS "-Wl,--no-undefined")
check_c_compiler_flag("" HAVE_NO_UNDEFINED)
@ -606,6 +673,61 @@ if(ASSEMBLY)
endif()
endif()
endif()
if(ARMSIMD)
set(ORIG_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -x assembler-with-cpp")
check_c_source_compiles("
.text
.arch armv6
.object_arch armv4
.arm
.altmacro
#ifndef __ARM_EABI__
#error EABI is required (to be sure that calling conventions are compatible)
#endif
pld [r0]
uqadd8 r0, r0, r0
" ARMSIMD_FOUND)
set(CMAKE_REQUIRED_FLAGS "${ORIG_CMAKE_REQUIRED_FLAGS}")
if(ARMSIMD_FOUND)
set(HAVE_ARMSIMD TRUE)
set(SDL_ARM_SIMD_BLITTERS 1)
file(GLOB ARMSIMD_SOURCES ${SDL2_SOURCE_DIR}/src/video/arm/pixman-arm-simd*.S)
set(SOURCE_FILES ${SOURCE_FILES} ${ARMSIMD_SOURCES})
set(WARN_ABOUT_ARM_SIMD_ASM_MIT TRUE)
endif()
endif()
if(ARMNEON)
set(ORIG_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -x assembler-with-cpp")
check_c_source_compiles("
.text
.fpu neon
.arch armv7a
.object_arch armv4
.eabi_attribute 10, 0
.arm
.altmacro
#ifndef __ARM_EABI__
#error EABI is required (to be sure that calling conventions are compatible)
#endif
pld [r0]
vmovn.u16 d0, q0
" ARMNEON_FOUND)
set(CMAKE_REQUIRED_FLAGS "${ORIG_CMAKE_REQUIRED_FLAGS}")
if(ARMNEON_FOUND)
set(HAVE_ARMNEON TRUE)
set(SDL_ARM_NEON_BLITTERS 1)
file(GLOB ARMNEON_SOURCES ${SDL2_SOURCE_DIR}/src/video/arm/pixman-arm-neon*.S)
set(SOURCE_FILES ${SOURCE_FILES} ${ARMNEON_SOURCES})
set(WARN_ABOUT_ARM_NEON_ASM_MIT TRUE)
endif()
endif()
elseif(MSVC_VERSION GREATER 1500)
# TODO: SDL_cpuinfo.h needs to support the user's configuration wish
# for MSVC - right now it is always activated
@ -638,12 +760,12 @@ if(LIBC)
set(HAVE_SIGNAL_H 1)
foreach(_FN
malloc calloc realloc free qsort abs memset memcpy memmove memcmp
wcslen wcscmp
wcslen wcslcpy wcslcat wcsdup wcsstr wcscmp wcsncmp
strlen _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa
_ultoa strtol strtoul strtoll strtod atoi atof strcmp strncmp
_stricmp _strnicmp sscanf
_stricmp _strnicmp strtok_s sscanf
acos acosf asin asinf atan atanf atan2 atan2f ceil ceilf
copysign copysignf cos cosf fabs fabsf floor floorf fmod fmodf
copysign copysignf cos cosf exp expf fabs fabsf floor floorf fmod fmodf
log logf log10 log10f pow powf scalbn scalbnf sin sinf sqrt sqrtf tan tanf)
string(TOUPPER ${_FN} _UPPER)
set(HAVE_${_UPPER} 1)
@ -675,11 +797,12 @@ if(LIBC)
foreach(_FN
strtod malloc calloc realloc free getenv setenv putenv unsetenv
qsort abs bcopy memset memcpy memmove memcmp strlen strlcpy strlcat
_strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa
_strrev _strupr _strlwr strchr strrchr strstr strtok_r itoa _ltoa
_uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull
atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp
vsscanf vsnprintf fopen64 fseeko fseeko64 sigaction setjmp
nanosleep sysconf sysctlbyname getauxval poll
wcscmp wcsdup wcslcat wcslcpy wcslen wcsncmp wcsstr
sscanf vsscanf vsnprintf fopen64 fseeko fseeko64 sigaction setjmp
nanosleep sysconf sysctlbyname getauxval poll _Exit
)
string(TOUPPER ${_FN} _UPPER)
set(_HAVEVAR "HAVE_${_UPPER}")
@ -690,8 +813,10 @@ if(LIBC)
if(HAVE_LIBM)
set(CMAKE_REQUIRED_LIBRARIES m)
foreach(_FN
atan atan2 ceil copysign cos cosf fabs floor log pow scalbn sin
sinf sqrt sqrtf tan tanf acos asin)
atan atan2 atanf atan2f ceil ceilf copysign copysignf cos cosf
exp expf fabs fabsf floor floorf fmod fmodf log logf log10 log10f
pow powf scalbn scalbnf sin sinf sqrt sqrtf tan tanf acos acosf
asin asinf)
string(TOUPPER ${_FN} _UPPER)
set(_HAVEVAR "HAVE_${_UPPER}")
check_function_exists("${_FN}" ${_HAVEVAR})
@ -743,11 +868,15 @@ if(SDL_HAPTIC)
file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${HAPTIC_SOURCES})
endif()
if(SDL_SENSOR)
file(GLOB SENSOR_SOURCES ${SDL2_SOURCE_DIR}/src/sensor/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${SENSOR_SOURCES})
endif()
if(SDL_POWER)
file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${POWER_SOURCES})
endif()
# TODO: in configure.in, the test for LOADSO and SDL_DLOPEN is a bit weird:
# TODO: in configure.ac, the test for LOADSO and SDL_DLOPEN is a bit weird:
# if LOADSO is not wanted, SDL_LOADSO_DISABLED is set
# If however on Unix or APPLE dlopen() is detected via CheckDLOPEN(),
# SDL_LOADSO_DISABLED will not be set, regardless of the LOADSO settings
@ -784,8 +913,16 @@ if(SDL_VIDEO)
set(HAVE_VIDEO_DUMMY TRUE)
set(HAVE_SDL_VIDEO TRUE)
endif()
if(VIDEO_OFFSCREEN)
set(SDL_VIDEO_DRIVER_OFFSCREEN 1)
file(GLOB VIDEO_OFFSCREEN_SOURCES ${SDL2_SOURCE_DIR}/src/video/offscreen/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${VIDEO_OFFSCREEN_SOURCES})
set(HAVE_VIDEO_OFFSCREEN TRUE)
set(HAVE_SDL_VIDEO TRUE)
endif()
endif()
# Platform-specific options and settings
if(ANDROID)
file(GLOB ANDROID_CORE_SOURCES ${SDL2_SOURCE_DIR}/src/core/android/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_CORE_SOURCES})
@ -821,6 +958,7 @@ if(ANDROID)
set(HAVE_SDL_HAPTIC TRUE)
endif()
if(SDL_JOYSTICK)
CheckHIDAPI()
set(SDL_JOYSTICK_ANDROID 1)
file(GLOB ANDROID_JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/android/*.c ${SDL2_SOURCE_DIR}/src/joystick/steam/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_JOYSTICK_SOURCES})
@ -844,6 +982,12 @@ if(ANDROID)
set(SOURCE_FILES ${SOURCE_FILES} ${TIMER_SOURCES})
set(HAVE_SDL_TIMERS TRUE)
endif()
if(SDL_SENSOR)
set(SDL_SENSOR_ANDROID 1)
set(HAVE_SDL_SENSORS TRUE)
file(GLOB ANDROID_SENSOR_SOURCES ${SDL2_SOURCE_DIR}/src/sensor/android/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_SENSOR_SOURCES})
endif()
if(SDL_VIDEO)
set(SDL_VIDEO_DRIVER_ANDROID 1)
file(GLOB ANDROID_VIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/android/*.c)
@ -851,16 +995,24 @@ if(ANDROID)
set(HAVE_SDL_VIDEO TRUE)
# Core stuff
find_library(ANDROID_DL_LIBRARY dl)
# find_library(ANDROID_DL_LIBRARY dl)
# FIXME failing dlopen https://github.com/android-ndk/ndk/issues/929
find_library(ANDROID_DL_LIBRARY NAMES libdl.so dl)
find_library(ANDROID_LOG_LIBRARY log)
find_library(ANDROID_LIBRARY_LIBRARY android)
list(APPEND EXTRA_LIBS ${ANDROID_DL_LIBRARY} ${ANDROID_LOG_LIBRARY} ${ANDROID_LIBRARY_LIBRARY})
add_definitions(-DGL_GLEXT_PROTOTYPES)
if (HAVE_HIDAPI)
list(APPEND EXTRA_LIBS hidapi)
endif()
#enable gles
if(VIDEO_OPENGLES)
set(SDL_VIDEO_OPENGL_EGL 1)
set(HAVE_VIDEO_OPENGLES TRUE)
set(SDL_VIDEO_OPENGL_ES 1)
set(SDL_VIDEO_RENDER_OGL_ES 1)
set(SDL_VIDEO_OPENGL_ES2 1)
set(SDL_VIDEO_RENDER_OGL_ES2 1)
@ -886,10 +1038,7 @@ if(ANDROID)
CheckPTHREAD()
endif()
# Platform-specific options and settings
if(EMSCRIPTEN)
elseif(EMSCRIPTEN)
# Hide noisy warnings that intend to aid mostly during initial stages of porting a new
# project. Uncomment at will for verbose cross-compiling -I/../ path info.
add_definitions(-Wno-warn-absolute-paths)
@ -941,7 +1090,8 @@ if(EMSCRIPTEN)
set(SDL_VIDEO_RENDER_OGL_ES2 1)
endif()
endif()
elseif(UNIX AND NOT APPLE AND NOT ANDROID)
elseif(UNIX AND NOT APPLE AND NOT ANDROID AND NOT RISCOS)
if(SDL_AUDIO)
if(SYSV5 OR SOLARIS OR HPUX)
set(SDL_AUDIO_DRIVER_SUNAUDIO 1)
@ -975,7 +1125,6 @@ elseif(UNIX AND NOT APPLE AND NOT ANDROID)
# Need to check for Raspberry PI first and add platform specific compiler flags, otherwise the test for GLES fails!
CheckRPI()
CheckX11()
CheckMir()
CheckDirectFB()
CheckOpenGLX11()
CheckOpenGLESX11()
@ -1001,7 +1150,7 @@ elseif(UNIX AND NOT APPLE AND NOT ANDROID)
#include <linux/kd.h>
#include <linux/keyboard.h>
int main(int argc, char **argv)
int main(int argc, char **argv)
{
struct kbentry kbe;
kbe.kb_table = KG_CTRL;
@ -1041,6 +1190,13 @@ elseif(UNIX AND NOT APPLE AND NOT ANDROID)
set(HAVE_IBUS_IBUS_H TRUE)
include_directories(${IBUS_INCLUDE_DIRS})
list(APPEND EXTRA_LIBS ${IBUS_LIBRARIES})
add_definitions(-DSDL_USE_IME)
endif()
if(HAVE_LIBUNWIND_H)
# We've already found the header, so REQUIRE the lib to be present
pkg_search_module(UNWIND REQUIRED libunwind)
pkg_search_module(UNWIND_GENERIC REQUIRED libunwind-generic)
list(APPEND EXTRA_LIBS ${UNWIND_LIBRARIES} ${UNWIND_GENERIC_LIBRARIES})
endif()
endif()
@ -1058,7 +1214,10 @@ elseif(UNIX AND NOT APPLE AND NOT ANDROID)
endif()
if(SDL_JOYSTICK)
CheckUSBHID() # seems to be BSD specific - limit the test to BSD only?
if(FREEBSD OR NETBSD OR OPENBSD OR BSDI)
CheckUSBHID()
endif()
CheckHIDAPI()
if(LINUX AND NOT ANDROID)
set(SDL_JOYSTICK_LINUX 1)
file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/linux/*.c ${SDL2_SOURCE_DIR}/src/joystick/steam/*.c)
@ -1183,8 +1342,6 @@ elseif(WINDOWS)
check_include_file(ddraw.h HAVE_DDRAW_H)
check_include_file(dsound.h HAVE_DSOUND_H)
check_include_file(dinput.h HAVE_DINPUT_H)
check_include_file(mmdeviceapi.h HAVE_MMDEVICEAPI_H)
check_include_file(audioclient.h HAVE_AUDIOCLIENT_H)
check_include_file(dxgi.h HAVE_DXGI_H)
if(HAVE_D3D_H OR HAVE_D3D11_H OR HAVE_DDRAW_H OR HAVE_DSOUND_H OR HAVE_DINPUT_H)
set(HAVE_DIRECTX TRUE)
@ -1197,6 +1354,10 @@ elseif(WINDOWS)
set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
endif()
# headers needed elsewhere
check_include_file(mmdeviceapi.h HAVE_MMDEVICEAPI_H)
check_include_file(audioclient.h HAVE_AUDIOCLIENT_H)
if(SDL_AUDIO)
set(SDL_AUDIO_DRIVER_WINMM 1)
file(GLOB WINMM_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/winmm/*.c)
@ -1209,7 +1370,7 @@ elseif(WINDOWS)
set(SOURCE_FILES ${SOURCE_FILES} ${DSOUND_AUDIO_SOURCES})
endif()
if(HAVE_AUDIOCLIENT_H AND HAVE_MMDEVICEAPI_H)
if(WASAPI AND HAVE_AUDIOCLIENT_H AND HAVE_MMDEVICEAPI_H)
set(SDL_AUDIO_DRIVER_WASAPI 1)
file(GLOB WASAPI_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/wasapi/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${WASAPI_AUDIO_SOURCES})
@ -1261,9 +1422,9 @@ elseif(WINDOWS)
endif()
# Libraries for Win32 native and MinGW
list(APPEND EXTRA_LIBS user32 gdi32 winmm imm32 ole32 oleaut32 version uuid)
list(APPEND EXTRA_LIBS user32 gdi32 winmm imm32 ole32 oleaut32 version uuid advapi32 setupapi shell32)
# TODO: in configure.in the check for timers is set on
# TODO: in configure.ac the check for timers is set on
# cygwin | mingw32* - does this include mingw32CE?
if(SDL_TIMERS)
set(SDL_TIMER_WINDOWS 1)
@ -1299,6 +1460,11 @@ elseif(WINDOWS)
endif()
if(SDL_JOYSTICK)
CheckHIDAPI()
# TODO: Remove this hid.c block when SDL_hidapi.c is supported on Windows!
if(HAVE_HIDAPI)
set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/hidapi/windows/hid.c)
endif()
file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/windows/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${JOYSTICK_SOURCES})
if(HAVE_DINPUT_H)
@ -1344,6 +1510,7 @@ elseif(WINDOWS)
set(SDL_CFLAGS "${SDL_CFLAGS} -Dmain=SDL_main")
list(APPEND SDL_LIBS "-lmingw32" "-lSDL2main" "-mwindows")
endif()
elseif(APPLE)
# TODO: rework this all for proper MacOS X, iOS and Darwin support
@ -1351,10 +1518,11 @@ elseif(APPLE)
# !!! FIXME: we need Carbon for some very old API calls in
# !!! FIXME: src/video/cocoa/SDL_cocoakeyboard.c, but we should figure out
# !!! FIXME: how to dump those.
if(NOT IOS)
if(DARWIN OR MACOSX)
set(SDL_FRAMEWORK_COCOA 1)
set(SDL_FRAMEWORK_CARBON 1)
endif()
set(SDL_FRAMEWORK_FOUNDATION 1)
# Requires the darwin file implementation
if(SDL_FILE)
@ -1378,48 +1546,63 @@ elseif(APPLE)
set(HAVE_SDL_AUDIO TRUE)
set(SDL_FRAMEWORK_COREAUDIO 1)
set(SDL_FRAMEWORK_AUDIOTOOLBOX 1)
set(SDL_FRAMEWORK_AVFOUNDATION 1)
endif()
if(SDL_JOYSTICK)
set(SDL_JOYSTICK_IOKIT 1)
if (IOS)
CheckHIDAPI()
if(HAVE_HIDAPI)
if(IOS OR TVOS)
set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/hidapi/ios/hid.m)
set(SDL_FRAMEWORK_COREBLUETOOTH 1)
endif()
endif()
if(IOS OR TVOS)
file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/iphoneos/*.m ${SDL2_SOURCE_DIR}/src/joystick/steam/*.c)
set(SDL_JOYSTICK_MFI 1)
if(IOS)
set(SDL_FRAMEWORK_COREMOTION 1)
endif()
set(SDL_FRAMEWORK_GAMECONTROLLER 1)
set(HAVE_SDL_SENSORS 1)
else()
file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/darwin/*.c)
set(SDL_JOYSTICK_IOKIT 1)
set(SDL_FRAMEWORK_IOKIT 1)
set(SDL_FRAMEWORK_FF 1)
endif()
set(SOURCE_FILES ${SOURCE_FILES} ${JOYSTICK_SOURCES})
set(HAVE_SDL_JOYSTICK TRUE)
set(SDL_FRAMEWORK_IOKIT 1)
set(SDL_FRAMEWORK_FF 1)
endif()
if(SDL_HAPTIC)
set(SDL_HAPTIC_IOKIT 1)
if (IOS)
if (IOS OR TVOS)
file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/dummy/*.c)
set(SDL_HAPTIC_DUMMY 1)
else()
file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/darwin/*.c)
set(SDL_HAPTIC_IOKIT 1)
set(SDL_FRAMEWORK_IOKIT 1)
set(SDL_FRAMEWORK_FF 1)
endif()
set(SOURCE_FILES ${SOURCE_FILES} ${HAPTIC_SOURCES})
set(HAVE_SDL_HAPTIC TRUE)
set(SDL_FRAMEWORK_IOKIT 1)
set(SDL_FRAMEWORK_FF 1)
if(NOT SDL_JOYSTICK)
message(FATAL_ERROR "SDL_HAPTIC requires SDL_JOYSTICK to be enabled")
endif()
endif()
if(SDL_POWER)
set(SDL_POWER_MACOSX 1)
if (IOS)
if (IOS OR TVOS)
file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/uikit/*.m)
set(SDL_POWER_UIKIT 1)
else()
file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/macosx/*.c)
set(SDL_POWER_MACOSX 1)
set(SDL_FRAMEWORK_IOKIT 1)
endif()
set(SOURCE_FILES ${SOURCE_FILES} ${POWER_SOURCES})
set(HAVE_SDL_POWER TRUE)
set(SDL_FRAMEWORK_IOKIT 1)
endif()
if(SDL_TIMERS)
@ -1438,6 +1621,89 @@ elseif(APPLE)
set(HAVE_SDL_FILESYSTEM TRUE)
endif()
if(SDL_SENSOR)
if(IOS)
set(SDL_SENSOR_COREMOTION 1)
set(HAVE_SDL_SENSORS TRUE)
file(GLOB SENSOR_SOURCES ${SDL2_SOURCE_DIR}/src/sensor/coremotion/*.m)
set(SOURCE_FILES ${SOURCE_FILES} ${SENSOR_SOURCES})
endif()
endif()
# iOS hack needed - http://code.google.com/p/ios-cmake/ ?
if(SDL_VIDEO)
if (IOS OR TVOS)
set(SDL_VIDEO_DRIVER_UIKIT 1)
set(SDL_FRAMEWORK_COREGRAPHICS 1)
set(SDL_FRAMEWORK_QUARTZCORE 1)
set(SDL_FRAMEWORK_UIKIT 1)
set(SDL_IPHONE_KEYBOARD 1)
set(SDL_IPHONE_LAUNCHSCREEN 1)
file(GLOB UIKITVIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/uikit/*.m)
set(SOURCE_FILES ${SOURCE_FILES} ${UIKITVIDEO_SOURCES})
else()
CheckCOCOA()
if(VIDEO_OPENGL)
set(SDL_VIDEO_OPENGL 1)
set(SDL_VIDEO_OPENGL_CGL 1)
set(SDL_VIDEO_RENDER_OGL 1)
set(HAVE_VIDEO_OPENGL TRUE)
endif()
endif()
if(VIDEO_OPENGLES)
if(IOS OR TVOS)
set(SDL_FRAMEWORK_OPENGLES 1)
set(SDL_VIDEO_OPENGL_ES 1)
set(SDL_VIDEO_RENDER_OGL_ES 1)
else()
set(SDL_VIDEO_OPENGL_EGL 1)
endif()
set(SDL_VIDEO_OPENGL_ES2 1)
set(SDL_VIDEO_RENDER_OGL_ES2 1)
set(HAVE_VIDEO_OPENGLES TRUE)
endif()
if(VIDEO_VULKAN OR VIDEO_METAL OR RENDER_METAL)
set(ORIG_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -x objective-c")
check_c_source_compiles("
#include <AvailabilityMacros.h>
#import <Metal/Metal.h>
#import <QuartzCore/CAMetalLayer.h>
#if TARGET_OS_SIMULATOR || (!TARGET_CPU_X86_64 && !TARGET_CPU_ARM64)
#error Metal doesn't work on this configuration
#endif
int main()
{
return 0;
}
" HAVE_FRAMEWORK_METAL)
set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
if(HAVE_FRAMEWORK_METAL)
set(SDL_FRAMEWORK_METAL 1)
set(SDL_FRAMEWORK_QUARTZCORE 1)
else()
set(VIDEO_VULKAN 0)
set(VIDEO_METAL 0)
set(RENDER_METAL 0)
endif()
endif()
if(VIDEO_METAL)
set(SDL_VIDEO_METAL 1)
set(HAVE_VIDEO_METAL TRUE)
endif()
if(RENDER_METAL)
file(GLOB RENDER_METAL_SOURCES ${SDL2_SOURCE_DIR}/src/render/metal/*.m)
set(SOURCE_FILES ${SOURCE_FILES} ${RENDER_METAL_SOURCES})
set(SDL_VIDEO_RENDER_METAL 1)
set(HAVE_RENDER_METAL TRUE)
endif()
endif()
# Actually load the frameworks at the end so we don't duplicate include.
if(SDL_FRAMEWORK_COREVIDEO)
find_library(COREVIDEO CoreVideo)
@ -1467,32 +1733,57 @@ elseif(APPLE)
find_library(AUDIOTOOLBOX AudioToolbox)
list(APPEND EXTRA_LIBS ${AUDIOTOOLBOX})
endif()
# iOS hack needed - http://code.google.com/p/ios-cmake/ ?
if(SDL_VIDEO)
if (IOS)
set(SDL_VIDEO_DRIVER_UIKIT 1)
file(GLOB UIKITVIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/uikit/*.m)
set(SOURCE_FILES ${SOURCE_FILES} ${UIKITVIDEO_SOURCES})
if(SDL_FRAMEWORK_AVFOUNDATION)
find_library(AVFOUNDATION AVFoundation)
list(APPEND EXTRA_LIBS ${AVFOUNDATION})
endif()
if(SDL_FRAMEWORK_COREBLUETOOTH)
find_library(COREBLUETOOTH CoreBluetooth)
list(APPEND EXTRA_LIBS ${COREBLUETOOTH})
endif()
if(SDL_FRAMEWORK_COREGRAPHICS)
find_library(COREGRAPHICS CoreGraphics)
list(APPEND EXTRA_LIBS ${COREGRAPHICS})
endif()
if(SDL_FRAMEWORK_COREMOTION)
find_library(COREMOTION CoreMotion)
list(APPEND EXTRA_LIBS ${COREMOTION})
endif()
if(SDL_FRAMEWORK_FOUNDATION)
find_library(FOUNDATION Foundation)
list(APPEND EXTRA_LIBS ${FOUNDATION})
endif()
if(SDL_FRAMEWORK_GAMECONTROLLER)
find_library(GAMECONTROLLER GameController)
list(APPEND EXTRA_LIBS ${GAMECONTROLLER})
endif()
if(SDL_FRAMEWORK_METAL)
if(IOS OR TVOS)
find_library(METAL Metal)
list(APPEND EXTRA_LIBS ${METAL})
else()
CheckCOCOA()
if(VIDEO_OPENGL)
set(SDL_VIDEO_OPENGL 1)
set(SDL_VIDEO_OPENGL_CGL 1)
set(SDL_VIDEO_RENDER_OGL 1)
set(HAVE_VIDEO_OPENGL TRUE)
endif()
if(VIDEO_OPENGLES)
set(SDL_VIDEO_OPENGL_EGL 1)
set(SDL_VIDEO_OPENGL_ES2 1)
set(SDL_VIDEO_RENDER_OGL_ES2 1)
set(HAVE_VIDEO_OPENGLES TRUE)
endif()
list(APPEND EXTRA_LDFLAGS "-Wl,-weak_framework,Metal")
endif()
endif()
if(SDL_FRAMEWORK_OPENGLES)
find_library(OPENGLES OpenGLES)
list(APPEND EXTRA_LIBS ${OPENGLES})
endif()
if(SDL_FRAMEWORK_QUARTZCORE)
if(IOS OR TVOS)
find_library(QUARTZCORE QuartzCore)
list(APPEND EXTRA_LIBS ${QUARTZCORE})
else()
list(APPEND EXTRA_LDFLAGS "-Wl,-weak_framework,QuartzCore")
endif()
endif()
if(SDL_FRAMEWORK_UIKIT)
find_library(UIKIT UIKit)
list(APPEND EXTRA_LIBS ${UIKIT})
endif()
CheckPTHREAD()
elseif(HAIKU)
if(SDL_VIDEO)
set(SDL_VIDEO_DRIVER_HAIKU 1)
@ -1523,14 +1814,33 @@ elseif(HAIKU)
endif()
CheckPTHREAD()
elseif(RISCOS)
if(SDL_TIMERS)
set(SDL_TIMER_UNIX 1)
file(GLOB TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/unix/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${TIMER_SOURCES})
set(HAVE_SDL_TIMERS TRUE)
if(CLOCK_GETTIME)
set(HAVE_CLOCK_GETTIME 1)
endif()
endif()
CheckPTHREAD()
if(SDL_AUDIO)
CheckOSS()
endif()
endif()
if(VIDEO_VULKAN)
set(SDL_VIDEO_VULKAN 1)
set(HAVE_VIDEO_VULKAN TRUE)
endif()
# Dummies
# configure.in does it differently:
# configure.ac does it differently:
# if not have X
# if enable_X { SDL_X_DISABLED = 1 }
# [add dummy sources]
@ -1538,7 +1848,7 @@ endif()
# This leads to missing internal references on building, since the
# src/X/*.c does not get included.
if(NOT HAVE_SDL_JOYSTICK)
set(SDL_JOYSTICK_DISABLED 1)
set(SDL_JOYSTICK_DUMMY 1)
if(SDL_JOYSTICK AND NOT APPLE) # results in unresolved symbols on OSX
file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/dummy/*.c)
@ -1546,10 +1856,15 @@ if(NOT HAVE_SDL_JOYSTICK)
endif()
endif()
if(NOT HAVE_SDL_HAPTIC)
set(SDL_HAPTIC_DISABLED 1)
set(SDL_HAPTIC_DUMMY 1)
file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/dummy/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${HAPTIC_SOURCES})
endif()
if(NOT HAVE_SDL_SENSORS)
set(SDL_SENSOR_DUMMY 1)
file(GLOB SENSORS_SOURCES ${SDL2_SOURCE_DIR}/src/sensor/dummy/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${SENSORS_SOURCES})
endif()
if(NOT HAVE_SDL_LOADSO)
set(SDL_LOADSO_DISABLED 1)
file(GLOB LOADSO_SOURCES ${SDL2_SOURCE_DIR}/src/loadso/dummy/*.c)
@ -1690,21 +2005,45 @@ if(UNIX)
message(STATUS "")
endif()
if(WARN_ABOUT_ARM_SIMD_ASM_MIT)
message(STATUS "")
message(STATUS "SDL is being built with ARM SIMD optimizations, which")
message(STATUS "uses code licensed under the MIT license. If this is a")
message(STATUS "problem, please disable that code by rerunning CMake with:")
message(STATUS "")
message(STATUS " -DARMSIMD=OFF")
endif()
if(WARN_ABOUT_ARM_NEON_ASM_MIT)
message(STATUS "")
message(STATUS "SDL is being built with ARM NEON optimizations, which")
message(STATUS "uses code licensed under the MIT license. If this is a")
message(STATUS "problem, please disable that code by rerunning CMake with:")
message(STATUS "")
message(STATUS " -DARMNEON=OFF")
endif()
# Ensure that the extra cflags are used at compile time
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
# Always build SDLmain
add_library(SDL2main STATIC ${SDLMAIN_SOURCES})
target_include_directories(SDL2main PUBLIC $<INSTALL_INTERFACE:include>)
target_include_directories(SDL2main PUBLIC "$<BUILD_INTERFACE:${SDL2_SOURCE_DIR}/include>" $<INSTALL_INTERFACE:include> $<INSTALL_INTERFACE:include/SDL2>)
set(_INSTALL_LIBS "SDL2main")
if (NOT ANDROID)
set_target_properties(SDL2main PROPERTIES DEBUG_POSTFIX ${SDL_CMAKE_DEBUG_POSTFIX})
set_target_properties(SDL2main PROPERTIES DEBUG_POSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}")
endif()
if (ANDROID AND HAVE_HIDAPI)
set(_INSTALL_LIBS ${_INSTALL_LIBS} "hidapi")
endif()
if(SDL_SHARED)
add_library(SDL2 SHARED ${SOURCE_FILES} ${VERSION_SOURCES})
if(APPLE)
set_target_properties(SDL2 PROPERTIES MACOSX_RPATH 1)
set_target_properties(SDL2 PROPERTIES
MACOSX_RPATH 1
OUTPUT_NAME "SDL2-${LT_RELEASE}")
elseif(UNIX AND NOT ANDROID)
set_target_properties(SDL2 PROPERTIES
VERSION ${LT_VERSION}
@ -1724,9 +2063,29 @@ if(SDL_SHARED)
endif()
set(_INSTALL_LIBS "SDL2" ${_INSTALL_LIBS})
target_link_libraries(SDL2 ${EXTRA_LIBS} ${EXTRA_LDFLAGS})
target_include_directories(SDL2 PUBLIC $<INSTALL_INTERFACE:include>)
target_include_directories(SDL2 PUBLIC "$<BUILD_INTERFACE:${SDL2_SOURCE_DIR}/include>" $<INSTALL_INTERFACE:include> $<INSTALL_INTERFACE:include/SDL2>)
if (NOT ANDROID)
set_target_properties(SDL2 PROPERTIES DEBUG_POSTFIX ${SDL_CMAKE_DEBUG_POSTFIX})
set_target_properties(SDL2 PROPERTIES DEBUG_POSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}")
endif()
if(IOS OR TVOS)
set_property(TARGET SDL2 APPEND_STRING PROPERTY COMPILE_FLAGS "-fobjc-arc")
target_compile_definitions(SDL2 PRIVATE IOS_DYLIB=1)
endif()
endif()
if(ANDROID)
if(HAVE_HIDAPI)
add_library(hidapi SHARED ${SDL2_SOURCE_DIR}/src/hidapi/android/hid.cpp)
endif()
if(MSVC AND NOT LIBC)
# Don't try to link with the default set of libraries.
set_target_properties(hidapi PROPERTIES LINK_FLAGS_RELEASE "/NODEFAULTLIB")
set_target_properties(hidapi PROPERTIES LINK_FLAGS_DEBUG "/NODEFAULTLIB")
set_target_properties(hidapi PROPERTIES STATIC_LIBRARY_FLAGS "/NODEFAULTLIB")
endif()
if(HAVE_HIDAPI)
target_link_libraries(hidapi log)
endif()
endif()
@ -1750,9 +2109,12 @@ if(SDL_STATIC)
# libraries - do we need to consider this?
set(_INSTALL_LIBS "SDL2-static" ${_INSTALL_LIBS})
target_link_libraries(SDL2-static ${EXTRA_LIBS} ${EXTRA_LDFLAGS})
target_include_directories(SDL2-static PUBLIC $<INSTALL_INTERFACE:include>)
target_include_directories(SDL2-static PUBLIC "$<BUILD_INTERFACE:${SDL2_SOURCE_DIR}/include>" $<INSTALL_INTERFACE:include> $<INSTALL_INTERFACE:include/SDL2>)
if (NOT ANDROID)
set_target_properties(SDL2-static PROPERTIES DEBUG_POSTFIX ${SDL_CMAKE_DEBUG_POSTFIX})
set_target_properties(SDL2-static PROPERTIES DEBUG_POSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}")
endif()
if(IOS OR TVOS)
set_property(TARGET SDL2-static APPEND_STRING PROPERTY COMPILE_FLAGS "-fobjc-arc")
endif()
endif()
@ -1761,7 +2123,7 @@ endif()
if(SDL_TEST)
file(GLOB TEST_SOURCES ${SDL2_SOURCE_DIR}/src/test/*.c)
add_library(SDL2_test STATIC ${TEST_SOURCES})
add_subdirectory(test)
endif()
@ -1772,12 +2134,10 @@ install(TARGETS ${_INSTALL_LIBS} EXPORT SDL2Targets
RUNTIME DESTINATION bin)
##### Export files #####
if (APPLE)
set(PKG_PREFIX "SDL2.framework/Resources")
elseif (WINDOWS)
if (WINDOWS)
set(PKG_PREFIX "cmake")
else ()
set(PKG_PREFIX "lib/cmake/SDL2")
set(PKG_PREFIX "lib${LIB_SUFFIX}/cmake/SDL2")
endif ()
include(CMakePackageConfigHelpers)
@ -1808,18 +2168,23 @@ endforeach()
list(APPEND INCLUDE_FILES ${BIN_INCLUDE_FILES})
install(FILES ${INCLUDE_FILES} DESTINATION include/SDL2)
string(TOUPPER "${CMAKE_BUILD_TYPE}" UPPER_BUILD_TYPE)
if (UPPER_BUILD_TYPE MATCHES DEBUG)
set(SOPOSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}")
else()
set(SOPOSTFIX "")
endif()
if(NOT (WINDOWS OR CYGWIN))
if(SDL_SHARED)
if (APPLE)
set(SOEXT "dylib")
else()
set(SOEXT "so")
endif()
set(SOEXT ${CMAKE_SHARED_LIBRARY_SUFFIX}) # ".so", ".dylib", etc.
get_target_property(SONAME SDL2 OUTPUT_NAME)
if(NOT ANDROID)
install(CODE "
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
\"libSDL2-2.0.${SOEXT}\" \"libSDL2.${SOEXT}\")")
install(FILES ${SDL2_BINARY_DIR}/libSDL2.${SOEXT} DESTINATION "lib${LIB_SUFFIX}")
\"lib${SONAME}${SOPOSTFIX}${SOEXT}\" \"libSDL2${SOPOSTFIX}${SOEXT}\"
WORKING_DIRECTORY \"${SDL2_BINARY_DIR}\")")
install(FILES ${SDL2_BINARY_DIR}/libSDL2${SOPOSTFIX}${SOEXT} DESTINATION "lib${LIB_SUFFIX}")
endif()
endif()
if(FREEBSD)

View file

@ -1,6 +1,6 @@
Simple DirectMedia Layer
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages

View file

@ -44,7 +44,9 @@ SDLTEST_OBJECTS = @SDLTEST_OBJECTS@
WAYLAND_SCANNER = @WAYLAND_SCANNER@
SRC_DIST = *.txt acinclude Android.mk autogen.sh android-project build-scripts cmake cmake_uninstall.cmake.in configure configure.in debian docs include Makefile.* sdl2-config.cmake.in sdl2-config.in sdl2.m4 sdl2.pc.in SDL2.spec.in SDL2Config.cmake src test VisualC.html VisualC VisualC-WinRT Xcode Xcode-iOS
INSTALL_SDL2_CONFIG = @INSTALL_SDL2_CONFIG@
SRC_DIST = *.txt acinclude Android.mk autogen.sh android-project build-scripts cmake cmake_uninstall.cmake.in configure configure.ac debian docs include Makefile.* sdl2-config.cmake.in sdl2-config-version.cmake.in sdl2-config.in sdl2.m4 sdl2.pc.in SDL2.spec.in SDL2Config.cmake src test VisualC.html VisualC VisualC-WinRT Xcode Xcode-iOS wayland-protocols
GEN_DIST = SDL2.spec
ifneq ($V,1)
@ -82,6 +84,7 @@ HDRS = \
SDL_log.h \
SDL_main.h \
SDL_messagebox.h \
SDL_metal.h \
SDL_mouse.h \
SDL_mutex.h \
SDL_name.h \
@ -101,6 +104,7 @@ HDRS = \
SDL_render.h \
SDL_rwops.h \
SDL_scancode.h \
SDL_sensor.h \
SDL_shape.h \
SDL_stdinc.h \
SDL_surface.h \
@ -124,9 +128,9 @@ LT_RELEASE = @LT_RELEASE@
LT_REVISION = @LT_REVISION@
LT_LDFLAGS = -no-undefined -rpath $(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
all: $(srcdir)/configure Makefile $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET)
all: $(srcdir)/configure Makefile $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET)
$(srcdir)/configure: $(srcdir)/configure.in
$(srcdir)/configure: $(srcdir)/configure.ac
@echo "Warning, configure is out of date, please re-run autogen.sh"
Makefile: $(srcdir)/Makefile.in
@ -134,8 +138,9 @@ Makefile: $(srcdir)/Makefile.in
Makefile.in:;
$(objects):
$(SHELL) $(auxdir)/mkinstalldirs $@
$(objects)/.created:
$(SHELL) $(auxdir)/mkinstalldirs $(objects)
touch $@
update-revision:
$(SHELL) $(auxdir)/updaterev.sh
@ -153,8 +158,11 @@ $(objects)/$(SDLTEST_TARGET): $(SDLTEST_OBJECTS)
install: all install-bin install-hdrs install-lib install-data
install-bin:
ifeq ($(INSTALL_SDL2_CONFIG),TRUE)
$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(bindir)
$(INSTALL) -m 755 sdl2-config $(DESTDIR)$(bindir)/sdl2-config
endif
install-hdrs: update-revision
$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(includedir)/SDL2
for file in $(HDRS) $(SDLTEST_HDRS); do \
@ -177,8 +185,11 @@ install-data:
$(INSTALL) -m 644 $(srcdir)/sdl2.m4 $(DESTDIR)$(datadir)/aclocal/sdl2.m4
$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/pkgconfig
$(INSTALL) -m 644 sdl2.pc $(DESTDIR)$(libdir)/pkgconfig
ifeq ($(INSTALL_SDL2_CONFIG),TRUE)
$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/cmake/SDL2
$(INSTALL) -m 644 sdl2-config.cmake $(DESTDIR)$(libdir)/cmake/SDL2
$(INSTALL) -m 644 sdl2-config-version.cmake $(DESTDIR)$(libdir)/cmake/SDL2
endif
uninstall: uninstall-bin uninstall-hdrs uninstall-lib uninstall-data
uninstall-bin:
@ -198,6 +209,7 @@ uninstall-data:
rm -f $(DESTDIR)$(datadir)/aclocal/sdl2.m4
rm -f $(DESTDIR)$(libdir)/pkgconfig/sdl2.pc
rm -f $(DESTDIR)$(libdir)/cmake/SDL2/sdl2-config.cmake
rm -f $(DESTDIR)$(libdir)/cmake/SDL2/sdl2-config-version.cmake
clean:
rm -rf $(objects)

View file

@ -22,6 +22,8 @@ SOURCES = \
src/filesystem/dummy/*.c \
src/render/*.c \
src/render/software/*.c \
src/sensor/*.c \
src/sensor/dummy/*.c \
src/stdlib/*.c \
src/thread/*.c \
src/thread/generic/*.c \

140
Makefile.os2 Normal file
View file

@ -0,0 +1,140 @@
# Open Watcom makefile to build SDL2.dll for OS/2
# wmake -f Makefile.os2
LIBNAME = SDL2
VERSION = 2.0.12
DESCRIPTION = Simple DirectMedia Layer 2
LIBHOME = .
LIBPATH = $(LIBHOME)/lib
DLLFILE = $(LIBHOME)/$(LIBNAME).dll
LIBFILE = $(LIBHOME)/$(LIBNAME).lib
LNKFILE = $(LIBNAME).lnk
INCPATH = -I"$(%WATCOM)/h/os2" -I"$(%WATCOM)/h"
INCPATH+= -I"$(LIBHOME)/h"
INCPATH+= -Iinclude
LIBM = libm.lib
LIBS = mmpm2.lib libuls.lib libconv.lib $(LIBM)
CFLAGS = -bt=os2 -d0 -q -bm -5s -fp5 -fpi87 -sg -oteanbmier -ei
# max warnings:
CFLAGS+= -wx
# building dll:
CFLAGS+= -bd
# the include paths :
CFLAGS+= $(INCPATH)
# building SDL itself (for DECLSPEC):
CFLAGS+= -DBUILD_SDL
MSRCS= e_atan2.c e_exp.c e_fmod.c e_log10.c e_log.c e_pow.c e_rem_pio2.c e_sqrt.c &
k_cos.c k_rem_pio2.c k_sin.c k_tan.c &
s_atan.c s_copysign.c s_cos.c s_fabs.c s_floor.c s_scalbn.c s_sin.c s_tan.c
SRCS = SDL.c SDL_assert.c SDL_error.c SDL_log.c SDL_dataqueue.c SDL_hints.c
SRCS+= SDL_getenv.c SDL_iconv.c SDL_malloc.c SDL_qsort.c SDL_stdlib.c SDL_string.c SDL_strtokr.c
SRCS+= SDL_cpuinfo.c SDL_atomic.c SDL_spinlock.c SDL_thread.c SDL_timer.c
SRCS+= SDL_rwops.c SDL_power.c
SRCS+= SDL_audio.c SDL_audiocvt.c SDL_audiodev.c SDL_audiotypecvt.c SDL_mixer.c SDL_wave.c
SRCS+= SDL_events.c SDL_quit.c SDL_keyboard.c SDL_mouse.c SDL_windowevents.c &
SDL_clipboardevents.c SDL_dropevents.c SDL_displayevents.c SDL_gesture.c &
SDL_sensor.c SDL_touch.c
SRCS+= SDL_haptic.c SDL_gamecontroller.c SDL_joystick.c
SRCS+= SDL_render.c yuv_rgb.c SDL_yuv.c SDL_yuv_sw.c SDL_blendfillrect.c &
SDL_blendline.c SDL_blendpoint.c SDL_drawline.c SDL_drawpoint.c &
SDL_render_sw.c SDL_rotate.c
SRCS+= SDL_blit.c SDL_blit_0.c SDL_blit_1.c SDL_blit_A.c SDL_blit_auto.c &
SDL_blit_copy.c SDL_blit_N.c SDL_blit_slow.c SDL_fillrect.c SDL_bmp.c &
SDL_pixels.c SDL_rect.c SDL_RLEaccel.c SDL_shape.c SDL_stretch.c &
SDL_surface.c SDL_video.c SDL_clipboard.c SDL_vulkan_utils.c SDL_egl.c
SRCS+= SDL_syscond.c SDL_sysmutex.c SDL_syssem.c SDL_systhread.c SDL_systls.c
SRCS+= SDL_systimer.c
SRCS+= SDL_sysloadso.c
SRCS+= SDL_sysfilesystem.c
SRCS+= SDL_syshaptic.c SDL_sysjoystick.c
SRCS+= SDL_dummyaudio.c SDL_diskaudio.c
SRCS+= SDL_nullvideo.c SDL_nullframebuffer.c SDL_nullevents.c
SRCS+= SDL_dummysensor.c
SRCS+= SDL_dynapi.c
OBJS = $(SRCS:.c=.obj)
MOBJS= $(MSRCS:.c=.obj)
.extensions:
.extensions: .lib .dll .obj .c .asm
.c: ./src;./src/dynapi;./src/audio;./src/cpuinfo;./src/events;./src/file;./src/haptic;./src/joystick;./src/power;./src/render;./src/render/software;./src/sensor;./src/stdlib;./src/thread;./src/timer;./src/video;./src/video/yuv2rgb;./src/atomic;./src/audio/disk;
.c: ./src/haptic/dummy;./src/joystick/dummy;./src/audio/dummy;./src/video/dummy;./src/sensor/dummy;
.c: ./src/loadso/dummy;./src/filesystem/dummy;./src/timer/dummy;./src/thread/generic;
all: $(DLLFILE) $(LIBFILE) .symbolic
$(DLLFILE): $(OBJS) $(LIBM) $(LNKFILE)
@echo * Linking: $@
wlink @$(LNKFILE)
$(LIBFILE): $(DLLFILE)
@echo * Creating LIB file: $@
wlib -q -b -n -c -pa -s -t -zld -ii -io $* $(DLLFILE)
.c.obj:
wcc386 $(CFLAGS) -fo=$^@ $<
SDL_cpuinfo.obj: SDL_cpuinfo.c
wcc386 $(CFLAGS) -wcd=200 -fo=$^@ $<
SDL_rwops.obj: SDL_rwops.c
wcc386 $(CFLAGS) -wcd=136 -fo=$^@ $<
SDL_wave.obj: SDL_wave.c
wcc386 $(CFLAGS) -wcd=124 -fo=$^@ $<
SDL_blendfillrect.obj: SDL_blendfillrect.c
wcc386 $(CFLAGS) -wcd=200 -fo=$^@ $<
SDL_blendline.obj: SDL_blendline.c
wcc386 $(CFLAGS) -wcd=200 -fo=$^@ $<
SDL_blendpoint.obj: SDL_blendpoint.c
wcc386 $(CFLAGS) -wcd=200 -fo=$^@ $<
SDL_RLEaccel.obj: SDL_RLEaccel.c
wcc386 $(CFLAGS) -wcd=201 -fo=$^@ $<
.c: ./src/libm;
$(LIBM): $(MOBJS)
wlib -q -b -n -c -pa -s -t -zld -ii -io $@ $(MOBJS)
$(LNKFILE):
@echo * Creating linker file: $@
@%create $@
@%append $@ SYSTEM os2v2_dll INITINSTANCE TERMINSTANCE
@%append $@ NAME $(DLLFILE)
@for %i in ($(OBJS)) do @%append $@ FILE %i
@%append $@ LIBPATH $(%LIB);$(LIBPATH)
@for %i in ($(LIBS)) do @%append $@ LIB %i
@%append $@ OPTION QUIET
@%append $@ OPTION IMPF=$(LIBHOME)/$^&.exp
@%append $@ OPTION MAP=$(LIBHOME)/$^&.map
@%append $@ OPTION DESCRIPTION '@$#libsdl org:$(VERSION)$#@$(DESCRIPTION)'
@%append $@ OPTION QUIET
@%append $@ OPTION ELIMINATE
@%append $@ OPTION MANYAUTODATA
@%append $@ OPTION OSNAME='OS/2 and eComStation'
@%append $@ OPTION SHOWDEAD
clean: .SYMBOLIC
@ echo * Clean: $(LIBNAME)
@if exist *.obj rm *.obj
@if exist *.err rm *.err
@if exist $(LNKFILE) rm $(LNKFILE)
@if exist $(LIBM) rm $(LIBM)
distclean: .SYMBOLIC clean
@if exist $(LIBHOME)/*.exp rm $(LIBHOME)/*.exp
@if exist $(LIBHOME)/*.map rm $(LIBHOME)/*.map
@if exist $(LIBFILE) rm $(LIBFILE)
@if exist $(DLLFILE) rm $(DLLFILE)

View file

@ -12,15 +12,38 @@ CFLAGS = -O3 -march=armv7-a -mcpu=cortex-a8 -mtune=cortex-a8 -mfloat-abi=softfp
TARGET = libSDL.a
SOURCES = ./src/*.c ./src/audio/*.c ./src/cpuinfo/*.c ./src/events/*.c \
./src/file/*.c ./src/stdlib/*.c ./src/thread/*.c ./src/timer/*.c ./src/video/*.c \
./src/joystick/*.c ./src/haptic/*.c ./src/power/*.c ./src/video/dummy/*.c ./src/audio/disk/*.c \
./src/audio/dummy/*.c ./src/loadso/dlopen/*.c ./src/audio/dsp/*.c \
./src/thread/pthread/SDL_systhread.c ./src/thread/pthread/SDL_syssem.c \
./src/thread/pthread/SDL_sysmutex.c ./src/thread/pthread/SDL_syscond.c \
./src/joystick/linux/*.c ./src/haptic/linux/*.c ./src/timer/unix/*.c \
./src/atomic/*.c ./src/filesystem/unix/*.c \
./src/video/pandora/SDL_pandora.o ./src/video/pandora/SDL_pandora_events.o ./src/video/x11/*.c
SOURCES =
./src/*.c \
./src/atomic/*.c \
./src/audio/*.c \
./src/audio/disk/*.c \
./src/audio/dsp/*.c \
./src/audio/dummy/*.c \
./src/cpuinfo/*.c \
./src/events/*.c \
./src/file/*.c \
./src/filesystem/unix/*.c \
./src/haptic/*.c \
./src/haptic/linux/*.c \
./src/joystick/*.c \
./src/joystick/linux/*.c \
./src/loadso/dlopen/*.c \
./src/power/*.c \
./src/sensor/*.c \
./src/sensor/dummy/*.c \
./src/stdlib/*.c \
./src/thread/*.c \
./src/thread/pthread/SDL_syscond.c \
./src/thread/pthread/SDL_sysmutex.c \
./src/thread/pthread/SDL_syssem.c \
./src/thread/pthread/SDL_systhread.c \
./src/timer/*.c \
./src/timer/unix/*.c \
./src/video/*.c \
./src/video/dummy/*.c \
./src/video/pandora/SDL_pandora.o \
./src/video/pandora/SDL_pandora_events.o \
./src/video/x11/*.c \
OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g')

View file

@ -42,12 +42,15 @@ OBJS= src/SDL.o \
src/render/software/SDL_drawpoint.o \
src/render/software/SDL_render_sw.o \
src/render/software/SDL_rotate.o \
src/sensor/SDL_sensor.o \
src/sensor/dummy/SDL_dummysensor.o \
src/stdlib/SDL_getenv.o \
src/stdlib/SDL_iconv.o \
src/stdlib/SDL_malloc.o \
src/stdlib/SDL_qsort.o \
src/stdlib/SDL_stdlib.o \
src/stdlib/SDL_string.o \
src/stdlib/SDL_strtokr.o \
src/thread/SDL_thread.o \
src/thread/generic/SDL_systls.o \
src/thread/psp/SDL_syssem.o \
@ -76,7 +79,7 @@ OBJS= src/SDL.o \
src/video/psp/SDL_pspevents.o \
src/video/psp/SDL_pspvideo.o \
src/video/psp/SDL_pspgl.o \
src/video/psp/SDL_pspmouse.o \
src/video/psp/SDL_pspmouse.o
INCDIR = ./include
CFLAGS = -g -O2 -G0 -Wall -D__PSP__ -DHAVE_OPENGL

View file

@ -12,14 +12,33 @@ CFLAGS = -Wall -fPIC -I./include -I$(WIZSDK)/include -DWIZ_GLES_LITE
TARGET_STATIC = libSDL2.a
TARGET_SHARED = libSDL2.so
SOURCES = ./src/*.c ./src/audio/*.c ./src/cpuinfo/*.c ./src/events/*.c \
./src/file/*.c ./src/stdlib/*.c ./src/thread/*.c ./src/timer/*.c ./src/video/*.c \
./src/joystick/*.c ./src/haptic/*.c ./src/video/dummy/*.c ./src/audio/disk/*.c \
./src/audio/dummy/*.c ./src/loadso/dlopen/*.c ./src/audio/dsp/*.c \
./src/thread/pthread/SDL_systhread.c ./src/thread/pthread/SDL_syssem.c \
./src/thread/pthread/SDL_sysmutex.c ./src/thread/pthread/SDL_syscond.c \
./src/joystick/linux/*.c ./src/haptic/linux/*.c ./src/timer/unix/*.c \
./src/video/pandora/SDL_pandora.o ./src/video/pandora/SDL_pandora_events.o
SOURCES = \
./src/*.c \
./src/audio/*.c \
./src/audio/disk/*.c \
./src/audio/dsp/*.c \
./src/audio/dummy/*.c \
./src/cpuinfo/*.c \
./src/events/*.c \
./src/file/*.c \
./src/haptic/*.c \
./src/haptic/linux/*.c \
./src/joystick/*.c \
./src/joystick/linux/*.c \
./src/loadso/dlopen/*.c \
./src/sensor/*.c \
./src/sensor/dummy/*.c \
./src/stdlib/*.c \
./src/thread/*.c \
./src/thread/pthread/SDL_syscond.c \
./src/thread/pthread/SDL_sysmutex.c \
./src/thread/pthread/SDL_syssem.c \
./src/thread/pthread/SDL_systhread.c \
./src/timer/*.c \
./src/timer/unix/*.c \
./src/video/*.c \
./src/video/dummy/*.c \
./src/video/pandora/*.c \
OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g')

View file

@ -74,7 +74,8 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/lib*.la
%{_libdir}/lib*.%{__soext}
%{_includedir}/*/*.h
%{_libdir}/pkgconfig/*
%{_libdir}/cmake/*
%{_libdir}/pkgconfig/SDL2/*
%{_datadir}/aclocal/*
%changelog

View file

@ -67,6 +67,7 @@
<ClInclude Include="..\..\include\SDL_revision.h" />
<ClInclude Include="..\..\include\SDL_rwops.h" />
<ClInclude Include="..\..\include\SDL_scancode.h" />
<ClInclude Include="..\..\include\SDL_sensor.h" />
<ClInclude Include="..\..\include\SDL_shape.h" />
<ClInclude Include="..\..\include\SDL_stdinc.h" />
<ClInclude Include="..\..\include\SDL_surface.h" />
@ -97,6 +98,7 @@
<ClInclude Include="..\..\src\events\blank_cursor.h" />
<ClInclude Include="..\..\src\events\default_cursor.h" />
<ClInclude Include="..\..\src\events\SDL_clipboardevents_c.h" />
<ClInclude Include="..\..\src\events\SDL_displayevents_c.h" />
<ClInclude Include="..\..\src\events\SDL_dropevents_c.h" />
<ClInclude Include="..\..\src\events\SDL_events_c.h" />
<ClInclude Include="..\..\src\events\SDL_keyboard_c.h" />
@ -136,6 +138,9 @@
<ClInclude Include="..\..\src\SDL_fatal.h" />
<ClInclude Include="..\..\src\SDL_hints_c.h" />
<ClInclude Include="..\..\src\SDL_internal.h" />
<ClInclude Include="..\..\src\sensor\dummy\SDL_dummysensor.h" />
<ClInclude Include="..\..\src\sensor\SDL_sensor_c.h" />
<ClInclude Include="..\..\src\sensor\SDL_syssensor.h" />
<ClInclude Include="..\..\src\thread\SDL_systhread.h" />
<ClInclude Include="..\..\src\thread\SDL_thread_c.h" />
<ClInclude Include="..\..\src\thread\stdcpp\SDL_sysmutex_c.h" />
@ -212,6 +217,7 @@
<ClCompile Include="..\..\src\cpuinfo\SDL_cpuinfo.c" />
<ClCompile Include="..\..\src\dynapi\SDL_dynapi.c" />
<ClCompile Include="..\..\src\events\SDL_clipboardevents.c" />
<ClCompile Include="..\..\src\events\SDL_displayevents.c" />
<ClCompile Include="..\..\src\events\SDL_dropevents.c" />
<ClCompile Include="..\..\src\events\SDL_events.c" />
<ClCompile Include="..\..\src\events\SDL_gesture.c" />
@ -271,12 +277,15 @@
<ClCompile Include="..\..\src\SDL_error.c" />
<ClCompile Include="..\..\src\SDL_hints.c" />
<ClCompile Include="..\..\src\SDL_log.c" />
<ClCompile Include="..\..\src\sensor\dummy\SDL_dummysensor.c" />
<ClCompile Include="..\..\src\sensor\SDL_sensor.c" />
<ClCompile Include="..\..\src\stdlib\SDL_getenv.c" />
<ClCompile Include="..\..\src\stdlib\SDL_iconv.c" />
<ClCompile Include="..\..\src\stdlib\SDL_malloc.c" />
<ClCompile Include="..\..\src\stdlib\SDL_qsort.c" />
<ClCompile Include="..\..\src\stdlib\SDL_stdlib.c" />
<ClCompile Include="..\..\src\stdlib\SDL_string.c" />
<ClCompile Include="..\..\src\stdlib\SDL_strtokr.c" />
<ClCompile Include="..\..\src\thread\generic\SDL_syssem.c" />
<ClCompile Include="..\..\src\thread\SDL_thread.c" />
<ClCompile Include="..\..\src\thread\stdcpp\SDL_syscond.cpp" />

View file

@ -414,6 +414,21 @@
<ClInclude Include="..\..\src\render\direct3d11\SDL_shaders_d3d11.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_sensor.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\sensor\SDL_sensor_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\sensor\SDL_syssensor.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\sensor\dummy\SDL_dummysensor.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\events\SDL_displayevents_c.h">
<Filter>Source Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\atomic\SDL_atomic.c">
@ -611,6 +626,9 @@
<ClCompile Include="..\..\src\stdlib\SDL_string.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stdlib\SDL_strtokr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\thread\generic\SDL_syssem.c">
<Filter>Source Files</Filter>
</ClCompile>
@ -746,5 +764,14 @@
<ClCompile Include="..\..\src\render\direct3d11\SDL_shaders_d3d11.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\sensor\SDL_sensor.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\sensor\dummy\SDL_dummysensor.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\events\SDL_displayevents.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View file

@ -59,6 +59,7 @@
<ClInclude Include="..\..\include\SDL_revision.h" />
<ClInclude Include="..\..\include\SDL_rwops.h" />
<ClInclude Include="..\..\include\SDL_scancode.h" />
<ClInclude Include="..\..\include\SDL_sensor.h" />
<ClInclude Include="..\..\include\SDL_shape.h" />
<ClInclude Include="..\..\include\SDL_stdinc.h" />
<ClInclude Include="..\..\include\SDL_surface.h" />
@ -87,6 +88,7 @@
<ClInclude Include="..\..\src\events\blank_cursor.h" />
<ClInclude Include="..\..\src\events\default_cursor.h" />
<ClInclude Include="..\..\src\events\SDL_clipboardevents_c.h" />
<ClInclude Include="..\..\src\events\SDL_displayevents_c.h" />
<ClInclude Include="..\..\src\events\SDL_dropevents_c.h" />
<ClInclude Include="..\..\src\events\SDL_events_c.h" />
<ClInclude Include="..\..\src\events\SDL_keyboard_c.h" />
@ -121,6 +123,9 @@
<ClInclude Include="..\..\src\SDL_fatal.h" />
<ClInclude Include="..\..\src\SDL_hints_c.h" />
<ClInclude Include="..\..\src\SDL_internal.h" />
<ClInclude Include="..\..\src\sensor\dummy\SDL_dummysensor.h" />
<ClInclude Include="..\..\src\sensor\SDL_sensor_c.h" />
<ClInclude Include="..\..\src\sensor\SDL_syssensor.h" />
<ClInclude Include="..\..\src\thread\SDL_systhread.h" />
<ClInclude Include="..\..\src\thread\SDL_thread_c.h" />
<ClInclude Include="..\..\src\thread\windows\SDL_systhread_c.h" />
@ -187,6 +192,7 @@
<ClCompile Include="..\..\src\cpuinfo\SDL_cpuinfo.c" />
<ClCompile Include="..\..\src\dynapi\SDL_dynapi.c" />
<ClCompile Include="..\..\src\events\SDL_clipboardevents.c" />
<ClCompile Include="..\..\src\events\SDL_displayevents.c" />
<ClCompile Include="..\..\src\events\SDL_dropevents.c" />
<ClCompile Include="..\..\src\events\SDL_events.c" />
<ClCompile Include="..\..\src\events\SDL_gesture.c" />
@ -237,12 +243,15 @@
<ClCompile Include="..\..\src\SDL_error.c" />
<ClCompile Include="..\..\src\SDL_hints.c" />
<ClCompile Include="..\..\src\SDL_log.c" />
<ClCompile Include="..\..\src\sensor\dummy\SDL_dummysensor.c" />
<ClCompile Include="..\..\src\sensor\SDL_sensor.c" />
<ClCompile Include="..\..\src\stdlib\SDL_getenv.c" />
<ClCompile Include="..\..\src\stdlib\SDL_iconv.c" />
<ClCompile Include="..\..\src\stdlib\SDL_malloc.c" />
<ClCompile Include="..\..\src\stdlib\SDL_qsort.c" />
<ClCompile Include="..\..\src\stdlib\SDL_stdlib.c" />
<ClCompile Include="..\..\src\stdlib\SDL_string.c" />
<ClCompile Include="..\..\src\stdlib\SDL_strtokr.c" />
<ClCompile Include="..\..\src\thread\generic\SDL_syscond.c" />
<ClCompile Include="..\..\src\thread\SDL_thread.c" />
<ClCompile Include="..\..\src\thread\windows\SDL_sysmutex.c" />

View file

@ -387,7 +387,24 @@
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\render\direct3d11\SDL_shaders_d3d11.h" />
<ClInclude Include="..\..\src\render\direct3d11\SDL_shaders_d3d11.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\sensor\SDL_sensor_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\sensor\SDL_syssensor.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\sensor\dummy\SDL_dummysensor.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_sensor.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\events\SDL_displayevents_c.h">
<Filter>Source Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\atomic\SDL_atomic.c">
@ -576,6 +593,9 @@
<ClCompile Include="..\..\src\stdlib\SDL_string.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stdlib\SDL_strtokr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\thread\SDL_thread.c">
<Filter>Source Files</Filter>
</ClCompile>
@ -702,6 +722,17 @@
<ClCompile Include="..\..\src\video\yuv2rgb\yuv_rgb.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\render\direct3d11\SDL_shaders_d3d11.c" />
<ClCompile Include="..\..\src\render\direct3d11\SDL_shaders_d3d11.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\sensor\SDL_sensor.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\sensor\dummy\SDL_dummysensor.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\events\SDL_displayevents.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View file

@ -67,6 +67,7 @@
<ClInclude Include="..\..\include\SDL_revision.h" />
<ClInclude Include="..\..\include\SDL_rwops.h" />
<ClInclude Include="..\..\include\SDL_scancode.h" />
<ClInclude Include="..\..\include\SDL_sensor.h" />
<ClInclude Include="..\..\include\SDL_shape.h" />
<ClInclude Include="..\..\include\SDL_stdinc.h" />
<ClInclude Include="..\..\include\SDL_surface.h" />
@ -97,6 +98,7 @@
<ClInclude Include="..\..\src\events\blank_cursor.h" />
<ClInclude Include="..\..\src\events\default_cursor.h" />
<ClInclude Include="..\..\src\events\SDL_clipboardevents_c.h" />
<ClInclude Include="..\..\src\events\SDL_displayevents_c.h" />
<ClInclude Include="..\..\src\events\SDL_dropevents_c.h" />
<ClInclude Include="..\..\src\events\SDL_events_c.h" />
<ClInclude Include="..\..\src\events\SDL_keyboard_c.h" />
@ -136,6 +138,9 @@
<ClInclude Include="..\..\src\SDL_fatal.h" />
<ClInclude Include="..\..\src\SDL_hints_c.h" />
<ClInclude Include="..\..\src\SDL_internal.h" />
<ClInclude Include="..\..\src\sensor\dummy\SDL_dummysensor.h" />
<ClInclude Include="..\..\src\sensor\SDL_sensor_c.h" />
<ClInclude Include="..\..\src\sensor\SDL_syssensor.h" />
<ClInclude Include="..\..\src\thread\SDL_thread_c.h" />
<ClInclude Include="..\..\src\thread\windows\SDL_systhread_c.h" />
<ClInclude Include="..\..\src\timer\SDL_timer_c.h" />
@ -210,6 +215,7 @@
<ClCompile Include="..\..\src\cpuinfo\SDL_cpuinfo.c" />
<ClCompile Include="..\..\src\dynapi\SDL_dynapi.c" />
<ClCompile Include="..\..\src\events\SDL_clipboardevents.c" />
<ClCompile Include="..\..\src\events\SDL_displayevents.c" />
<ClCompile Include="..\..\src\events\SDL_dropevents.c" />
<ClCompile Include="..\..\src\events\SDL_events.c" />
<ClCompile Include="..\..\src\events\SDL_gesture.c" />
@ -269,12 +275,15 @@
<ClCompile Include="..\..\src\SDL_error.c" />
<ClCompile Include="..\..\src\SDL_hints.c" />
<ClCompile Include="..\..\src\SDL_log.c" />
<ClCompile Include="..\..\src\sensor\dummy\SDL_dummysensor.c" />
<ClCompile Include="..\..\src\sensor\SDL_sensor.c" />
<ClCompile Include="..\..\src\stdlib\SDL_getenv.c" />
<ClCompile Include="..\..\src\stdlib\SDL_iconv.c" />
<ClCompile Include="..\..\src\stdlib\SDL_malloc.c" />
<ClCompile Include="..\..\src\stdlib\SDL_qsort.c" />
<ClCompile Include="..\..\src\stdlib\SDL_stdlib.c" />
<ClCompile Include="..\..\src\stdlib\SDL_string.c" />
<ClCompile Include="..\..\src\stdlib\SDL_strtokr.c" />
<ClCompile Include="..\..\src\thread\generic\SDL_syscond.c" />
<ClCompile Include="..\..\src\thread\SDL_thread.c" />
<ClCompile Include="..\..\src\thread\windows\SDL_sysmutex.c" />

View file

@ -408,6 +408,21 @@
<ClInclude Include="..\..\src\render\direct3d11\SDL_shaders_d3d11.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_sensor.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\sensor\SDL_sensor_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\sensor\SDL_syssensor.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\sensor\dummy\SDL_dummysensor.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\events\SDL_displayevents_c.h">
<Filter>Source Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\atomic\SDL_atomic.c">
@ -596,6 +611,9 @@
<ClCompile Include="..\..\src\stdlib\SDL_string.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stdlib\SDL_strtokr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\thread\SDL_thread.c">
<Filter>Source Files</Filter>
</ClCompile>
@ -743,5 +761,14 @@
<ClCompile Include="..\..\src\render\direct3d11\SDL_shaders_d3d11.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\sensor\SDL_sensor.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\sensor\dummy\SDL_dummysensor.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\events\SDL_displayevents.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View file

@ -109,7 +109,7 @@
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>setupapi.lib;winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
@ -130,7 +130,6 @@
<PreprocessorDefinitions>_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<OmitDefaultLibName>true</OmitDefaultLibName>
@ -140,7 +139,7 @@
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>setupapi.lib;winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
@ -174,7 +173,7 @@
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>setupapi.lib;winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
@ -196,7 +195,6 @@
<PreprocessorDefinitions>NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<OmitDefaultLibName>true</OmitDefaultLibName>
@ -206,7 +204,7 @@
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>setupapi.lib;winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
@ -264,6 +262,7 @@
<ClInclude Include="..\..\include\SDL_revision.h" />
<ClInclude Include="..\..\include\SDL_rwops.h" />
<ClInclude Include="..\..\include\SDL_scancode.h" />
<ClInclude Include="..\..\include\SDL_sensor.h" />
<ClInclude Include="..\..\include\SDL_shape.h" />
<ClInclude Include="..\..\include\SDL_stdinc.h" />
<ClInclude Include="..\..\include\SDL_surface.h" />
@ -306,6 +305,7 @@
<ClInclude Include="..\..\src\events\blank_cursor.h" />
<ClInclude Include="..\..\src\events\default_cursor.h" />
<ClInclude Include="..\..\src\events\SDL_clipboardevents_c.h" />
<ClInclude Include="..\..\src\events\SDL_displayevents_c.h" />
<ClInclude Include="..\..\src\events\SDL_dropevents_c.h" />
<ClInclude Include="..\..\src\events\SDL_events_c.h" />
<ClInclude Include="..\..\src\events\SDL_gesture_c.h" />
@ -318,6 +318,8 @@
<ClInclude Include="..\..\src\haptic\windows\SDL_dinputhaptic_c.h" />
<ClInclude Include="..\..\src\haptic\windows\SDL_windowshaptic_c.h" />
<ClInclude Include="..\..\src\haptic\windows\SDL_xinputhaptic_c.h" />
<ClInclude Include="..\..\src\joystick\controller_type.h" />
<ClInclude Include="..\..\src\joystick\hidapi\SDL_hidapijoystick_c.h" />
<ClInclude Include="..\..\src\joystick\SDL_joystick_c.h" />
<ClInclude Include="..\..\src\joystick\SDL_sysjoystick.h" />
<ClInclude Include="..\..\src\joystick\windows\SDL_dinputjoystick_c.h" />
@ -343,6 +345,9 @@
<ClInclude Include="..\..\src\render\software\SDL_rotate.h" />
<ClInclude Include="..\..\src\SDL_dataqueue.h" />
<ClInclude Include="..\..\src\SDL_error_c.h" />
<ClInclude Include="..\..\src\sensor\dummy\SDL_dummysensor.h" />
<ClInclude Include="..\..\src\sensor\SDL_sensor_c.h" />
<ClInclude Include="..\..\src\sensor\SDL_syssensor.h" />
<ClInclude Include="..\..\src\thread\SDL_systhread.h" />
<ClInclude Include="..\..\src\thread\SDL_thread_c.h" />
<ClInclude Include="..\..\src\thread\windows\SDL_systhread_c.h" />
@ -397,6 +402,7 @@
<ClCompile Include="..\..\src\cpuinfo\SDL_cpuinfo.c" />
<ClCompile Include="..\..\src\dynapi\SDL_dynapi.c" />
<ClCompile Include="..\..\src\events\SDL_clipboardevents.c" />
<ClCompile Include="..\..\src\events\SDL_displayevents.c" />
<ClCompile Include="..\..\src\events\SDL_dropevents.c" />
<ClCompile Include="..\..\src\events\SDL_events.c" />
<ClCompile Include="..\..\src\events\SDL_gesture.c" />
@ -411,6 +417,15 @@
<ClCompile Include="..\..\src\haptic\windows\SDL_dinputhaptic.c" />
<ClCompile Include="..\..\src\haptic\windows\SDL_windowshaptic.c" />
<ClCompile Include="..\..\src\haptic\windows\SDL_xinputhaptic.c" />
<ClCompile Include="..\..\src\hidapi\windows\hid.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapijoystick.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_gamecube.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_ps4.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_rumble.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_switch.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xbox360.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xbox360w.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xboxone.c" />
<ClCompile Include="..\..\src\joystick\SDL_gamecontroller.c" />
<ClCompile Include="..\..\src\joystick\SDL_joystick.c" />
<ClCompile Include="..\..\src\joystick\windows\SDL_dinputjoystick.c" />
@ -418,6 +433,7 @@
<ClCompile Include="..\..\src\joystick\windows\SDL_windowsjoystick.c" />
<ClCompile Include="..\..\src\joystick\windows\SDL_xinputjoystick.c" />
<ClCompile Include="..\..\src\libm\e_atan2.c" />
<ClCompile Include="..\..\src\libm\e_exp.c" />
<ClCompile Include="..\..\src\libm\e_fmod.c" />
<ClCompile Include="..\..\src\libm\e_log.c" />
<ClCompile Include="..\..\src\libm\e_log10.c" />
@ -463,12 +479,15 @@
<ClCompile Include="..\..\src\SDL_error.c" />
<ClCompile Include="..\..\src\SDL_hints.c" />
<ClCompile Include="..\..\src\SDL_log.c" />
<ClCompile Include="..\..\src\sensor\dummy\SDL_dummysensor.c" />
<ClCompile Include="..\..\src\sensor\SDL_sensor.c" />
<ClCompile Include="..\..\src\stdlib\SDL_getenv.c" />
<ClCompile Include="..\..\src\stdlib\SDL_iconv.c" />
<ClCompile Include="..\..\src\stdlib\SDL_malloc.c" />
<ClCompile Include="..\..\src\stdlib\SDL_qsort.c" />
<ClCompile Include="..\..\src\stdlib\SDL_stdlib.c" />
<ClCompile Include="..\..\src\stdlib\SDL_string.c" />
<ClCompile Include="..\..\src\stdlib\SDL_strtokr.c" />
<ClCompile Include="..\..\src\thread\generic\SDL_syscond.c" />
<ClCompile Include="..\..\src\thread\SDL_thread.c" />
<ClCompile Include="..\..\src\thread\windows\SDL_sysmutex.c" />

View file

@ -1,460 +1,483 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="API Headers">
<UniqueIdentifier>{395b3af0-33d0-411b-b153-de1676bf1ef8}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\include\begin_code.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\close_code.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_assert.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_atomic.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_audio.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_bits.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_blendmode.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_clipboard.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_config.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_config_windows.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_copying.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_cpuinfo.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_egl.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_endian.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_error.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_events.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_filesystem.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_gamecontroller.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_gesture.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_haptic.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_hints.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_joystick.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_keyboard.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_keycode.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_loadso.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_log.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_main.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_messagebox.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_mouse.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_mutex.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_name.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_opengl.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_opengl_glext.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_opengles.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_opengles2.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_opengles2_gl2.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_opengles2_gl2ext.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_opengles2_gl2platform.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_opengles2_khrplatform.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_pixels.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_platform.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_power.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_quit.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_rect.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_render.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_revision.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_rwops.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_scancode.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_shape.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_stdinc.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_surface.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_system.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_syswm.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_test.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_test_assert.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_test_common.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_test_compare.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_test_crc32.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_test_font.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_test_fuzzer.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_test_harness.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_test_images.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_test_log.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_test_md5.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_test_random.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_thread.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_timer.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_touch.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_types.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_version.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_video.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_vulkan.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\src\audio\directsound\SDL_directsound.h" />
<ClInclude Include="..\..\src\audio\disk\SDL_diskaudio.h" />
<ClInclude Include="..\..\src\audio\dummy\SDL_dummyaudio.h" />
<ClInclude Include="..\..\src\audio\SDL_audio_c.h" />
<ClInclude Include="..\..\src\audio\SDL_audiodev_c.h" />
<ClInclude Include="..\..\src\audio\SDL_sysaudio.h" />
<ClInclude Include="..\..\src\audio\SDL_wave.h" />
<ClInclude Include="..\..\src\audio\wasapi\SDL_wasapi.h" />
<ClInclude Include="..\..\src\audio\winmm\SDL_winmm.h" />
<ClInclude Include="..\..\src\core\windows\SDL_directx.h" />
<ClInclude Include="..\..\src\core\windows\SDL_windows.h" />
<ClInclude Include="..\..\src\core\windows\SDL_xinput.h" />
<ClInclude Include="..\..\src\dynapi\SDL_dynapi.h" />
<ClInclude Include="..\..\src\dynapi\SDL_dynapi_overrides.h" />
<ClInclude Include="..\..\src\dynapi\SDL_dynapi_procs.h" />
<ClInclude Include="..\..\src\events\blank_cursor.h" />
<ClInclude Include="..\..\src\events\default_cursor.h" />
<ClInclude Include="..\..\src\events\SDL_clipboardevents_c.h" />
<ClInclude Include="..\..\src\events\SDL_dropevents_c.h" />
<ClInclude Include="..\..\src\events\SDL_events_c.h" />
<ClInclude Include="..\..\src\events\SDL_gesture_c.h" />
<ClInclude Include="..\..\src\events\SDL_keyboard_c.h" />
<ClInclude Include="..\..\src\events\SDL_mouse_c.h" />
<ClInclude Include="..\..\src\events\SDL_sysevents.h" />
<ClInclude Include="..\..\src\events\SDL_touch_c.h" />
<ClInclude Include="..\..\src\events\SDL_windowevents_c.h" />
<ClInclude Include="..\..\src\haptic\SDL_syshaptic.h" />
<ClInclude Include="..\..\src\haptic\windows\SDL_dinputhaptic_c.h" />
<ClInclude Include="..\..\src\haptic\windows\SDL_windowshaptic_c.h" />
<ClInclude Include="..\..\src\haptic\windows\SDL_xinputhaptic_c.h" />
<ClInclude Include="..\..\src\joystick\SDL_joystick_c.h" />
<ClInclude Include="..\..\src\joystick\SDL_sysjoystick.h" />
<ClInclude Include="..\..\src\joystick\windows\SDL_dinputjoystick_c.h" />
<ClInclude Include="..\..\src\joystick\windows\SDL_windowsjoystick_c.h" />
<ClInclude Include="..\..\src\joystick\windows\SDL_xinputjoystick_c.h" />
<ClInclude Include="..\..\src\libm\math_libm.h" />
<ClInclude Include="..\..\src\libm\math_private.h" />
<ClInclude Include="..\..\src\render\opengl\SDL_glfuncs.h" />
<ClInclude Include="..\..\src\render\opengl\SDL_shaders_gl.h" />
<ClInclude Include="..\..\src\render\opengles\SDL_glesfuncs.h" />
<ClInclude Include="..\..\src\render\SDL_d3dmath.h" />
<ClInclude Include="..\..\src\render\SDL_sysrender.h" />
<ClInclude Include="..\..\src\render\SDL_yuv_sw_c.h" />
<ClInclude Include="..\..\src\render\software\SDL_blendfillrect.h" />
<ClInclude Include="..\..\src\render\software\SDL_blendline.h" />
<ClInclude Include="..\..\src\render\software\SDL_blendpoint.h" />
<ClInclude Include="..\..\src\render\software\SDL_draw.h" />
<ClInclude Include="..\..\src\render\software\SDL_drawline.h" />
<ClInclude Include="..\..\src\render\software\SDL_drawpoint.h" />
<ClInclude Include="..\..\src\render\software\SDL_render_sw_c.h" />
<ClInclude Include="..\..\src\render\software\SDL_rotate.h" />
<ClInclude Include="..\..\src\SDL_dataqueue.h" />
<ClInclude Include="..\..\src\SDL_error_c.h" />
<ClInclude Include="..\..\src\thread\SDL_systhread.h" />
<ClInclude Include="..\..\src\thread\SDL_thread_c.h" />
<ClInclude Include="..\..\src\thread\windows\SDL_systhread_c.h" />
<ClInclude Include="..\..\src\timer\SDL_timer_c.h" />
<ClInclude Include="..\..\src\video\dummy\SDL_nullevents_c.h" />
<ClInclude Include="..\..\src\video\dummy\SDL_nullframebuffer_c.h" />
<ClInclude Include="..\..\src\video\dummy\SDL_nullvideo.h" />
<ClInclude Include="..\..\src\video\SDL_blit.h" />
<ClInclude Include="..\..\src\video\SDL_blit_auto.h" />
<ClInclude Include="..\..\src\video\SDL_blit_copy.h" />
<ClInclude Include="..\..\src\video\SDL_blit_slow.h" />
<ClInclude Include="..\..\src\video\SDL_pixels_c.h" />
<ClInclude Include="..\..\src\video\SDL_rect_c.h" />
<ClInclude Include="..\..\src\video\SDL_RLEaccel_c.h" />
<ClInclude Include="..\..\src\video\SDL_shape_internals.h" />
<ClInclude Include="..\..\src\video\SDL_sysvideo.h" />
<ClInclude Include="..\..\src\video\SDL_vulkan_internal.h" />
<ClInclude Include="..\..\src\video\windows\SDL_vkeys.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsclipboard.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsevents.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsframebuffer.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowskeyboard.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsmessagebox.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsmodes.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsmouse.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsopengl.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsshape.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsvideo.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsvulkan.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowswindow.h" />
<ClInclude Include="..\..\src\video\windows\wmmsg.h" />
<ClInclude Include="..\..\src\video\SDL_yuv_c.h" />
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb.h" />
<ClInclude Include="..\..\src\render\direct3d11\SDL_shaders_d3d11.h" />
<ClInclude Include="..\..\src\render\direct3d\SDL_shaders_d3d.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\libm\e_atan2.c" />
<ClCompile Include="..\..\src\libm\e_log.c" />
<ClCompile Include="..\..\src\libm\e_log10.c" />
<ClCompile Include="..\..\src\libm\e_pow.c" />
<ClCompile Include="..\..\src\libm\e_rem_pio2.c" />
<ClCompile Include="..\..\src\libm\e_sqrt.c" />
<ClCompile Include="..\..\src\libm\k_cos.c" />
<ClCompile Include="..\..\src\libm\k_rem_pio2.c" />
<ClCompile Include="..\..\src\libm\k_sin.c" />
<ClCompile Include="..\..\src\libm\k_tan.c" />
<ClCompile Include="..\..\src\libm\s_atan.c" />
<ClCompile Include="..\..\src\libm\s_copysign.c" />
<ClCompile Include="..\..\src\libm\s_cos.c" />
<ClCompile Include="..\..\src\libm\s_fabs.c" />
<ClCompile Include="..\..\src\libm\s_floor.c" />
<ClCompile Include="..\..\src\libm\s_scalbn.c" />
<ClCompile Include="..\..\src\libm\s_sin.c" />
<ClCompile Include="..\..\src\libm\s_tan.c" />
<ClCompile Include="..\..\src\SDL.c" />
<ClCompile Include="..\..\src\SDL_assert.c" />
<ClCompile Include="..\..\src\atomic\SDL_atomic.c" />
<ClCompile Include="..\..\src\audio\SDL_audio.c" />
<ClCompile Include="..\..\src\audio\SDL_audiocvt.c" />
<ClCompile Include="..\..\src\audio\SDL_audiodev.c" />
<ClCompile Include="..\..\src\audio\SDL_audiotypecvt.c" />
<ClCompile Include="..\..\src\render\software\SDL_blendfillrect.c" />
<ClCompile Include="..\..\src\render\software\SDL_blendline.c" />
<ClCompile Include="..\..\src\render\software\SDL_blendpoint.c" />
<ClCompile Include="..\..\src\video\SDL_blit.c" />
<ClCompile Include="..\..\src\video\SDL_blit_0.c" />
<ClCompile Include="..\..\src\video\SDL_blit_1.c" />
<ClCompile Include="..\..\src\video\SDL_blit_A.c" />
<ClCompile Include="..\..\src\video\SDL_blit_auto.c" />
<ClCompile Include="..\..\src\video\SDL_blit_copy.c" />
<ClCompile Include="..\..\src\video\SDL_blit_N.c" />
<ClCompile Include="..\..\src\video\SDL_blit_slow.c" />
<ClCompile Include="..\..\src\video\SDL_bmp.c" />
<ClCompile Include="..\..\src\video\SDL_clipboard.c" />
<ClCompile Include="..\..\src\events\SDL_clipboardevents.c" />
<ClCompile Include="..\..\src\cpuinfo\SDL_cpuinfo.c" />
<ClCompile Include="..\..\src\render\SDL_d3dmath.c" />
<ClCompile Include="..\..\src\haptic\windows\SDL_dinputhaptic.c" />
<ClCompile Include="..\..\src\joystick\windows\SDL_dinputjoystick.c" />
<ClCompile Include="..\..\src\audio\directsound\SDL_directsound.c" />
<ClCompile Include="..\..\src\audio\disk\SDL_diskaudio.c" />
<ClCompile Include="..\..\src\render\software\SDL_drawline.c" />
<ClCompile Include="..\..\src\render\software\SDL_drawpoint.c" />
<ClCompile Include="..\..\src\events\SDL_dropevents.c" />
<ClCompile Include="..\..\src\audio\dummy\SDL_dummyaudio.c" />
<ClCompile Include="..\..\src\dynapi\SDL_dynapi.c" />
<ClCompile Include="..\..\src\video\SDL_egl.c" />
<ClCompile Include="..\..\src\SDL_dataqueue.c" />
<ClCompile Include="..\..\src\SDL_error.c" />
<ClCompile Include="..\..\src\events\SDL_events.c" />
<ClCompile Include="..\..\src\video\SDL_fillrect.c" />
<ClCompile Include="..\..\src\joystick\SDL_gamecontroller.c" />
<ClCompile Include="..\..\src\events\SDL_gesture.c" />
<ClCompile Include="..\..\src\stdlib\SDL_getenv.c" />
<ClCompile Include="..\..\src\haptic\SDL_haptic.c" />
<ClCompile Include="..\..\src\SDL_hints.c" />
<ClCompile Include="..\..\src\stdlib\SDL_iconv.c" />
<ClCompile Include="..\..\src\joystick\SDL_joystick.c" />
<ClCompile Include="..\..\src\events\SDL_keyboard.c" />
<ClCompile Include="..\..\src\SDL_log.c" />
<ClCompile Include="..\..\src\stdlib\SDL_malloc.c" />
<ClCompile Include="..\..\src\audio\SDL_mixer.c" />
<ClCompile Include="..\..\src\joystick\windows\SDL_mmjoystick.c" />
<ClCompile Include="..\..\src\events\SDL_mouse.c" />
<ClCompile Include="..\..\src\video\dummy\SDL_nullevents.c" />
<ClCompile Include="..\..\src\video\dummy\SDL_nullframebuffer.c" />
<ClCompile Include="..\..\src\video\dummy\SDL_nullvideo.c" />
<ClCompile Include="..\..\src\video\SDL_pixels.c" />
<ClCompile Include="..\..\src\power\SDL_power.c" />
<ClCompile Include="..\..\src\stdlib\SDL_qsort.c" />
<ClCompile Include="..\..\src\events\SDL_quit.c" />
<ClCompile Include="..\..\src\video\SDL_rect.c" />
<ClCompile Include="..\..\src\render\SDL_render.c" />
<ClCompile Include="..\..\src\render\direct3d\SDL_render_d3d.c" />
<ClCompile Include="..\..\src\render\direct3d11\SDL_render_d3d11.c" />
<ClCompile Include="..\..\src\render\opengl\SDL_render_gl.c" />
<ClCompile Include="..\..\src\render\opengles2\SDL_render_gles2.c" />
<ClCompile Include="..\..\src\render\software\SDL_render_sw.c" />
<ClCompile Include="..\..\src\video\SDL_RLEaccel.c" />
<ClCompile Include="..\..\src\render\software\SDL_rotate.c" />
<ClCompile Include="..\..\src\file\SDL_rwops.c" />
<ClCompile Include="..\..\src\render\opengl\SDL_shaders_gl.c" />
<ClCompile Include="..\..\src\render\opengles2\SDL_shaders_gles2.c" />
<ClCompile Include="..\..\src\video\SDL_shape.c" />
<ClCompile Include="..\..\src\atomic\SDL_spinlock.c" />
<ClCompile Include="..\..\src\stdlib\SDL_stdlib.c" />
<ClCompile Include="..\..\src\video\SDL_stretch.c" />
<ClCompile Include="..\..\src\stdlib\SDL_string.c" />
<ClCompile Include="..\..\src\video\SDL_surface.c" />
<ClCompile Include="..\..\src\thread\generic\SDL_syscond.c" />
<ClCompile Include="..\..\src\filesystem\windows\SDL_sysfilesystem.c" />
<ClCompile Include="..\..\src\loadso\windows\SDL_sysloadso.c" />
<ClCompile Include="..\..\src\thread\windows\SDL_sysmutex.c" />
<ClCompile Include="..\..\src\power\windows\SDL_syspower.c" />
<ClCompile Include="..\..\src\thread\windows\SDL_syssem.c" />
<ClCompile Include="..\..\src\thread\windows\SDL_systhread.c" />
<ClCompile Include="..\..\src\timer\windows\SDL_systimer.c" />
<ClCompile Include="..\..\src\thread\windows\SDL_systls.c" />
<ClCompile Include="..\..\src\thread\SDL_thread.c" />
<ClCompile Include="..\..\src\timer\SDL_timer.c" />
<ClCompile Include="..\..\src\events\SDL_touch.c" />
<ClCompile Include="..\..\src\video\SDL_video.c" />
<ClCompile Include="..\..\src\audio\SDL_wave.c" />
<ClCompile Include="..\..\src\events\SDL_windowevents.c" />
<ClCompile Include="..\..\src\core\windows\SDL_windows.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsclipboard.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsevents.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsframebuffer.c" />
<ClCompile Include="..\..\src\haptic\windows\SDL_windowshaptic.c" />
<ClCompile Include="..\..\src\joystick\windows\SDL_windowsjoystick.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowskeyboard.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsmessagebox.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsmodes.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsmouse.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsopengl.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsopengles.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsshape.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsvideo.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowswindow.c" />
<ClCompile Include="..\..\src\audio\winmm\SDL_winmm.c" />
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi.c" />
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi_win32.c" />
<ClCompile Include="..\..\src\core\windows\SDL_xinput.c" />
<ClCompile Include="..\..\src\haptic\windows\SDL_xinputhaptic.c" />
<ClCompile Include="..\..\src\joystick\windows\SDL_xinputjoystick.c" />
<ClCompile Include="..\..\src\render\SDL_yuv_sw.c" />
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi.c" />
<ClCompile Include="..\..\src\video\SDL_vulkan_utils.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsvulkan.c" />
<ClCompile Include="..\..\src\libm\e_fmod.c" />
<ClCompile Include="..\..\src\video\SDL_yuv.c" />
<ClCompile Include="..\..\src\video\yuv2rgb\yuv_rgb.c" />
<ClCompile Include="..\..\src\render\direct3d11\SDL_shaders_d3d11.c" />
<ClCompile Include="..\..\src\render\direct3d\SDL_shaders_d3d.c" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\src\main\windows\version.rc" />
</ItemGroup>
</Project>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="API Headers">
<UniqueIdentifier>{395b3af0-33d0-411b-b153-de1676bf1ef8}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\include\begin_code.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\close_code.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_assert.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_atomic.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_audio.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_bits.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_blendmode.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_clipboard.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_config.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_config_windows.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_copying.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_cpuinfo.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_egl.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_endian.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_error.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_events.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_filesystem.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_gamecontroller.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_gesture.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_haptic.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_hints.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_joystick.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_keyboard.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_keycode.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_loadso.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_log.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_main.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_messagebox.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_mouse.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_mutex.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_name.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_opengl.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_opengl_glext.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_opengles.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_opengles2.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_opengles2_gl2.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_opengles2_gl2ext.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_opengles2_gl2platform.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_opengles2_khrplatform.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_pixels.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_platform.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_power.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_quit.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_rect.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_render.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_revision.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_rwops.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_scancode.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_sensor.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_shape.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_stdinc.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_surface.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_system.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_syswm.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_test.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_test_assert.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_test_common.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_test_compare.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_test_crc32.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_test_font.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_test_fuzzer.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_test_harness.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_test_images.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_test_log.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_test_md5.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_test_random.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_thread.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_timer.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_touch.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_types.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_version.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_video.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_vulkan.h">
<Filter>API Headers</Filter>
</ClInclude>
<ClInclude Include="..\..\src\audio\directsound\SDL_directsound.h" />
<ClInclude Include="..\..\src\audio\disk\SDL_diskaudio.h" />
<ClInclude Include="..\..\src\audio\dummy\SDL_dummyaudio.h" />
<ClInclude Include="..\..\src\audio\SDL_audio_c.h" />
<ClInclude Include="..\..\src\audio\SDL_audiodev_c.h" />
<ClInclude Include="..\..\src\audio\SDL_sysaudio.h" />
<ClInclude Include="..\..\src\audio\SDL_wave.h" />
<ClInclude Include="..\..\src\audio\wasapi\SDL_wasapi.h" />
<ClInclude Include="..\..\src\audio\winmm\SDL_winmm.h" />
<ClInclude Include="..\..\src\core\windows\SDL_directx.h" />
<ClInclude Include="..\..\src\core\windows\SDL_windows.h" />
<ClInclude Include="..\..\src\core\windows\SDL_xinput.h" />
<ClInclude Include="..\..\src\dynapi\SDL_dynapi.h" />
<ClInclude Include="..\..\src\dynapi\SDL_dynapi_overrides.h" />
<ClInclude Include="..\..\src\dynapi\SDL_dynapi_procs.h" />
<ClInclude Include="..\..\src\events\blank_cursor.h" />
<ClInclude Include="..\..\src\events\default_cursor.h" />
<ClInclude Include="..\..\src\events\SDL_clipboardevents_c.h" />
<ClInclude Include="..\..\src\events\SDL_displayevents_c.h" />
<ClInclude Include="..\..\src\events\SDL_dropevents_c.h" />
<ClInclude Include="..\..\src\events\SDL_events_c.h" />
<ClInclude Include="..\..\src\events\SDL_gesture_c.h" />
<ClInclude Include="..\..\src\events\SDL_keyboard_c.h" />
<ClInclude Include="..\..\src\events\SDL_mouse_c.h" />
<ClInclude Include="..\..\src\events\SDL_sysevents.h" />
<ClInclude Include="..\..\src\events\SDL_touch_c.h" />
<ClInclude Include="..\..\src\events\SDL_windowevents_c.h" />
<ClInclude Include="..\..\src\haptic\SDL_syshaptic.h" />
<ClInclude Include="..\..\src\haptic\windows\SDL_dinputhaptic_c.h" />
<ClInclude Include="..\..\src\haptic\windows\SDL_windowshaptic_c.h" />
<ClInclude Include="..\..\src\haptic\windows\SDL_xinputhaptic_c.h" />
<ClInclude Include="..\..\src\joystick\controller_type.h" />
<ClInclude Include="..\..\src\joystick\hidapi\SDL_hidapijoystick_c.h" />
<ClInclude Include="..\..\src\joystick\SDL_joystick_c.h" />
<ClInclude Include="..\..\src\joystick\SDL_sysjoystick.h" />
<ClInclude Include="..\..\src\joystick\windows\SDL_dinputjoystick_c.h" />
<ClInclude Include="..\..\src\joystick\windows\SDL_windowsjoystick_c.h" />
<ClInclude Include="..\..\src\joystick\windows\SDL_xinputjoystick_c.h" />
<ClInclude Include="..\..\src\libm\math_libm.h" />
<ClInclude Include="..\..\src\libm\math_private.h" />
<ClInclude Include="..\..\src\render\direct3d\SDL_shaders_d3d.h" />
<ClInclude Include="..\..\src\render\direct3d11\SDL_shaders_d3d11.h" />
<ClInclude Include="..\..\src\render\opengl\SDL_glfuncs.h" />
<ClInclude Include="..\..\src\render\opengl\SDL_shaders_gl.h" />
<ClInclude Include="..\..\src\render\opengles\SDL_glesfuncs.h" />
<ClInclude Include="..\..\src\render\SDL_d3dmath.h" />
<ClInclude Include="..\..\src\render\SDL_sysrender.h" />
<ClInclude Include="..\..\src\render\SDL_yuv_sw_c.h" />
<ClInclude Include="..\..\src\render\software\SDL_blendfillrect.h" />
<ClInclude Include="..\..\src\render\software\SDL_blendline.h" />
<ClInclude Include="..\..\src\render\software\SDL_blendpoint.h" />
<ClInclude Include="..\..\src\render\software\SDL_draw.h" />
<ClInclude Include="..\..\src\render\software\SDL_drawline.h" />
<ClInclude Include="..\..\src\render\software\SDL_drawpoint.h" />
<ClInclude Include="..\..\src\render\software\SDL_render_sw_c.h" />
<ClInclude Include="..\..\src\render\software\SDL_rotate.h" />
<ClInclude Include="..\..\src\SDL_dataqueue.h" />
<ClInclude Include="..\..\src\SDL_error_c.h" />
<ClInclude Include="..\..\src\sensor\dummy\SDL_dummysensor.h" />
<ClInclude Include="..\..\src\sensor\SDL_sensor_c.h" />
<ClInclude Include="..\..\src\sensor\SDL_syssensor.h" />
<ClInclude Include="..\..\src\thread\SDL_systhread.h" />
<ClInclude Include="..\..\src\thread\SDL_thread_c.h" />
<ClInclude Include="..\..\src\thread\windows\SDL_systhread_c.h" />
<ClInclude Include="..\..\src\timer\SDL_timer_c.h" />
<ClInclude Include="..\..\src\video\dummy\SDL_nullevents_c.h" />
<ClInclude Include="..\..\src\video\dummy\SDL_nullframebuffer_c.h" />
<ClInclude Include="..\..\src\video\dummy\SDL_nullvideo.h" />
<ClInclude Include="..\..\src\video\SDL_blit.h" />
<ClInclude Include="..\..\src\video\SDL_blit_auto.h" />
<ClInclude Include="..\..\src\video\SDL_blit_copy.h" />
<ClInclude Include="..\..\src\video\SDL_blit_slow.h" />
<ClInclude Include="..\..\src\video\SDL_pixels_c.h" />
<ClInclude Include="..\..\src\video\SDL_rect_c.h" />
<ClInclude Include="..\..\src\video\SDL_RLEaccel_c.h" />
<ClInclude Include="..\..\src\video\SDL_shape_internals.h" />
<ClInclude Include="..\..\src\video\SDL_sysvideo.h" />
<ClInclude Include="..\..\src\video\SDL_vulkan_internal.h" />
<ClInclude Include="..\..\src\video\SDL_yuv_c.h" />
<ClInclude Include="..\..\src\video\windows\SDL_vkeys.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsclipboard.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsevents.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsframebuffer.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowskeyboard.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsmessagebox.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsmodes.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsmouse.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsopengl.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsshape.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsvideo.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsvulkan.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowswindow.h" />
<ClInclude Include="..\..\src\video\windows\wmmsg.h" />
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\atomic\SDL_atomic.c" />
<ClCompile Include="..\..\src\atomic\SDL_spinlock.c" />
<ClCompile Include="..\..\src\audio\directsound\SDL_directsound.c" />
<ClCompile Include="..\..\src\audio\disk\SDL_diskaudio.c" />
<ClCompile Include="..\..\src\audio\dummy\SDL_dummyaudio.c" />
<ClCompile Include="..\..\src\audio\SDL_audio.c" />
<ClCompile Include="..\..\src\audio\SDL_audiocvt.c" />
<ClCompile Include="..\..\src\audio\SDL_audiodev.c" />
<ClCompile Include="..\..\src\audio\SDL_audiotypecvt.c" />
<ClCompile Include="..\..\src\audio\SDL_mixer.c" />
<ClCompile Include="..\..\src\audio\SDL_wave.c" />
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi.c" />
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi.c" />
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi_win32.c" />
<ClCompile Include="..\..\src\audio\winmm\SDL_winmm.c" />
<ClCompile Include="..\..\src\core\windows\SDL_windows.c" />
<ClCompile Include="..\..\src\core\windows\SDL_xinput.c" />
<ClCompile Include="..\..\src\cpuinfo\SDL_cpuinfo.c" />
<ClCompile Include="..\..\src\dynapi\SDL_dynapi.c" />
<ClCompile Include="..\..\src\events\SDL_clipboardevents.c" />
<ClCompile Include="..\..\src\events\SDL_displayevents.c" />
<ClCompile Include="..\..\src\events\SDL_dropevents.c" />
<ClCompile Include="..\..\src\events\SDL_events.c" />
<ClCompile Include="..\..\src\events\SDL_gesture.c" />
<ClCompile Include="..\..\src\events\SDL_keyboard.c" />
<ClCompile Include="..\..\src\events\SDL_mouse.c" />
<ClCompile Include="..\..\src\events\SDL_quit.c" />
<ClCompile Include="..\..\src\events\SDL_touch.c" />
<ClCompile Include="..\..\src\events\SDL_windowevents.c" />
<ClCompile Include="..\..\src\file\SDL_rwops.c" />
<ClCompile Include="..\..\src\filesystem\windows\SDL_sysfilesystem.c" />
<ClCompile Include="..\..\src\haptic\SDL_haptic.c" />
<ClCompile Include="..\..\src\haptic\windows\SDL_dinputhaptic.c" />
<ClCompile Include="..\..\src\haptic\windows\SDL_windowshaptic.c" />
<ClCompile Include="..\..\src\haptic\windows\SDL_xinputhaptic.c" />
<ClCompile Include="..\..\src\hidapi\windows\hid.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_gamecube.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_ps4.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_rumble.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_switch.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xbox360.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xbox360w.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xboxone.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapijoystick.c" />
<ClCompile Include="..\..\src\joystick\SDL_gamecontroller.c" />
<ClCompile Include="..\..\src\joystick\SDL_joystick.c" />
<ClCompile Include="..\..\src\joystick\windows\SDL_dinputjoystick.c" />
<ClCompile Include="..\..\src\joystick\windows\SDL_mmjoystick.c" />
<ClCompile Include="..\..\src\joystick\windows\SDL_windowsjoystick.c" />
<ClCompile Include="..\..\src\joystick\windows\SDL_xinputjoystick.c" />
<ClCompile Include="..\..\src\libm\e_atan2.c" />
<ClCompile Include="..\..\src\libm\e_exp.c" />
<ClCompile Include="..\..\src\libm\e_fmod.c" />
<ClCompile Include="..\..\src\libm\e_log.c" />
<ClCompile Include="..\..\src\libm\e_log10.c" />
<ClCompile Include="..\..\src\libm\e_pow.c" />
<ClCompile Include="..\..\src\libm\e_rem_pio2.c" />
<ClCompile Include="..\..\src\libm\e_sqrt.c" />
<ClCompile Include="..\..\src\libm\k_cos.c" />
<ClCompile Include="..\..\src\libm\k_rem_pio2.c" />
<ClCompile Include="..\..\src\libm\k_sin.c" />
<ClCompile Include="..\..\src\libm\k_tan.c" />
<ClCompile Include="..\..\src\libm\s_atan.c" />
<ClCompile Include="..\..\src\libm\s_copysign.c" />
<ClCompile Include="..\..\src\libm\s_cos.c" />
<ClCompile Include="..\..\src\libm\s_fabs.c" />
<ClCompile Include="..\..\src\libm\s_floor.c" />
<ClCompile Include="..\..\src\libm\s_scalbn.c" />
<ClCompile Include="..\..\src\libm\s_sin.c" />
<ClCompile Include="..\..\src\libm\s_tan.c" />
<ClCompile Include="..\..\src\loadso\windows\SDL_sysloadso.c" />
<ClCompile Include="..\..\src\power\SDL_power.c" />
<ClCompile Include="..\..\src\power\windows\SDL_syspower.c" />
<ClCompile Include="..\..\src\render\direct3d\SDL_render_d3d.c" />
<ClCompile Include="..\..\src\render\direct3d\SDL_shaders_d3d.c" />
<ClCompile Include="..\..\src\render\direct3d11\SDL_render_d3d11.c" />
<ClCompile Include="..\..\src\render\direct3d11\SDL_shaders_d3d11.c" />
<ClCompile Include="..\..\src\render\opengl\SDL_render_gl.c" />
<ClCompile Include="..\..\src\render\opengl\SDL_shaders_gl.c" />
<ClCompile Include="..\..\src\render\opengles2\SDL_render_gles2.c" />
<ClCompile Include="..\..\src\render\opengles2\SDL_shaders_gles2.c" />
<ClCompile Include="..\..\src\render\SDL_d3dmath.c" />
<ClCompile Include="..\..\src\render\SDL_render.c" />
<ClCompile Include="..\..\src\render\SDL_yuv_sw.c" />
<ClCompile Include="..\..\src\render\software\SDL_blendfillrect.c" />
<ClCompile Include="..\..\src\render\software\SDL_blendline.c" />
<ClCompile Include="..\..\src\render\software\SDL_blendpoint.c" />
<ClCompile Include="..\..\src\render\software\SDL_drawline.c" />
<ClCompile Include="..\..\src\render\software\SDL_drawpoint.c" />
<ClCompile Include="..\..\src\render\software\SDL_render_sw.c" />
<ClCompile Include="..\..\src\render\software\SDL_rotate.c" />
<ClCompile Include="..\..\src\SDL.c" />
<ClCompile Include="..\..\src\SDL_assert.c" />
<ClCompile Include="..\..\src\SDL_dataqueue.c" />
<ClCompile Include="..\..\src\SDL_error.c" />
<ClCompile Include="..\..\src\SDL_hints.c" />
<ClCompile Include="..\..\src\SDL_log.c" />
<ClCompile Include="..\..\src\sensor\dummy\SDL_dummysensor.c" />
<ClCompile Include="..\..\src\sensor\SDL_sensor.c" />
<ClCompile Include="..\..\src\stdlib\SDL_getenv.c" />
<ClCompile Include="..\..\src\stdlib\SDL_iconv.c" />
<ClCompile Include="..\..\src\stdlib\SDL_malloc.c" />
<ClCompile Include="..\..\src\stdlib\SDL_qsort.c" />
<ClCompile Include="..\..\src\stdlib\SDL_stdlib.c" />
<ClCompile Include="..\..\src\stdlib\SDL_string.c" />
<ClCompile Include="..\..\src\stdlib\SDL_strtokr.c" />
<ClCompile Include="..\..\src\thread\generic\SDL_syscond.c" />
<ClCompile Include="..\..\src\thread\SDL_thread.c" />
<ClCompile Include="..\..\src\thread\windows\SDL_sysmutex.c" />
<ClCompile Include="..\..\src\thread\windows\SDL_syssem.c" />
<ClCompile Include="..\..\src\thread\windows\SDL_systhread.c" />
<ClCompile Include="..\..\src\thread\windows\SDL_systls.c" />
<ClCompile Include="..\..\src\timer\SDL_timer.c" />
<ClCompile Include="..\..\src\timer\windows\SDL_systimer.c" />
<ClCompile Include="..\..\src\video\dummy\SDL_nullevents.c" />
<ClCompile Include="..\..\src\video\dummy\SDL_nullframebuffer.c" />
<ClCompile Include="..\..\src\video\dummy\SDL_nullvideo.c" />
<ClCompile Include="..\..\src\video\SDL_blit.c" />
<ClCompile Include="..\..\src\video\SDL_blit_0.c" />
<ClCompile Include="..\..\src\video\SDL_blit_1.c" />
<ClCompile Include="..\..\src\video\SDL_blit_A.c" />
<ClCompile Include="..\..\src\video\SDL_blit_auto.c" />
<ClCompile Include="..\..\src\video\SDL_blit_copy.c" />
<ClCompile Include="..\..\src\video\SDL_blit_N.c" />
<ClCompile Include="..\..\src\video\SDL_blit_slow.c" />
<ClCompile Include="..\..\src\video\SDL_bmp.c" />
<ClCompile Include="..\..\src\video\SDL_clipboard.c" />
<ClCompile Include="..\..\src\video\SDL_egl.c" />
<ClCompile Include="..\..\src\video\SDL_fillrect.c" />
<ClCompile Include="..\..\src\video\SDL_pixels.c" />
<ClCompile Include="..\..\src\video\SDL_rect.c" />
<ClCompile Include="..\..\src\video\SDL_RLEaccel.c" />
<ClCompile Include="..\..\src\video\SDL_shape.c" />
<ClCompile Include="..\..\src\video\SDL_stretch.c" />
<ClCompile Include="..\..\src\video\SDL_surface.c" />
<ClCompile Include="..\..\src\video\SDL_video.c" />
<ClCompile Include="..\..\src\video\SDL_vulkan_utils.c" />
<ClCompile Include="..\..\src\video\SDL_yuv.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsclipboard.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsevents.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsframebuffer.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowskeyboard.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsmessagebox.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsmodes.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsmouse.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsopengl.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsopengles.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsshape.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsvideo.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsvulkan.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowswindow.c" />
<ClCompile Include="..\..\src\video\yuv2rgb\yuv_rgb.c" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\src\main\windows\version.rc" />
</ItemGroup>
</Project>

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
@ -108,7 +108,6 @@
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<OmitDefaultLibName>true</OmitDefaultLibName>
@ -143,7 +142,6 @@
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<OmitDefaultLibName>true</OmitDefaultLibName>

View file

@ -108,7 +108,6 @@
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<OmitDefaultLibName>true</OmitDefaultLibName>
@ -143,7 +142,6 @@
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<OmitDefaultLibName>true</OmitDefaultLibName>

View file

@ -189,6 +189,12 @@
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\..\SDLtest\SDLtest.vcxproj">
<Project>{da956fd3-e143-46f2-9fe5-c77bebc56b1a}</Project>
<Private>false</Private>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\test\testgesture.c" />

View file

@ -1,355 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="testvulkan"
ProjectGUID="{0D604DFD-AAB6-442C-9368-F91A344146AB}"
RootNamespace="testvulkan"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
<Platform
Name="x64"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName=".\Debug/testvulkan.tlb"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(SolutionDir)/../include&quot;"
AdditionalUsingDirectories=""
PreprocessorDefinitions="_DEBUG,WIN32,_WINDOWS,HAVE_OPENGL"
RuntimeLibrary="2"
WarningLevel="3"
DebugInformationFormat="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
SubSystem="2"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="3"
TypeLibraryName=".\Debug/testvulkan.tlb"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(SolutionDir)/../include&quot;"
AdditionalUsingDirectories=""
PreprocessorDefinitions="_DEBUG,WIN32,_WINDOWS,HAVE_OPENGL"
RuntimeLibrary="3"
WarningLevel="3"
DebugInformationFormat="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
SubSystem="2"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName=".\Release/testvulkan.tlb"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(SolutionDir)/../include&quot;"
AdditionalUsingDirectories=""
PreprocessorDefinitions="NDEBUG,WIN32,_WINDOWS,HAVE_OPENGL"
RuntimeLibrary="2"
WarningLevel="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
SubSystem="2"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|x64"
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="3"
TypeLibraryName=".\Release/testvulkan.tlb"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(SolutionDir)/../include&quot;"
AdditionalUsingDirectories=""
PreprocessorDefinitions="NDEBUG,WIN32,_WINDOWS,HAVE_OPENGL"
RuntimeLibrary="2"
WarningLevel="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
SubSystem="2"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
<ProjectReference
ReferencedProjectIdentifier="{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}"
CopyLocal="false"
CopyLocalDependencies="false"
CopyLocalSatelliteAssemblies="false"
RelativePathToProject=".\SDL\SDL_VS2008.vcproj"
/>
<ProjectReference
ReferencedProjectIdentifier="{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}"
CopyLocal="false"
CopyLocalDependencies="false"
CopyLocalSatelliteAssemblies="false"
RelativePathToProject=".\SDLmain\SDLmain_VS2008.vcproj"
/>
<ProjectReference
ReferencedProjectIdentifier="{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}"
CopyLocal="false"
CopyLocalDependencies="false"
CopyLocalSatelliteAssemblies="false"
RelativePathToProject=".\SDLtest\SDLtest_VS2008.vcproj"
/>
</References>
<Files>
<File
RelativePath="..\..\..\test\testvulkan.c"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View file

0
VisualC/visualtest/visualtest_VS2012.vcxproj Executable file → Normal file
View file

View file

@ -1,12 +1,84 @@
This is a list of major changes in SDL's version history.
---------------------------------------------------------------------------
2.0.11/12:
---------------------------------------------------------------------------
General:
* Added SDL_LockTextureToSurface(), similar to SDL_LockTexture() but the locked area is exposed as a SDL surface.
---------------------------------------------------------------------------
2.0.10:
---------------------------------------------------------------------------
General:
* The SDL_RW* macros have been turned into functions that are available only in 2.0.10 and onward
* Added SDL_SIMDGetAlignment(), SDL_SIMDAlloc(), and SDL_SIMDFree(), to allocate memory aligned for SIMD operations for the current CPU
* Added SDL_RenderDrawPointF(), SDL_RenderDrawPointsF(), SDL_RenderDrawLineF(), SDL_RenderDrawLinesF(), SDL_RenderDrawRectF(), SDL_RenderDrawRectsF(), SDL_RenderFillRectF(), SDL_RenderFillRectsF(), SDL_RenderCopyF(), SDL_RenderCopyExF(), to allow floating point precision in the SDL rendering API.
* Added SDL_GetTouchDeviceType() to get the type of a touch device, which can be a touch screen or a trackpad in relative or absolute coordinate mode.
* The SDL rendering API now uses batched rendering by default, for improved performance
* Added SDL_RenderFlush() to force batched render commands to execute, if you're going to mix SDL rendering with native rendering
* Added the hint SDL_HINT_RENDER_BATCHING to control whether batching should be used for the rendering API. This defaults to "1" if you don't specify what rendering driver to use when creating the renderer.
* Added the hint SDL_HINT_EVENT_LOGGING to enable logging of SDL events for debugging purposes
* Added the hint SDL_HINT_GAMECONTROLLERCONFIG_FILE to specify a file that will be loaded at joystick initialization with game controller bindings
* Added the hint SDL_HINT_MOUSE_TOUCH_EVENTS to control whether SDL will synthesize touch events from mouse events
* Improved handling of malformed WAVE and BMP files, fixing potential security exploits
Linux:
* Removed the Mir video driver in favor of Wayland
iOS / tvOS:
* Added support for Xbox and PS4 wireless controllers in iOS 13 and tvOS 13
* Added support for text input using Bluetooth keyboards
Android:
* Added low latency audio using OpenSL ES
* Removed SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH (replaced by SDL_HINT_MOUSE_TOUCH_EVENTS and SDL_HINT_TOUCH_MOUSE_EVENTS)
SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH=1, should be replaced by setting both previous hints to 0.
SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH=0, should be replaced by setting both previous hints to 1.
* Added the hint SDL_HINT_ANDROID_BLOCK_ON_PAUSE to set whether the event loop will block itself when the app is paused.
---------------------------------------------------------------------------
2.0.9:
---------------------------------------------------------------------------
General:
* Added a new sensor API, initialized by passing SDL_INIT_SENSOR to SDL_Init(), and defined in SDL_sensor.h
* Added an event SDL_SENSORUPDATE which is sent when a sensor is updated
* Added SDL_GetDisplayOrientation() to return the current display orientation
* Added an event SDL_DISPLAYEVENT which is sent when the display orientation changes
* Added HIDAPI joystick drivers for more consistent support for Xbox, PS4 and Nintendo Switch Pro controller support across platforms. (Thanks to Valve for contributing the PS4 and Nintendo Switch Pro controller support)
* Added support for many other popular game controllers
* Added SDL_JoystickGetDevicePlayerIndex(), SDL_JoystickGetPlayerIndex(), and SDL_GameControllerGetPlayerIndex() to get the player index for a controller. For XInput controllers this returns the XInput index for the controller.
* Added SDL_GameControllerRumble() and SDL_JoystickRumble() which allow simple rumble without using the haptics API
* Added SDL_GameControllerMappingForDeviceIndex() to get the mapping for a controller before it's opened
* Added the hint SDL_HINT_MOUSE_DOUBLE_CLICK_TIME to control the mouse double-click time
* Added the hint SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS to control the mouse double-click radius, in pixels
* Added SDL_HasColorKey() to return whether a surface has a colorkey active
* Added SDL_HasAVX512F() to return whether the CPU has AVX-512F features
* Added SDL_IsTablet() to return whether the application is running on a tablet
* Added SDL_THREAD_PRIORITY_TIME_CRITICAL for threads that must run at the highest priority
Mac OS X:
* Fixed black screen at start on Mac OS X Mojave
Linux:
* Added SDL_LinuxSetThreadPriority() to allow adjusting the thread priority of native threads using RealtimeKit if available.
iOS:
* Fixed Asian IME input
Android:
* Updated required Android SDK to API 26, to match Google's new App Store requirements
* Added support for wired USB Xbox, PS4, and Nintendo Switch Pro controllers
* Added support for relative mouse mode on Android 7.0 and newer (except where it's broken, on Chromebooks and when in DeX mode with Samsung Experience 9.0)
* Added support for custom mouse cursors on Android 7.0 and newer
* Added the hint SDL_HINT_ANDROID_TRAP_BACK_BUTTON to control whether the back button will back out of the app (the default) or be passed to the application as SDL_SCANCODE_AC_BACK
* Added SDL_AndroidBackButton() to trigger the Android system back button behavior when handling the back button in the application
* Added SDL_IsChromebook() to return whether the app is running in the Chromebook Android runtime
* Added SDL_IsDeXMode() to return whether the app is running while docked in the Samsung DeX
---------------------------------------------------------------------------

184
Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj Executable file → Normal file
View file

@ -10,6 +10,13 @@
1D3623EC0D0F72F000981E51 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D3623EB0D0F72F000981E51 /* CoreGraphics.framework */; };
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
F3F7590022AC5EC7001D97F2 /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F3F758FF22AC5EC7001D97F2 /* Metal.framework */; };
F3F7590122AC5F00001D97F2 /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F3F758FF22AC5EC7001D97F2 /* Metal.framework */; };
F3F7590222AC5F3D001D97F2 /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F3F758FF22AC5EC7001D97F2 /* Metal.framework */; };
F3F7590322AC5F71001D97F2 /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F3F758FF22AC5EC7001D97F2 /* Metal.framework */; };
F3F7590422AC5F8D001D97F2 /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F3F758FF22AC5EC7001D97F2 /* Metal.framework */; };
F3F7590522AC5FB3001D97F2 /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F3F758FF22AC5EC7001D97F2 /* Metal.framework */; };
F3F7590622AC5FD1001D97F2 /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F3F758FF22AC5EC7001D97F2 /* Metal.framework */; };
FA30DEB01BBF5A8F009C397F /* common.c in Sources */ = {isa = PBXBuildFile; fileRef = FD77A0060E26BC0500F39101 /* common.c */; };
FA30DEB11BBF5A93009C397F /* happy.c in Sources */ = {isa = PBXBuildFile; fileRef = FD77A0080E26BC0500F39101 /* happy.c */; };
FA30DEB31BBF5AD7009C397F /* icon.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FDB651CC0E43D19800F688B5 /* icon.bmp */; };
@ -40,7 +47,6 @@
FA8B4BA91967073D00F8EB7C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4BA21967070A00F8EB7C /* CoreMotion.framework */; };
FABA34D41D8B5E5600915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34D31D8B5E5600915323 /* AVFoundation.framework */; };
FABA34D61D8B5E5A00915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34D31D8B5E5600915323 /* AVFoundation.framework */; };
FABA34D81D8B5E7700915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34D71D8B5E7700915323 /* AVFoundation.framework */; };
FABA34D91D8B5E7B00915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34D31D8B5E5600915323 /* AVFoundation.framework */; };
FABA34DA1D8B5E7F00915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34D31D8B5E5600915323 /* AVFoundation.framework */; };
FABA34DB1D8B5E8500915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34D31D8B5E5600915323 /* AVFoundation.framework */; };
@ -197,6 +203,34 @@
remoteGlobalIDString = FD6526620DE8FCCB002AD96B;
remoteInfo = libSDL;
};
F3F758F722AC5E8F001D97F2 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FD1B48920E313154007AB34E /* SDL.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 52ED1E5C222889500061FCE0;
remoteInfo = "libSDL-iOS-dylib";
};
F3F758F922AC5E8F001D97F2 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FD1B48920E313154007AB34E /* SDL.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = F3E3C7572241389A007D243C;
remoteInfo = "libSDL-tvOS-dylib";
};
F3F758FB22AC5E8F001D97F2 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FD1B48920E313154007AB34E /* SDL.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = F3E3C65222406928007D243C;
remoteInfo = "libSDLmain-iOS";
};
F3F758FD22AC5E8F001D97F2 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FD1B48920E313154007AB34E /* SDL.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = F3E3C75F224138AE007D243C;
remoteInfo = "libSDLmain-tvOS";
};
FA30DEAB1BBF59D9009C397F /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FD1B48920E313154007AB34E /* SDL.xcodeproj */;
@ -226,6 +260,7 @@
1D6058910D05DD3D006BFB54 /* Rectangles.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Rectangles.app; sourceTree = BUILT_PRODUCTS_DIR; };
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
F3F758FF22AC5EC7001D97F2 /* Metal.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Metal.framework; path = System/Library/Frameworks/Metal.framework; sourceTree = SDKROOT; };
FA30DE961BBF59D9009C397F /* Happy-TV.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Happy-TV.app"; sourceTree = BUILT_PRODUCTS_DIR; };
FA86C0361D9765BA009CB637 /* iOS Launch Screen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = "iOS Launch Screen.storyboard"; sourceTree = "<group>"; };
FA8B4BA21967070A00F8EB7C /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; };
@ -271,17 +306,18 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
FABA34D41D8B5E5600915323 /* AVFoundation.framework in Frameworks */,
FD1B48DD0E313255007AB34E /* libSDL2.a in Frameworks */,
FAE0E96A1BAF96A00098DFA4 /* GameController.framework in Frameworks */,
FA8B4BA31967070A00F8EB7C /* CoreMotion.framework in Frameworks */,
FDF0D7AB0E12D53800247964 /* CoreAudio.framework in Frameworks */,
FDF0D7AC0E12D53800247964 /* AudioToolbox.framework in Frameworks */,
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */,
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */,
FABA34D41D8B5E5600915323 /* AVFoundation.framework in Frameworks */,
FDF0D7AB0E12D53800247964 /* CoreAudio.framework in Frameworks */,
1D3623EC0D0F72F000981E51 /* CoreGraphics.framework in Frameworks */,
FA8B4BA31967070A00F8EB7C /* CoreMotion.framework in Frameworks */,
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */,
FAE0E96A1BAF96A00098DFA4 /* GameController.framework in Frameworks */,
F3F7590022AC5EC7001D97F2 /* Metal.framework in Frameworks */,
FDB96ED40DEFC9C700FAF19F /* OpenGLES.framework in Frameworks */,
FDB96EE00DEFC9DC00FAF19F /* QuartzCore.framework in Frameworks */,
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -289,16 +325,15 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
FABA34D81D8B5E7700915323 /* AVFoundation.framework in Frameworks */,
FA30DEB71BBF5BB8009C397F /* libSDL2.a in Frameworks */,
FA30DEC81BBF5C14009C397F /* GameController.framework in Frameworks */,
FA30DEC91BBF5C14009C397F /* AudioToolbox.framework in Frameworks */,
FA30DECF1BBF5C14009C397F /* CoreAudio.framework in Frameworks */,
FA30DECC1BBF5C14009C397F /* CoreGraphics.framework in Frameworks */,
FA30DECE1BBF5C14009C397F /* Foundation.framework in Frameworks */,
FA30DEC81BBF5C14009C397F /* GameController.framework in Frameworks */,
FA30DECA1BBF5C14009C397F /* QuartzCore.framework in Frameworks */,
FA30DECB1BBF5C14009C397F /* OpenGLES.framework in Frameworks */,
FA30DECC1BBF5C14009C397F /* CoreGraphics.framework in Frameworks */,
FA30DECD1BBF5C14009C397F /* UIKit.framework in Frameworks */,
FA30DECE1BBF5C14009C397F /* Foundation.framework in Frameworks */,
FA30DECF1BBF5C14009C397F /* CoreAudio.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -306,17 +341,18 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
FABA34D61D8B5E5A00915323 /* AVFoundation.framework in Frameworks */,
FD1B49980E313261007AB34E /* libSDL2.a in Frameworks */,
FAE0E96C1BAF96A90098DFA4 /* GameController.framework in Frameworks */,
FA8B4BA41967071300F8EB7C /* CoreMotion.framework in Frameworks */,
FDF0D7A90E12D53500247964 /* CoreAudio.framework in Frameworks */,
FDF0D7AA0E12D53500247964 /* AudioToolbox.framework in Frameworks */,
FD15FD690E086911003BDF25 /* Foundation.framework in Frameworks */,
FD15FD6A0E086911003BDF25 /* UIKit.framework in Frameworks */,
FABA34D61D8B5E5A00915323 /* AVFoundation.framework in Frameworks */,
FDF0D7A90E12D53500247964 /* CoreAudio.framework in Frameworks */,
FD15FD6B0E086911003BDF25 /* CoreGraphics.framework in Frameworks */,
FA8B4BA41967071300F8EB7C /* CoreMotion.framework in Frameworks */,
FD15FD690E086911003BDF25 /* Foundation.framework in Frameworks */,
FAE0E96C1BAF96A90098DFA4 /* GameController.framework in Frameworks */,
F3F7590122AC5F00001D97F2 /* Metal.framework in Frameworks */,
FD15FD6C0E086911003BDF25 /* OpenGLES.framework in Frameworks */,
FD15FD6D0E086911003BDF25 /* QuartzCore.framework in Frameworks */,
FD15FD6A0E086911003BDF25 /* UIKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -324,17 +360,18 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
FABA34D91D8B5E7B00915323 /* AVFoundation.framework in Frameworks */,
FD1B499C0E313269007AB34E /* libSDL2.a in Frameworks */,
FAE0E96D1BAF96AF0098DFA4 /* GameController.framework in Frameworks */,
FA8B4BA51967071A00F8EB7C /* CoreMotion.framework in Frameworks */,
FDF0D7A70E12D53200247964 /* CoreAudio.framework in Frameworks */,
FDF0D7A80E12D53200247964 /* AudioToolbox.framework in Frameworks */,
FABA34D91D8B5E7B00915323 /* AVFoundation.framework in Frameworks */,
FDF0D7A70E12D53200247964 /* CoreAudio.framework in Frameworks */,
FD5F9CEA0E0E0741008E885B /* CoreGraphics.framework in Frameworks */,
FA8B4BA51967071A00F8EB7C /* CoreMotion.framework in Frameworks */,
FD5F9CE80E0E0741008E885B /* Foundation.framework in Frameworks */,
FAE0E96D1BAF96AF0098DFA4 /* GameController.framework in Frameworks */,
F3F7590222AC5F3D001D97F2 /* Metal.framework in Frameworks */,
FD5F9CEB0E0E0741008E885B /* OpenGLES.framework in Frameworks */,
FD5F9CEC0E0E0741008E885B /* QuartzCore.framework in Frameworks */,
FD5F9CE80E0E0741008E885B /* Foundation.framework in Frameworks */,
FD5F9CE90E0E0741008E885B /* UIKit.framework in Frameworks */,
FD5F9CEA0E0E0741008E885B /* CoreGraphics.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -342,17 +379,18 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
FABA34DD1D8B5E8D00915323 /* AVFoundation.framework in Frameworks */,
FDB652000E43D1F300F688B5 /* libSDL2.a in Frameworks */,
FAE0E9711BAF96BB0098DFA4 /* GameController.framework in Frameworks */,
FDB652080E43D1F300F688B5 /* AudioToolbox.framework in Frameworks */,
FABA34DD1D8B5E8D00915323 /* AVFoundation.framework in Frameworks */,
FDB652070E43D1F300F688B5 /* CoreAudio.framework in Frameworks */,
FDB652040E43D1F300F688B5 /* CoreGraphics.framework in Frameworks */,
FA8B4BA91967073D00F8EB7C /* CoreMotion.framework in Frameworks */,
FDB652020E43D1F300F688B5 /* Foundation.framework in Frameworks */,
FDB652030E43D1F300F688B5 /* UIKit.framework in Frameworks */,
FDB652040E43D1F300F688B5 /* CoreGraphics.framework in Frameworks */,
FAE0E9711BAF96BB0098DFA4 /* GameController.framework in Frameworks */,
F3F7590622AC5FD1001D97F2 /* Metal.framework in Frameworks */,
FDB652050E43D1F300F688B5 /* OpenGLES.framework in Frameworks */,
FDB652060E43D1F300F688B5 /* QuartzCore.framework in Frameworks */,
FDB652070E43D1F300F688B5 /* CoreAudio.framework in Frameworks */,
FDB652080E43D1F300F688B5 /* AudioToolbox.framework in Frameworks */,
FDB652030E43D1F300F688B5 /* UIKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -360,17 +398,18 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
FABA34DA1D8B5E7F00915323 /* AVFoundation.framework in Frameworks */,
FD1B499E0E31326C007AB34E /* libSDL2.a in Frameworks */,
FAE0E96E1BAF96B10098DFA4 /* GameController.framework in Frameworks */,
FA8B4BA61967072100F8EB7C /* CoreMotion.framework in Frameworks */,
FDF0D7950E12D52900247964 /* CoreAudio.framework in Frameworks */,
FDF0D7960E12D52900247964 /* AudioToolbox.framework in Frameworks */,
FDC202E60E107B1200ABAC90 /* Foundation.framework in Frameworks */,
FDC202E70E107B1200ABAC90 /* UIKit.framework in Frameworks */,
FABA34DA1D8B5E7F00915323 /* AVFoundation.framework in Frameworks */,
FDF0D7950E12D52900247964 /* CoreAudio.framework in Frameworks */,
FDC202E80E107B1200ABAC90 /* CoreGraphics.framework in Frameworks */,
FA8B4BA61967072100F8EB7C /* CoreMotion.framework in Frameworks */,
FDC202E60E107B1200ABAC90 /* Foundation.framework in Frameworks */,
FAE0E96E1BAF96B10098DFA4 /* GameController.framework in Frameworks */,
F3F7590322AC5F71001D97F2 /* Metal.framework in Frameworks */,
FDC202E90E107B1200ABAC90 /* OpenGLES.framework in Frameworks */,
FDC202EA0E107B1200ABAC90 /* QuartzCore.framework in Frameworks */,
FDC202E70E107B1200ABAC90 /* UIKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -378,17 +417,18 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
FABA34DC1D8B5E8900915323 /* AVFoundation.framework in Frameworks */,
FD1B49A20E313273007AB34E /* libSDL2.a in Frameworks */,
FAE0E9701BAF96B80098DFA4 /* GameController.framework in Frameworks */,
FDC52EDA0E2843D6008D768C /* AudioToolbox.framework in Frameworks */,
FABA34DC1D8B5E8900915323 /* AVFoundation.framework in Frameworks */,
FDC52ED90E2843D6008D768C /* CoreAudio.framework in Frameworks */,
FDC52ED60E2843D6008D768C /* CoreGraphics.framework in Frameworks */,
FA8B4BA81967073400F8EB7C /* CoreMotion.framework in Frameworks */,
FDC52ED40E2843D6008D768C /* Foundation.framework in Frameworks */,
FDC52ED50E2843D6008D768C /* UIKit.framework in Frameworks */,
FDC52ED60E2843D6008D768C /* CoreGraphics.framework in Frameworks */,
FAE0E9701BAF96B80098DFA4 /* GameController.framework in Frameworks */,
F3F7590522AC5FB3001D97F2 /* Metal.framework in Frameworks */,
FDC52ED70E2843D6008D768C /* OpenGLES.framework in Frameworks */,
FDC52ED80E2843D6008D768C /* QuartzCore.framework in Frameworks */,
FDC52ED90E2843D6008D768C /* CoreAudio.framework in Frameworks */,
FDC52EDA0E2843D6008D768C /* AudioToolbox.framework in Frameworks */,
FDC52ED50E2843D6008D768C /* UIKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -396,17 +436,18 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
FABA34DB1D8B5E8500915323 /* AVFoundation.framework in Frameworks */,
FD1B49A00E313270007AB34E /* libSDL2.a in Frameworks */,
FAE0E96F1BAF96B50098DFA4 /* GameController.framework in Frameworks */,
FDF0D7230E12D31800247964 /* AudioToolbox.framework in Frameworks */,
FABA34DB1D8B5E8500915323 /* AVFoundation.framework in Frameworks */,
FDF0D71E0E12D2AB00247964 /* CoreAudio.framework in Frameworks */,
FDF0D69E0E12D05400247964 /* CoreGraphics.framework in Frameworks */,
FA8B4BA71967072800F8EB7C /* CoreMotion.framework in Frameworks */,
FDF0D69C0E12D05400247964 /* Foundation.framework in Frameworks */,
FDF0D69D0E12D05400247964 /* UIKit.framework in Frameworks */,
FDF0D69E0E12D05400247964 /* CoreGraphics.framework in Frameworks */,
FAE0E96F1BAF96B50098DFA4 /* GameController.framework in Frameworks */,
F3F7590422AC5F8D001D97F2 /* Metal.framework in Frameworks */,
FDF0D69F0E12D05400247964 /* OpenGLES.framework in Frameworks */,
FDF0D6A00E12D05400247964 /* QuartzCore.framework in Frameworks */,
FDF0D71E0E12D2AB00247964 /* CoreAudio.framework in Frameworks */,
FDF0D7230E12D31800247964 /* AudioToolbox.framework in Frameworks */,
FDF0D69D0E12D05400247964 /* UIKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -455,6 +496,7 @@
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
F3F758FF22AC5EC7001D97F2 /* Metal.framework */,
FABA34D71D8B5E7700915323 /* AVFoundation.framework */,
FABA34D31D8B5E5600915323 /* AVFoundation.framework */,
FAE0E9691BAF96A00098DFA4 /* GameController.framework */,
@ -474,7 +516,11 @@
isa = PBXGroup;
children = (
FD1B489E0E313154007AB34E /* libSDL2.a */,
F3F758F822AC5E8F001D97F2 /* libSDL2.dylib */,
FA30DEAC1BBF59D9009C397F /* libSDL2.a */,
F3F758FA22AC5E8F001D97F2 /* libSDL2.dylib */,
F3F758FC22AC5E8F001D97F2 /* libSDLmain.a */,
F3F758FE22AC5E8F001D97F2 /* libSDLmain.a */,
);
name = Products;
sourceTree = "<group>";
@ -725,6 +771,34 @@
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
F3F758F822AC5E8F001D97F2 /* libSDL2.dylib */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libSDL2.dylib;
remoteRef = F3F758F722AC5E8F001D97F2 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
F3F758FA22AC5E8F001D97F2 /* libSDL2.dylib */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libSDL2.dylib;
remoteRef = F3F758F922AC5E8F001D97F2 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
F3F758FC22AC5E8F001D97F2 /* libSDLmain.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libSDLmain.a;
remoteRef = F3F758FB22AC5E8F001D97F2 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
F3F758FE22AC5E8F001D97F2 /* libSDLmain.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libSDLmain.a;
remoteRef = F3F758FD22AC5E8F001D97F2 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
FA30DEAC1BBF59D9009C397F /* libSDL2.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
@ -957,6 +1031,7 @@
1D6058940D05DD3E006BFB54 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = Info.plist;
PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.Rectangles;
PRODUCT_NAME = Rectangles;
@ -966,6 +1041,7 @@
1D6058950D05DD3E006BFB54 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = Info.plist;
PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.Rectangles;
PRODUCT_NAME = Rectangles;
@ -975,6 +1051,7 @@
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_OPTIMIZATION_LEVEL = 0;
HEADER_SEARCH_PATHS = ../../include;
@ -988,6 +1065,7 @@
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
HEADER_SEARCH_PATHS = ../../include;
PRELINK_LIBS = "";
@ -1087,6 +1165,7 @@
FD15FCB50E086866003BDF25 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
DEVELOPMENT_TEAM = "";
GCC_DYNAMIC_NO_PIC = NO;
INFOPLIST_FILE = Info.plist;
PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.Happy;
@ -1098,6 +1177,7 @@
FD15FCB60E086866003BDF25 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = Info.plist;
PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.Happy;
PRODUCT_NAME = Happy;
@ -1108,6 +1188,7 @@
FD5F9BE70E0DEBEB008E885B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = Info.plist;
PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.Accel;
PRODUCT_NAME = Accel;
@ -1118,6 +1199,7 @@
FD5F9BE80E0DEBEB008E885B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = Info.plist;
PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.Accel;
PRODUCT_NAME = Accel;
@ -1128,6 +1210,7 @@
FDB6520A0E43D1F300F688B5 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = Info.plist;
PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.Keyboard;
PRODUCT_NAME = Keyboard;
@ -1138,6 +1221,7 @@
FDB6520B0E43D1F300F688B5 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = Info.plist;
PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.Keyboard;
PRODUCT_NAME = Keyboard;
@ -1148,6 +1232,7 @@
FDC202EC0E107B1200ABAC90 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = Info.plist;
PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.Touch;
PRODUCT_NAME = Touch;
@ -1158,6 +1243,7 @@
FDC202ED0E107B1200ABAC90 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = Info.plist;
PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.Touch;
PRODUCT_NAME = Touch;
@ -1192,6 +1278,7 @@
FDF0D6A20E12D05400247964 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = Info.plist;
PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.Mixer;
PRODUCT_NAME = Mixer;
@ -1202,6 +1289,7 @@
FDF0D6A30E12D05400247964 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = Info.plist;
PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.Mixer;
PRODUCT_NAME = Mixer;

0
Xcode-iOS/Demos/data/bitmapfont/license.txt Executable file → Normal file
View file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C143576D1F4C4DAA000B792B"
BuildableName = "All-iOS"
BlueprintName = "All-iOS"
ReferencedContainer = "container:SDL.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C143576D1F4C4DAA000B792B"
BuildableName = "All-iOS"
BlueprintName = "All-iOS"
ReferencedContainer = "container:SDL.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C143576D1F4C4DAA000B792B"
BuildableName = "All-iOS"
BlueprintName = "All-iOS"
ReferencedContainer = "container:SDL.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View file

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C14357721F4C4F2A000B792B"
BuildableName = "All-tvOS"
BlueprintName = "All-tvOS"
ReferencedContainer = "container:SDL.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C14357721F4C4F2A000B792B"
BuildableName = "All-tvOS"
BlueprintName = "All-tvOS"
ReferencedContainer = "container:SDL.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C14357721F4C4F2A000B792B"
BuildableName = "All-tvOS"
BlueprintName = "All-tvOS"
ReferencedContainer = "container:SDL.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View file

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "00B4F48B12F6A69C0084EC00"
BuildableName = "PrepareXcodeProjectTemplate"
BlueprintName = "PrepareXcodeProjectTemplate"
ReferencedContainer = "container:SDL.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "00B4F48B12F6A69C0084EC00"
BuildableName = "PrepareXcodeProjectTemplate"
BlueprintName = "PrepareXcodeProjectTemplate"
ReferencedContainer = "container:SDL.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "00B4F48B12F6A69C0084EC00"
BuildableName = "PrepareXcodeProjectTemplate"
BlueprintName = "PrepareXcodeProjectTemplate"
ReferencedContainer = "container:SDL.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View file

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "52ED1D6B222889500061FCE0"
BuildableName = "libSDL2.dylib"
BlueprintName = "libSDL-iOS-dylib"
ReferencedContainer = "container:SDL.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "52ED1D6B222889500061FCE0"
BuildableName = "libSDL2.dylib"
BlueprintName = "libSDL-iOS-dylib"
ReferencedContainer = "container:SDL.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "52ED1D6B222889500061FCE0"
BuildableName = "libSDL2.dylib"
BlueprintName = "libSDL-iOS-dylib"
ReferencedContainer = "container:SDL.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View file

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FD6526620DE8FCCB002AD96B"
BuildableName = "libSDL2.a"
BlueprintName = "libSDL-iOS"
ReferencedContainer = "container:SDL.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FD6526620DE8FCCB002AD96B"
BuildableName = "libSDL2.a"
BlueprintName = "libSDL-iOS"
ReferencedContainer = "container:SDL.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FD6526620DE8FCCB002AD96B"
BuildableName = "libSDL2.a"
BlueprintName = "libSDL-iOS"
ReferencedContainer = "container:SDL.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View file

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F3E3C6592241389A007D243C"
BuildableName = "libSDL2.dylib"
BlueprintName = "libSDL-tvOS-dylib"
ReferencedContainer = "container:SDL.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F3E3C6592241389A007D243C"
BuildableName = "libSDL2.dylib"
BlueprintName = "libSDL-tvOS-dylib"
ReferencedContainer = "container:SDL.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F3E3C6592241389A007D243C"
BuildableName = "libSDL2.dylib"
BlueprintName = "libSDL-tvOS-dylib"
ReferencedContainer = "container:SDL.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View file

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FAB598131BB5C1B100BE72C5"
BuildableName = "libSDL2.a"
BlueprintName = "libSDL-tvOS"
ReferencedContainer = "container:SDL.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FAB598131BB5C1B100BE72C5"
BuildableName = "libSDL2.a"
BlueprintName = "libSDL-tvOS"
ReferencedContainer = "container:SDL.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FAB598131BB5C1B100BE72C5"
BuildableName = "libSDL2.a"
BlueprintName = "libSDL-tvOS"
ReferencedContainer = "container:SDL.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View file

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F3E3C56022406928007D243C"
BuildableName = "libSDLmain.a"
BlueprintName = "libSDLmain-iOS"
ReferencedContainer = "container:SDL.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F3E3C56022406928007D243C"
BuildableName = "libSDLmain.a"
BlueprintName = "libSDLmain-iOS"
ReferencedContainer = "container:SDL.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F3E3C56022406928007D243C"
BuildableName = "libSDLmain.a"
BlueprintName = "libSDLmain-iOS"
ReferencedContainer = "container:SDL.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View file

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F3E3C758224138AE007D243C"
BuildableName = "libSDLmain.a"
BlueprintName = "libSDLmain-tvOS"
ReferencedContainer = "container:SDL.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F3E3C758224138AE007D243C"
BuildableName = "libSDLmain.a"
BlueprintName = "libSDLmain-tvOS"
ReferencedContainer = "container:SDL.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F3E3C758224138AE007D243C"
BuildableName = "libSDLmain.a"
BlueprintName = "libSDLmain-tvOS"
ReferencedContainer = "container:SDL.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View file

@ -53,22 +53,22 @@
/* Begin PBXFileReference section */
AA1EE4461760589B0029C7A5 /* libSDL2test.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSDL2test.a; sourceTree = BUILT_PRODUCTS_DIR; };
AA1EE454176059AB0029C7A5 /* SDL_test_common.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_common.c; path = ../../src/test/SDL_test_common.c; sourceTree = "<group>"; };
AA1EE455176059AB0029C7A5 /* SDL_test_compare.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_compare.c; path = ../../src/test/SDL_test_compare.c; sourceTree = "<group>"; };
AA1EE456176059AB0029C7A5 /* SDL_test_crc32.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_crc32.c; path = ../../src/test/SDL_test_crc32.c; sourceTree = "<group>"; };
AA1EE457176059AB0029C7A5 /* SDL_test_font.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_font.c; path = ../../src/test/SDL_test_font.c; sourceTree = "<group>"; };
AA1EE458176059AB0029C7A5 /* SDL_test_fuzzer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_fuzzer.c; path = ../../src/test/SDL_test_fuzzer.c; sourceTree = "<group>"; };
AA1EE459176059AB0029C7A5 /* SDL_test_harness.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_harness.c; path = ../../src/test/SDL_test_harness.c; sourceTree = "<group>"; };
AA1EE45A176059AB0029C7A5 /* SDL_test_imageBlit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imageBlit.c; path = ../../src/test/SDL_test_imageBlit.c; sourceTree = "<group>"; };
AA1EE45B176059AB0029C7A5 /* SDL_test_imageBlitBlend.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imageBlitBlend.c; path = ../../src/test/SDL_test_imageBlitBlend.c; sourceTree = "<group>"; };
AA1EE45C176059AB0029C7A5 /* SDL_test_imageFace.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imageFace.c; path = ../../src/test/SDL_test_imageFace.c; sourceTree = "<group>"; };
AA1EE45D176059AB0029C7A5 /* SDL_test_imagePrimitives.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imagePrimitives.c; path = ../../src/test/SDL_test_imagePrimitives.c; sourceTree = "<group>"; };
AA1EE45E176059AB0029C7A5 /* SDL_test_imagePrimitivesBlend.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imagePrimitivesBlend.c; path = ../../src/test/SDL_test_imagePrimitivesBlend.c; sourceTree = "<group>"; };
AA1EE45F176059AB0029C7A5 /* SDL_test_log.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_log.c; path = ../../src/test/SDL_test_log.c; sourceTree = "<group>"; };
AA1EE460176059AB0029C7A5 /* SDL_test_md5.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_md5.c; path = ../../src/test/SDL_test_md5.c; sourceTree = "<group>"; };
AA1EE461176059AB0029C7A5 /* SDL_test_random.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_random.c; path = ../../src/test/SDL_test_random.c; sourceTree = "<group>"; };
AAF02FFF1F9009B100B9A9FB /* SDL_test_memory.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_memory.c; path = ../../src/test/SDL_test_memory.c; sourceTree = "<group>"; };
AAF030001F9009B100B9A9FB /* SDL_test_assert.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_assert.c; path = ../../src/test/SDL_test_assert.c; sourceTree = "<group>"; };
AA1EE454176059AB0029C7A5 /* SDL_test_common.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_common.c; sourceTree = "<group>"; };
AA1EE455176059AB0029C7A5 /* SDL_test_compare.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_compare.c; sourceTree = "<group>"; };
AA1EE456176059AB0029C7A5 /* SDL_test_crc32.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_crc32.c; sourceTree = "<group>"; };
AA1EE457176059AB0029C7A5 /* SDL_test_font.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_font.c; sourceTree = "<group>"; };
AA1EE458176059AB0029C7A5 /* SDL_test_fuzzer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_fuzzer.c; sourceTree = "<group>"; };
AA1EE459176059AB0029C7A5 /* SDL_test_harness.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_harness.c; sourceTree = "<group>"; };
AA1EE45A176059AB0029C7A5 /* SDL_test_imageBlit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_imageBlit.c; sourceTree = "<group>"; };
AA1EE45B176059AB0029C7A5 /* SDL_test_imageBlitBlend.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_imageBlitBlend.c; sourceTree = "<group>"; };
AA1EE45C176059AB0029C7A5 /* SDL_test_imageFace.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_imageFace.c; sourceTree = "<group>"; };
AA1EE45D176059AB0029C7A5 /* SDL_test_imagePrimitives.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_imagePrimitives.c; sourceTree = "<group>"; };
AA1EE45E176059AB0029C7A5 /* SDL_test_imagePrimitivesBlend.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_imagePrimitivesBlend.c; sourceTree = "<group>"; };
AA1EE45F176059AB0029C7A5 /* SDL_test_log.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_log.c; sourceTree = "<group>"; };
AA1EE460176059AB0029C7A5 /* SDL_test_md5.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_md5.c; sourceTree = "<group>"; };
AA1EE461176059AB0029C7A5 /* SDL_test_random.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_random.c; sourceTree = "<group>"; };
AAF02FFF1F9009B100B9A9FB /* SDL_test_memory.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_memory.c; sourceTree = "<group>"; };
AAF030001F9009B100B9A9FB /* SDL_test_assert.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_assert.c; sourceTree = "<group>"; };
FA3D98F81BC4E5A2002C96C8 /* libSDL2test-TV.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libSDL2test-TV.a"; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
@ -128,6 +128,7 @@
AA1EE461176059AB0029C7A5 /* SDL_test_random.c */,
);
name = "Library Source";
path = ../../src/test;
sourceTree = "<group>";
};
/* End PBXGroup section */

View file

@ -11,7 +11,7 @@
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.yourcompany.${PRODUCT_NAME:identifier}</string>
<string>com.yourcompany.${PRODUCT_NAME}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>

609
Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj Executable file → Normal file

File diff suppressed because it is too large Load diff

View file

@ -19,10 +19,10 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.0.8</string>
<string>2.0.12</string>
<key>CFBundleSignature</key>
<string>SDLX</string>
<key>CFBundleVersion</key>
<string>2.0.8</string>
<string>2.0.12</string>
</dict>
</plist>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
</dict>
</plist>

0
Xcode/SDL/pkg-support/SDL.info Executable file → Normal file
View file

View file

@ -1,6 +1,6 @@
Simple DirectMedia Layer
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages

0
Xcode/SDL/pkg-support/resources/ReadMe.txt Executable file → Normal file
View file

161
Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj Executable file → Normal file
View file

@ -1134,36 +1134,36 @@
/* Begin PBXFileReference section */
0017958C10741F7900F5D044 /* testatomic */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testatomic; sourceTree = BUILT_PRODUCTS_DIR; };
0017958F1074216E00F5D044 /* testatomic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testatomic.c; path = ../../test/testatomic.c; sourceTree = SOURCE_ROOT; };
0017958F1074216E00F5D044 /* testatomic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testatomic.c; sourceTree = "<group>"; };
001795AD107421BF00F5D044 /* testaudioinfo */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testaudioinfo; sourceTree = BUILT_PRODUCTS_DIR; };
001795B01074222D00F5D044 /* testaudioinfo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testaudioinfo.c; path = ../../test/testaudioinfo.c; sourceTree = SOURCE_ROOT; };
001795B01074222D00F5D044 /* testaudioinfo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testaudioinfo.c; sourceTree = "<group>"; };
0017972110742F3200F5D044 /* testgl2 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testgl2; sourceTree = BUILT_PRODUCTS_DIR; };
0017972710742FB900F5D044 /* testgl2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testgl2.c; path = ../../test/testgl2.c; sourceTree = SOURCE_ROOT; };
0017972710742FB900F5D044 /* testgl2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testgl2.c; sourceTree = "<group>"; };
00179748107430D600F5D044 /* testhaptic */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testhaptic; sourceTree = BUILT_PRODUCTS_DIR; };
0017974E1074315700F5D044 /* testhaptic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testhaptic.c; path = ../../test/testhaptic.c; sourceTree = SOURCE_ROOT; };
0017974E1074315700F5D044 /* testhaptic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testhaptic.c; sourceTree = "<group>"; };
0017976E107431B300F5D044 /* testdraw2 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testdraw2; sourceTree = BUILT_PRODUCTS_DIR; };
001797711074320D00F5D044 /* testdraw2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testdraw2.c; path = ../../test/testdraw2.c; sourceTree = SOURCE_ROOT; };
001797711074320D00F5D044 /* testdraw2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testdraw2.c; sourceTree = "<group>"; };
0017978E107432AE00F5D044 /* testime */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testime; sourceTree = BUILT_PRODUCTS_DIR; };
00179791107432FA00F5D044 /* testime.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testime.c; path = ../../test/testime.c; sourceTree = SOURCE_ROOT; };
00179791107432FA00F5D044 /* testime.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testime.c; sourceTree = "<group>"; };
001797AE1074334C00F5D044 /* testintersections */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testintersections; sourceTree = BUILT_PRODUCTS_DIR; };
001797B31074339C00F5D044 /* testintersections.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testintersections.c; path = ../../test/testintersections.c; sourceTree = SOURCE_ROOT; };
001797B31074339C00F5D044 /* testintersections.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testintersections.c; sourceTree = "<group>"; };
001797D0107433C600F5D044 /* testloadso */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testloadso; sourceTree = BUILT_PRODUCTS_DIR; };
001797D31074343E00F5D044 /* testloadso.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testloadso.c; path = ../../test/testloadso.c; sourceTree = SOURCE_ROOT; };
001797D31074343E00F5D044 /* testloadso.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testloadso.c; sourceTree = "<group>"; };
001798121074355200F5D044 /* testmultiaudio */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testmultiaudio; sourceTree = BUILT_PRODUCTS_DIR; };
001798151074359B00F5D044 /* testmultiaudio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testmultiaudio.c; path = ../../test/testmultiaudio.c; sourceTree = SOURCE_ROOT; };
0017985A107436ED00F5D044 /* testnative.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testnative.c; path = ../../test/testnative.c; sourceTree = SOURCE_ROOT; };
0017985B107436ED00F5D044 /* testnative.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = testnative.h; path = ../../test/testnative.h; sourceTree = SOURCE_ROOT; };
0017985C107436ED00F5D044 /* testnativecocoa.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = testnativecocoa.m; path = ../../test/testnativecocoa.m; sourceTree = SOURCE_ROOT; };
00179872107438D000F5D044 /* testnativex11.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testnativex11.c; path = ../../test/testnativex11.c; sourceTree = SOURCE_ROOT; };
001798151074359B00F5D044 /* testmultiaudio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testmultiaudio.c; sourceTree = "<group>"; };
0017985A107436ED00F5D044 /* testnative.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testnative.c; sourceTree = "<group>"; };
0017985B107436ED00F5D044 /* testnative.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = testnative.h; sourceTree = "<group>"; };
0017985C107436ED00F5D044 /* testnativecocoa.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = testnativecocoa.m; sourceTree = "<group>"; };
00179872107438D000F5D044 /* testnativex11.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testnativex11.c; sourceTree = "<group>"; };
001798941074392D00F5D044 /* testnative */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testnative; sourceTree = BUILT_PRODUCTS_DIR; };
001798B5107439DF00F5D044 /* testpower */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testpower; sourceTree = BUILT_PRODUCTS_DIR; };
001798B910743A4900F5D044 /* testpower.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testpower.c; path = ../../test/testpower.c; sourceTree = SOURCE_ROOT; };
001798B910743A4900F5D044 /* testpower.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testpower.c; sourceTree = "<group>"; };
001798F210743BEC00F5D044 /* testresample */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testresample; sourceTree = BUILT_PRODUCTS_DIR; };
001798F910743E9200F5D044 /* testresample.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testresample.c; path = ../../test/testresample.c; sourceTree = SOURCE_ROOT; };
001798F910743E9200F5D044 /* testresample.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testresample.c; sourceTree = "<group>"; };
0017991610743F1000F5D044 /* testsprite2 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testsprite2; sourceTree = BUILT_PRODUCTS_DIR; };
0017991910743F5300F5D044 /* testsprite2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testsprite2.c; path = ../../test/testsprite2.c; sourceTree = SOURCE_ROOT; };
0017991910743F5300F5D044 /* testsprite2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testsprite2.c; sourceTree = "<group>"; };
0017993810743FB700F5D044 /* testwm2 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testwm2; sourceTree = BUILT_PRODUCTS_DIR; };
0017993B10743FEF00F5D044 /* testwm2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testwm2.c; path = ../../test/testwm2.c; sourceTree = SOURCE_ROOT; };
0017993B10743FEF00F5D044 /* testwm2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testwm2.c; sourceTree = "<group>"; };
002A863B10730545007319AE /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = "<absolute>"; };
002A863C10730545007319AE /* ForceFeedback.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ForceFeedback.framework; path = /System/Library/Frameworks/ForceFeedback.framework; sourceTree = "<absolute>"; };
002A863D10730545007319AE /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; };
@ -1173,37 +1173,37 @@
002A873910730675007319AE /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
002F33A709CA188600EBEB88 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
002F341209CA1BFF00EBEB88 /* testfile */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testfile; sourceTree = BUILT_PRODUCTS_DIR; };
002F341709CA1C5B00EBEB88 /* testfile.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testfile.c; path = ../../test/testfile.c; sourceTree = SOURCE_ROOT; };
002F341709CA1C5B00EBEB88 /* testfile.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = testfile.c; sourceTree = "<group>"; };
002F343109CA1F0300EBEB88 /* testiconv */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testiconv; sourceTree = BUILT_PRODUCTS_DIR; };
002F343609CA1F6F00EBEB88 /* testiconv.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testiconv.c; path = ../../test/testiconv.c; sourceTree = SOURCE_ROOT; };
002F343609CA1F6F00EBEB88 /* testiconv.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = testiconv.c; sourceTree = "<group>"; };
002F344D09CA1FB300EBEB88 /* testoverlay2 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testoverlay2; sourceTree = BUILT_PRODUCTS_DIR; };
002F345209CA201C00EBEB88 /* testoverlay2.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testoverlay2.c; path = ../../test/testoverlay2.c; sourceTree = SOURCE_ROOT; };
002F345209CA201C00EBEB88 /* testoverlay2.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = testoverlay2.c; sourceTree = "<group>"; };
002F346A09CA204F00EBEB88 /* testplatform */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testplatform; sourceTree = BUILT_PRODUCTS_DIR; };
002F346F09CA20A600EBEB88 /* testplatform.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testplatform.c; path = ../../test/testplatform.c; sourceTree = SOURCE_ROOT; };
002F346F09CA20A600EBEB88 /* testplatform.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = testplatform.c; sourceTree = "<group>"; };
003FA63A093FFD41000C53B3 /* SDL.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDL.xcodeproj; path = ../SDL/SDL.xcodeproj; sourceTree = SOURCE_ROOT; };
00794E5D09D20839003FC8A1 /* icon.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = icon.bmp; path = ../../test/icon.bmp; sourceTree = SOURCE_ROOT; };
00794E5E09D20839003FC8A1 /* moose.dat */ = {isa = PBXFileReference; lastKnownFileType = file; name = moose.dat; path = ../../test/moose.dat; sourceTree = SOURCE_ROOT; };
00794E5F09D20839003FC8A1 /* picture.xbm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = picture.xbm; path = ../../test/picture.xbm; sourceTree = SOURCE_ROOT; };
00794E6109D20839003FC8A1 /* sample.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = sample.bmp; path = ../../test/sample.bmp; sourceTree = SOURCE_ROOT; };
00794E6209D20839003FC8A1 /* sample.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = sample.wav; path = ../../test/sample.wav; sourceTree = SOURCE_ROOT; };
00794E6309D20839003FC8A1 /* utf8.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = utf8.txt; path = ../../test/utf8.txt; sourceTree = SOURCE_ROOT; };
083E4872006D84C97F000001 /* loopwave.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = loopwave.c; path = ../../test/loopwave.c; sourceTree = SOURCE_ROOT; };
083E4878006D85357F000001 /* testerror.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testerror.c; path = ../../test/testerror.c; sourceTree = SOURCE_ROOT; };
083E487E006D86A17F000001 /* testsem.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testsem.c; path = ../../test/testsem.c; sourceTree = SOURCE_ROOT; };
083E4880006D86A17F000001 /* testtimer.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testtimer.c; path = ../../test/testtimer.c; sourceTree = SOURCE_ROOT; };
083E4882006D86A17F000001 /* testver.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testver.c; path = ../../test/testver.c; sourceTree = SOURCE_ROOT; };
083E4887006D86A17F000001 /* torturethread.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = torturethread.c; path = ../../test/torturethread.c; sourceTree = SOURCE_ROOT; };
092D6D10FFB30A2C7F000001 /* checkkeys.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = checkkeys.c; path = ../../test/checkkeys.c; sourceTree = SOURCE_ROOT; };
092D6D58FFB311A97F000001 /* testthread.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testthread.c; path = ../../test/testthread.c; sourceTree = SOURCE_ROOT; };
092D6D62FFB312AA7F000001 /* testjoystick.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testjoystick.c; path = ../../test/testjoystick.c; sourceTree = SOURCE_ROOT; };
092D6D6CFFB313437F000001 /* testkeys.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testkeys.c; path = ../../test/testkeys.c; sourceTree = SOURCE_ROOT; };
092D6D75FFB313BB7F000001 /* testlock.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testlock.c; path = ../../test/testlock.c; sourceTree = SOURCE_ROOT; };
00794E5D09D20839003FC8A1 /* icon.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = icon.bmp; sourceTree = "<group>"; };
00794E5E09D20839003FC8A1 /* moose.dat */ = {isa = PBXFileReference; lastKnownFileType = file; path = moose.dat; sourceTree = "<group>"; };
00794E5F09D20839003FC8A1 /* picture.xbm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = picture.xbm; sourceTree = "<group>"; };
00794E6109D20839003FC8A1 /* sample.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = sample.bmp; sourceTree = "<group>"; };
00794E6209D20839003FC8A1 /* sample.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = sample.wav; sourceTree = "<group>"; };
00794E6309D20839003FC8A1 /* utf8.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = utf8.txt; sourceTree = "<group>"; };
083E4872006D84C97F000001 /* loopwave.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = loopwave.c; sourceTree = "<group>"; };
083E4878006D85357F000001 /* testerror.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = testerror.c; sourceTree = "<group>"; };
083E487E006D86A17F000001 /* testsem.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = testsem.c; sourceTree = "<group>"; };
083E4880006D86A17F000001 /* testtimer.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = testtimer.c; sourceTree = "<group>"; };
083E4882006D86A17F000001 /* testver.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = testver.c; sourceTree = "<group>"; };
083E4887006D86A17F000001 /* torturethread.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = torturethread.c; sourceTree = "<group>"; };
092D6D10FFB30A2C7F000001 /* checkkeys.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = checkkeys.c; sourceTree = "<group>"; };
092D6D58FFB311A97F000001 /* testthread.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = testthread.c; sourceTree = "<group>"; };
092D6D62FFB312AA7F000001 /* testjoystick.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = testjoystick.c; sourceTree = "<group>"; };
092D6D6CFFB313437F000001 /* testkeys.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = testkeys.c; sourceTree = "<group>"; };
092D6D75FFB313BB7F000001 /* testlock.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = testlock.c; sourceTree = "<group>"; };
4537749212091504002F0F45 /* testshape */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testshape; sourceTree = BUILT_PRODUCTS_DIR; };
453774A4120915E3002F0F45 /* testshape.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testshape.c; path = ../../test/testshape.c; sourceTree = SOURCE_ROOT; };
453774A4120915E3002F0F45 /* testshape.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testshape.c; sourceTree = "<group>"; };
66E88E5B203B733C0004D44E /* Metal.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Metal.framework; path = System/Library/Frameworks/Metal.framework; sourceTree = SDKROOT; };
66E88E8A203B778F0004D44E /* testyuv_cvt.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = testyuv_cvt.c; path = ../../test/testyuv_cvt.c; sourceTree = "<group>"; };
AAF02FF41F90089800B9A9FB /* SDL_test_memory.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_memory.c; path = ../../src/test/SDL_test_memory.c; sourceTree = "<group>"; };
BBFC088E164C6820003E6A99 /* testgamecontroller.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testgamecontroller.c; path = ../../test/testgamecontroller.c; sourceTree = "<group>"; };
66E88E8A203B778F0004D44E /* testyuv_cvt.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = testyuv_cvt.c; sourceTree = "<group>"; };
AAF02FF41F90089800B9A9FB /* SDL_test_memory.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_memory.c; sourceTree = "<group>"; };
BBFC088E164C6820003E6A99 /* testgamecontroller.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testgamecontroller.c; sourceTree = "<group>"; };
BBFC08CD164C6862003E6A99 /* testgamecontroller */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testgamecontroller; sourceTree = BUILT_PRODUCTS_DIR; };
BEC566B60761D90300A33029 /* checkkeys */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = checkkeys; sourceTree = BUILT_PRODUCTS_DIR; };
BEC566D10761D90300A33029 /* loopwave */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = loopwave; sourceTree = BUILT_PRODUCTS_DIR; };
@ -1216,37 +1216,37 @@
BEC567980761D90500A33029 /* testtimer */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testtimer; sourceTree = BUILT_PRODUCTS_DIR; };
BEC567B20761D90500A33029 /* testversion */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testversion; sourceTree = BUILT_PRODUCTS_DIR; };
BEC567F50761D90600A33029 /* torturethread */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = torturethread; sourceTree = BUILT_PRODUCTS_DIR; };
DB0F48D717CA51D2008798C5 /* testdrawchessboard.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = testdrawchessboard.c; path = ../../test/testdrawchessboard.c; sourceTree = "<group>"; };
DB0F48D817CA51D2008798C5 /* testfilesystem.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = testfilesystem.c; path = ../../test/testfilesystem.c; sourceTree = "<group>"; };
DB0F48D717CA51D2008798C5 /* testdrawchessboard.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = testdrawchessboard.c; sourceTree = "<group>"; };
DB0F48D817CA51D2008798C5 /* testfilesystem.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = testfilesystem.c; sourceTree = "<group>"; };
DB0F48EC17CA51E5008798C5 /* testdrawchessboard */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testdrawchessboard; sourceTree = BUILT_PRODUCTS_DIR; };
DB0F490117CA5212008798C5 /* testfilesystem */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testfilesystem; sourceTree = BUILT_PRODUCTS_DIR; };
DB166CBB16A1C74100A1396C /* testgesture.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = testgesture.c; path = ../../test/testgesture.c; sourceTree = "<group>"; };
DB166CBC16A1C74100A1396C /* testgles.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = testgles.c; path = ../../test/testgles.c; sourceTree = "<group>"; };
DB166CBD16A1C74100A1396C /* testmessage.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = testmessage.c; path = ../../test/testmessage.c; sourceTree = "<group>"; };
DB166CBF16A1C74100A1396C /* testrelative.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = testrelative.c; path = ../../test/testrelative.c; sourceTree = "<group>"; };
DB166CC016A1C74100A1396C /* testrendercopyex.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = testrendercopyex.c; path = ../../test/testrendercopyex.c; sourceTree = "<group>"; };
DB166CC116A1C74100A1396C /* testrendertarget.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = testrendertarget.c; path = ../../test/testrendertarget.c; sourceTree = "<group>"; };
DB166CC216A1C74100A1396C /* testrumble.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = testrumble.c; path = ../../test/testrumble.c; sourceTree = "<group>"; };
DB166CC316A1C74100A1396C /* testscale.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = testscale.c; path = ../../test/testscale.c; sourceTree = "<group>"; };
DB166CC416A1C74100A1396C /* testshader.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = testshader.c; path = ../../test/testshader.c; sourceTree = "<group>"; };
DB166CC516A1C74100A1396C /* testspriteminimal.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = testspriteminimal.c; path = ../../test/testspriteminimal.c; sourceTree = "<group>"; };
DB166CC616A1C74100A1396C /* teststreaming.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = teststreaming.c; path = ../../test/teststreaming.c; sourceTree = "<group>"; };
DB166CBB16A1C74100A1396C /* testgesture.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = testgesture.c; sourceTree = "<group>"; };
DB166CBC16A1C74100A1396C /* testgles.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = testgles.c; sourceTree = "<group>"; };
DB166CBD16A1C74100A1396C /* testmessage.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = testmessage.c; sourceTree = "<group>"; };
DB166CBF16A1C74100A1396C /* testrelative.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = testrelative.c; sourceTree = "<group>"; };
DB166CC016A1C74100A1396C /* testrendercopyex.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = testrendercopyex.c; sourceTree = "<group>"; };
DB166CC116A1C74100A1396C /* testrendertarget.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = testrendertarget.c; sourceTree = "<group>"; };
DB166CC216A1C74100A1396C /* testrumble.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = testrumble.c; sourceTree = "<group>"; };
DB166CC316A1C74100A1396C /* testscale.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = testscale.c; sourceTree = "<group>"; };
DB166CC416A1C74100A1396C /* testshader.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = testshader.c; sourceTree = "<group>"; };
DB166CC516A1C74100A1396C /* testspriteminimal.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = testspriteminimal.c; sourceTree = "<group>"; };
DB166CC616A1C74100A1396C /* teststreaming.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = teststreaming.c; sourceTree = "<group>"; };
DB166D7F16A1D12400A1396C /* libSDL_test.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSDL_test.a; sourceTree = BUILT_PRODUCTS_DIR; };
DB166D8416A1D1A500A1396C /* SDL_test_assert.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_assert.c; path = ../../src/test/SDL_test_assert.c; sourceTree = "<group>"; };
DB166D8516A1D1A500A1396C /* SDL_test_common.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_common.c; path = ../../src/test/SDL_test_common.c; sourceTree = "<group>"; };
DB166D8616A1D1A500A1396C /* SDL_test_compare.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_compare.c; path = ../../src/test/SDL_test_compare.c; sourceTree = "<group>"; };
DB166D8716A1D1A500A1396C /* SDL_test_crc32.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_crc32.c; path = ../../src/test/SDL_test_crc32.c; sourceTree = "<group>"; };
DB166D8816A1D1A500A1396C /* SDL_test_font.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_font.c; path = ../../src/test/SDL_test_font.c; sourceTree = "<group>"; };
DB166D8916A1D1A500A1396C /* SDL_test_fuzzer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_fuzzer.c; path = ../../src/test/SDL_test_fuzzer.c; sourceTree = "<group>"; };
DB166D8A16A1D1A500A1396C /* SDL_test_harness.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_harness.c; path = ../../src/test/SDL_test_harness.c; sourceTree = "<group>"; };
DB166D8B16A1D1A500A1396C /* SDL_test_imageBlit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imageBlit.c; path = ../../src/test/SDL_test_imageBlit.c; sourceTree = "<group>"; };
DB166D8C16A1D1A500A1396C /* SDL_test_imageBlitBlend.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imageBlitBlend.c; path = ../../src/test/SDL_test_imageBlitBlend.c; sourceTree = "<group>"; };
DB166D8D16A1D1A500A1396C /* SDL_test_imageFace.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imageFace.c; path = ../../src/test/SDL_test_imageFace.c; sourceTree = "<group>"; };
DB166D8E16A1D1A500A1396C /* SDL_test_imagePrimitives.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imagePrimitives.c; path = ../../src/test/SDL_test_imagePrimitives.c; sourceTree = "<group>"; };
DB166D8F16A1D1A500A1396C /* SDL_test_imagePrimitivesBlend.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imagePrimitivesBlend.c; path = ../../src/test/SDL_test_imagePrimitivesBlend.c; sourceTree = "<group>"; };
DB166D9016A1D1A500A1396C /* SDL_test_log.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_log.c; path = ../../src/test/SDL_test_log.c; sourceTree = "<group>"; };
DB166D9116A1D1A500A1396C /* SDL_test_md5.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_md5.c; path = ../../src/test/SDL_test_md5.c; sourceTree = "<group>"; };
DB166D9216A1D1A500A1396C /* SDL_test_random.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_random.c; path = ../../src/test/SDL_test_random.c; sourceTree = "<group>"; };
DB166D8416A1D1A500A1396C /* SDL_test_assert.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_assert.c; sourceTree = "<group>"; };
DB166D8516A1D1A500A1396C /* SDL_test_common.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_common.c; sourceTree = "<group>"; };
DB166D8616A1D1A500A1396C /* SDL_test_compare.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_compare.c; sourceTree = "<group>"; };
DB166D8716A1D1A500A1396C /* SDL_test_crc32.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_crc32.c; sourceTree = "<group>"; };
DB166D8816A1D1A500A1396C /* SDL_test_font.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_font.c; sourceTree = "<group>"; };
DB166D8916A1D1A500A1396C /* SDL_test_fuzzer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_fuzzer.c; sourceTree = "<group>"; };
DB166D8A16A1D1A500A1396C /* SDL_test_harness.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_harness.c; sourceTree = "<group>"; };
DB166D8B16A1D1A500A1396C /* SDL_test_imageBlit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_imageBlit.c; sourceTree = "<group>"; };
DB166D8C16A1D1A500A1396C /* SDL_test_imageBlitBlend.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_imageBlitBlend.c; sourceTree = "<group>"; };
DB166D8D16A1D1A500A1396C /* SDL_test_imageFace.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_imageFace.c; sourceTree = "<group>"; };
DB166D8E16A1D1A500A1396C /* SDL_test_imagePrimitives.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_imagePrimitives.c; sourceTree = "<group>"; };
DB166D8F16A1D1A500A1396C /* SDL_test_imagePrimitivesBlend.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_imagePrimitivesBlend.c; sourceTree = "<group>"; };
DB166D9016A1D1A500A1396C /* SDL_test_log.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_log.c; sourceTree = "<group>"; };
DB166D9116A1D1A500A1396C /* SDL_test_md5.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_md5.c; sourceTree = "<group>"; };
DB166D9216A1D1A500A1396C /* SDL_test_random.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_random.c; sourceTree = "<group>"; };
DB166DBF16A1D2F600A1396C /* testgesture */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testgesture; sourceTree = BUILT_PRODUCTS_DIR; };
DB166DD516A1D36A00A1396C /* testmessage */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testmessage; sourceTree = BUILT_PRODUCTS_DIR; };
DB166DEE16A1D50C00A1396C /* testrelative */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testrelative; sourceTree = BUILT_PRODUCTS_DIR; };
@ -1257,16 +1257,16 @@
DB166E6816A1D6F300A1396C /* testshader */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testshader; sourceTree = BUILT_PRODUCTS_DIR; };
DB166E7E16A1D78400A1396C /* testspriteminimal */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testspriteminimal; sourceTree = BUILT_PRODUCTS_DIR; };
DB166E9116A1D78C00A1396C /* teststreaming */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = teststreaming; sourceTree = BUILT_PRODUCTS_DIR; };
DB166ECF16A1D87000A1396C /* shapes */ = {isa = PBXFileReference; lastKnownFileType = folder; name = shapes; path = ../../test/shapes; sourceTree = "<group>"; };
DB166ECF16A1D87000A1396C /* shapes */ = {isa = PBXFileReference; lastKnownFileType = folder; path = shapes; sourceTree = "<group>"; };
DB445EF818184B7000B306B0 /* testdropfile.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testdropfile.app; sourceTree = BUILT_PRODUCTS_DIR; };
DB445EFA18184BB600B306B0 /* testdropfile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testdropfile.c; path = ../../test/testdropfile.c; sourceTree = "<group>"; };
DB445EFA18184BB600B306B0 /* testdropfile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testdropfile.c; sourceTree = "<group>"; };
DB89957E18A19ABA0092407C /* testhotplug */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testhotplug; sourceTree = BUILT_PRODUCTS_DIR; };
DB89958318A19B130092407C /* testhotplug.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testhotplug.c; path = ../../test/testhotplug.c; sourceTree = "<group>"; };
DBBC552C182831D700F3CA8D /* TestDropFile-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = "TestDropFile-Info.plist"; sourceTree = "<group>"; };
DBEC54D11A1A811D005B1EAB /* controllermap.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = controllermap.c; path = ../../test/controllermap.c; sourceTree = "<group>"; };
DBEC54D61A1A8145005B1EAB /* axis.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = axis.bmp; path = ../../test/axis.bmp; sourceTree = "<group>"; };
DBEC54D71A1A8145005B1EAB /* button.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = button.bmp; path = ../../test/button.bmp; sourceTree = "<group>"; };
DBEC54D81A1A8145005B1EAB /* controllermap.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = controllermap.bmp; path = ../../test/controllermap.bmp; sourceTree = "<group>"; };
DB89958318A19B130092407C /* testhotplug.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testhotplug.c; sourceTree = "<group>"; };
DBBC552C182831D700F3CA8D /* TestDropFile-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "TestDropFile-Info.plist"; sourceTree = SOURCE_ROOT; };
DBEC54D11A1A811D005B1EAB /* controllermap.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = controllermap.c; sourceTree = "<group>"; };
DBEC54D61A1A8145005B1EAB /* axis.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = axis.bmp; sourceTree = "<group>"; };
DBEC54D71A1A8145005B1EAB /* button.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = button.bmp; sourceTree = "<group>"; };
DBEC54D81A1A8145005B1EAB /* controllermap.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = controllermap.bmp; sourceTree = "<group>"; };
DBEC54EA1A1A81C3005B1EAB /* controllermap */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = controllermap; sourceTree = BUILT_PRODUCTS_DIR; };
FA73672219A54A90004122E4 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = /System/Library/Frameworks/CoreVideo.framework; sourceTree = "<absolute>"; };
/* End PBXFileReference section */
@ -2165,6 +2165,7 @@
00794E6309D20839003FC8A1 /* utf8.txt */,
);
name = Resources;
path = ../../test;
sourceTree = "<group>";
};
08FB7794FE84155DC02AAC07 /* SDLTest */ = {
@ -2238,6 +2239,7 @@
083E4887006D86A17F000001 /* torturethread.c */,
);
name = Source;
path = ../../test;
sourceTree = "<group>";
};
1AB674ADFE9D54B511CA2CBB /* Products */ = {
@ -2323,6 +2325,7 @@
DB166D9216A1D1A500A1396C /* SDL_test_random.c */,
);
name = SDL_Test;
path = ../../src/test;
sourceTree = "<group>";
};
/* End PBXGroup section */
@ -4037,6 +4040,7 @@
002A85B21073008E007319AE /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(SRCROOT)/../SDL/build/$(CONFIGURATION)",
"$(HOME)/Library/Frameworks",
@ -4163,6 +4167,7 @@
002A85D41073009D007319AE /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(SRCROOT)/../SDL/build/$(CONFIGURATION)",
"$(HOME)/Library/Frameworks",

133
acinclude/pkg_config.m4 Normal file
View file

@ -0,0 +1,133 @@
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
# ----------------------------------
AC_DEFUN([PKG_PROG_PKG_CONFIG],
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
fi
if test -n "$PKG_CONFIG"; then
_pkg_min_version=m4_default([$1], [0.9.0])
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
PKG_CONFIG=""
fi
fi[]dnl
])# PKG_PROG_PKG_CONFIG
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
#
# Check to see whether a particular set of modules exists. Similar
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
#
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
# only at the first occurence in configure.ac, so if the first place
# it's called might be skipped (such as if it is within an "if", you
# have to call PKG_CHECK_EXISTS manually
# --------------------------------------------------------------
AC_DEFUN([PKG_CHECK_EXISTS],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
if test -n "$PKG_CONFIG" && \
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
m4_default([$2], [:])
m4_ifvaln([$3], [else
$3])dnl
fi])
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
# ---------------------------------------------
m4_define([_PKG_CONFIG],
[if test -n "$$1"; then
pkg_cv_[]$1="$$1"
elif test -n "$PKG_CONFIG"; then
PKG_CHECK_EXISTS([$3],
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
[pkg_failed=yes])
else
pkg_failed=untried
fi[]dnl
])# _PKG_CONFIG
# _PKG_SHORT_ERRORS_SUPPORTED
# -----------------------------
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi[]dnl
])# _PKG_SHORT_ERRORS_SUPPORTED
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
# [ACTION-IF-NOT-FOUND])
#
#
# Note that if there is a possibility the first call to
# PKG_CHECK_MODULES might not happen, you should be sure to include an
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
#
#
# --------------------------------------------------------------
AC_DEFUN([PKG_CHECK_MODULES],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
pkg_failed=no
AC_MSG_CHECKING([for $1])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
and $1[]_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.])
if test $pkg_failed = yes; then
AC_MSG_RESULT([no])
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
m4_default([$4], [AC_MSG_ERROR(
[Package requirements ($2) were not met:
$$1_PKG_ERRORS
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
_PKG_TEXT])dnl
])
elif test $pkg_failed = untried; then
AC_MSG_RESULT([no])
m4_default([$4], [AC_MSG_FAILURE(
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
_PKG_TEXT
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])dnl
])
else
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
AC_MSG_RESULT([yes])
$3
fi[]dnl
])# PKG_CHECK_MODULES

View file

@ -8,22 +8,26 @@ else {
}
android {
compileSdkVersion 19
buildToolsVersion "26.0.1"
compileSdkVersion 26
defaultConfig {
if (buildAsApplication) {
applicationId "org.libsdl.app"
}
minSdkVersion 14
targetSdkVersion 19
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
externalNativeBuild {
ndkBuild {
arguments "APP_PLATFORM=android-14"
arguments "APP_PLATFORM=android-16"
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
// cmake {
// arguments "-DANDROID_APP_PLATFORM=android-16", "-DANDROID_STL=c++_static"
// // abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
// abiFilters 'arm64-v8a'
// }
}
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
@ -39,6 +43,9 @@ android {
ndkBuild {
path 'jni/Android.mk'
}
// cmake {
// path 'jni/CMakeLists.txt'
// }
}
}
@ -60,9 +67,5 @@ android {
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testCompile 'junit:junit:4.12'
implementation fileTree(include: ['*.jar'], dir: 'libs')
}

View file

@ -1,9 +1,10 @@
# Uncomment this if you're using STL in your project
# See CPLUSPLUS-SUPPORT.html in the NDK documentation for more information
# APP_STL := stlport_static
# You can find more information here:
# https://developer.android.com/ndk/guides/cpp-support
# APP_STL := c++_shared
APP_ABI := armeabi-v7a arm64-v8a x86 x86_64
# Min runtime API level
APP_PLATFORM=android-14
APP_PLATFORM=android-16

View file

@ -0,0 +1,20 @@
cmake_minimum_required(VERSION 3.6)
project(GAME)
# armeabi-v7a requires cpufeatures library
# include(AndroidNdkModules)
# android_ndk_import_module_cpufeatures()
# SDL sources are in a subfolder named "SDL"
add_subdirectory(SDL)
# Compilation of companion libraries
#add_subdirectory(SDL_image)
#add_subdirectory(SDL_mixer)
#add_subdirectory(SDL_ttf)
# Your game and its CMakeLists.txt are in a subfolder named "src"
add_subdirectory(src)

View file

@ -0,0 +1,13 @@
cmake_minimum_required(VERSION 3.6)
project(MY_APP)
find_library(SDL2 SDL2)
add_library(main SHARED)
target_sources(main PRIVATE YourSourceHere.c)
target_link_libraries(main SDL2)

View file

@ -8,14 +8,40 @@
android:versionName="1.0"
android:installLocation="auto">
<!-- Android 4.0.1 -->
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="16" />
<!-- OpenGL ES 2.0 -->
<uses-feature android:glEsVersion="0x00020000" />
<!-- Touchscreen support -->
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />
<!-- Game controller support -->
<uses-feature
android:name="android.hardware.bluetooth"
android:required="false" />
<uses-feature
android:name="android.hardware.gamepad"
android:required="false" />
<uses-feature
android:name="android.hardware.usb.host"
android:required="false" />
<!-- External mouse input events -->
<uses-feature
android:name="android.hardware.type.pc"
android:required="false" />
<!-- Audio recording support -->
<!-- if you want to capture audio, uncomment this. -->
<!-- <uses-feature
android:name="android.hardware.microphone"
android:required="false" /> -->
<!-- Allow writing to external storage -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- Allow access to Bluetooth devices -->
<uses-permission android:name="android.permission.BLUETOOTH" />
<!-- Allow access to the vibrator -->
<uses-permission android:name="android.permission.VIBRATE" />
@ -42,7 +68,9 @@
<activity android:name="SDLActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:alwaysRetainTaskState="true"
android:launchMode="singleInstance"
android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|keyboard|keyboardHidden|navigation"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />

View file

@ -0,0 +1,22 @@
package org.libsdl.app;
import android.hardware.usb.UsbDevice;
interface HIDDevice
{
public int getId();
public int getVendorId();
public int getProductId();
public String getSerialNumber();
public int getVersion();
public String getManufacturerName();
public String getProductName();
public UsbDevice getDevice();
public boolean open();
public int sendFeatureReport(byte[] report);
public int sendOutputReport(byte[] report);
public boolean getFeatureReport(byte[] report);
public void setFrozen(boolean frozen);
public void close();
public void shutdown();
}

View file

@ -0,0 +1,650 @@
package org.libsdl.app;
import android.content.Context;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCallback;
import android.bluetooth.BluetoothGattCharacteristic;
import android.bluetooth.BluetoothGattDescriptor;
import android.bluetooth.BluetoothManager;
import android.bluetooth.BluetoothProfile;
import android.bluetooth.BluetoothGattService;
import android.hardware.usb.UsbDevice;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import android.os.*;
//import com.android.internal.util.HexDump;
import java.lang.Runnable;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.UUID;
class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDevice {
private static final String TAG = "hidapi";
private HIDDeviceManager mManager;
private BluetoothDevice mDevice;
private int mDeviceId;
private BluetoothGatt mGatt;
private boolean mIsRegistered = false;
private boolean mIsConnected = false;
private boolean mIsChromebook = false;
private boolean mIsReconnecting = false;
private boolean mFrozen = false;
private LinkedList<GattOperation> mOperations;
GattOperation mCurrentOperation = null;
private Handler mHandler;
private static final int TRANSPORT_AUTO = 0;
private static final int TRANSPORT_BREDR = 1;
private static final int TRANSPORT_LE = 2;
private static final int CHROMEBOOK_CONNECTION_CHECK_INTERVAL = 10000;
static public final UUID steamControllerService = UUID.fromString("100F6C32-1735-4313-B402-38567131E5F3");
static public final UUID inputCharacteristic = UUID.fromString("100F6C33-1735-4313-B402-38567131E5F3");
static public final UUID reportCharacteristic = UUID.fromString("100F6C34-1735-4313-B402-38567131E5F3");
static private final byte[] enterValveMode = new byte[] { (byte)0xC0, (byte)0x87, 0x03, 0x08, 0x07, 0x00 };
static class GattOperation {
private enum Operation {
CHR_READ,
CHR_WRITE,
ENABLE_NOTIFICATION
}
Operation mOp;
UUID mUuid;
byte[] mValue;
BluetoothGatt mGatt;
boolean mResult = true;
private GattOperation(BluetoothGatt gatt, GattOperation.Operation operation, UUID uuid) {
mGatt = gatt;
mOp = operation;
mUuid = uuid;
}
private GattOperation(BluetoothGatt gatt, GattOperation.Operation operation, UUID uuid, byte[] value) {
mGatt = gatt;
mOp = operation;
mUuid = uuid;
mValue = value;
}
public void run() {
// This is executed in main thread
BluetoothGattCharacteristic chr;
switch (mOp) {
case CHR_READ:
chr = getCharacteristic(mUuid);
//Log.v(TAG, "Reading characteristic " + chr.getUuid());
if (!mGatt.readCharacteristic(chr)) {
Log.e(TAG, "Unable to read characteristic " + mUuid.toString());
mResult = false;
break;
}
mResult = true;
break;
case CHR_WRITE:
chr = getCharacteristic(mUuid);
//Log.v(TAG, "Writing characteristic " + chr.getUuid() + " value=" + HexDump.toHexString(value));
chr.setValue(mValue);
if (!mGatt.writeCharacteristic(chr)) {
Log.e(TAG, "Unable to write characteristic " + mUuid.toString());
mResult = false;
break;
}
mResult = true;
break;
case ENABLE_NOTIFICATION:
chr = getCharacteristic(mUuid);
//Log.v(TAG, "Writing descriptor of " + chr.getUuid());
if (chr != null) {
BluetoothGattDescriptor cccd = chr.getDescriptor(UUID.fromString("00002902-0000-1000-8000-00805f9b34fb"));
if (cccd != null) {
int properties = chr.getProperties();
byte[] value;
if ((properties & BluetoothGattCharacteristic.PROPERTY_NOTIFY) == BluetoothGattCharacteristic.PROPERTY_NOTIFY) {
value = BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE;
} else if ((properties & BluetoothGattCharacteristic.PROPERTY_INDICATE) == BluetoothGattCharacteristic.PROPERTY_INDICATE) {
value = BluetoothGattDescriptor.ENABLE_INDICATION_VALUE;
} else {
Log.e(TAG, "Unable to start notifications on input characteristic");
mResult = false;
return;
}
mGatt.setCharacteristicNotification(chr, true);
cccd.setValue(value);
if (!mGatt.writeDescriptor(cccd)) {
Log.e(TAG, "Unable to write descriptor " + mUuid.toString());
mResult = false;
return;
}
mResult = true;
}
}
}
}
public boolean finish() {
return mResult;
}
private BluetoothGattCharacteristic getCharacteristic(UUID uuid) {
BluetoothGattService valveService = mGatt.getService(steamControllerService);
if (valveService == null)
return null;
return valveService.getCharacteristic(uuid);
}
static public GattOperation readCharacteristic(BluetoothGatt gatt, UUID uuid) {
return new GattOperation(gatt, Operation.CHR_READ, uuid);
}
static public GattOperation writeCharacteristic(BluetoothGatt gatt, UUID uuid, byte[] value) {
return new GattOperation(gatt, Operation.CHR_WRITE, uuid, value);
}
static public GattOperation enableNotification(BluetoothGatt gatt, UUID uuid) {
return new GattOperation(gatt, Operation.ENABLE_NOTIFICATION, uuid);
}
}
public HIDDeviceBLESteamController(HIDDeviceManager manager, BluetoothDevice device) {
mManager = manager;
mDevice = device;
mDeviceId = mManager.getDeviceIDForIdentifier(getIdentifier());
mIsRegistered = false;
mIsChromebook = mManager.getContext().getPackageManager().hasSystemFeature("org.chromium.arc.device_management");
mOperations = new LinkedList<GattOperation>();
mHandler = new Handler(Looper.getMainLooper());
mGatt = connectGatt();
// final HIDDeviceBLESteamController finalThis = this;
// mHandler.postDelayed(new Runnable() {
// @Override
// public void run() {
// finalThis.checkConnectionForChromebookIssue();
// }
// }, CHROMEBOOK_CONNECTION_CHECK_INTERVAL);
}
public String getIdentifier() {
return String.format("SteamController.%s", mDevice.getAddress());
}
public BluetoothGatt getGatt() {
return mGatt;
}
// Because on Chromebooks we show up as a dual-mode device, it will attempt to connect TRANSPORT_AUTO, which will use TRANSPORT_BREDR instead
// of TRANSPORT_LE. Let's force ourselves to connect low energy.
private BluetoothGatt connectGatt(boolean managed) {
if (Build.VERSION.SDK_INT >= 23) {
try {
return mDevice.connectGatt(mManager.getContext(), managed, this, TRANSPORT_LE);
} catch (Exception e) {
return mDevice.connectGatt(mManager.getContext(), managed, this);
}
} else {
return mDevice.connectGatt(mManager.getContext(), managed, this);
}
}
private BluetoothGatt connectGatt() {
return connectGatt(false);
}
protected int getConnectionState() {
Context context = mManager.getContext();
if (context == null) {
// We are lacking any context to get our Bluetooth information. We'll just assume disconnected.
return BluetoothProfile.STATE_DISCONNECTED;
}
BluetoothManager btManager = (BluetoothManager)context.getSystemService(Context.BLUETOOTH_SERVICE);
if (btManager == null) {
// This device doesn't support Bluetooth. We should never be here, because how did
// we instantiate a device to start with?
return BluetoothProfile.STATE_DISCONNECTED;
}
return btManager.getConnectionState(mDevice, BluetoothProfile.GATT);
}
public void reconnect() {
if (getConnectionState() != BluetoothProfile.STATE_CONNECTED) {
mGatt.disconnect();
mGatt = connectGatt();
}
}
protected void checkConnectionForChromebookIssue() {
if (!mIsChromebook) {
// We only do this on Chromebooks, because otherwise it's really annoying to just attempt
// over and over.
return;
}
int connectionState = getConnectionState();
switch (connectionState) {
case BluetoothProfile.STATE_CONNECTED:
if (!mIsConnected) {
// We are in the Bad Chromebook Place. We can force a disconnect
// to try to recover.
Log.v(TAG, "Chromebook: We are in a very bad state; the controller shows as connected in the underlying Bluetooth layer, but we never received a callback. Forcing a reconnect.");
mIsReconnecting = true;
mGatt.disconnect();
mGatt = connectGatt(false);
break;
}
else if (!isRegistered()) {
if (mGatt.getServices().size() > 0) {
Log.v(TAG, "Chromebook: We are connected to a controller, but never got our registration. Trying to recover.");
probeService(this);
}
else {
Log.v(TAG, "Chromebook: We are connected to a controller, but never discovered services. Trying to recover.");
mIsReconnecting = true;
mGatt.disconnect();
mGatt = connectGatt(false);
break;
}
}
else {
Log.v(TAG, "Chromebook: We are connected, and registered. Everything's good!");
return;
}
break;
case BluetoothProfile.STATE_DISCONNECTED:
Log.v(TAG, "Chromebook: We have either been disconnected, or the Chromebook BtGatt.ContextMap bug has bitten us. Attempting a disconnect/reconnect, but we may not be able to recover.");
mIsReconnecting = true;
mGatt.disconnect();
mGatt = connectGatt(false);
break;
case BluetoothProfile.STATE_CONNECTING:
Log.v(TAG, "Chromebook: We're still trying to connect. Waiting a bit longer.");
break;
}
final HIDDeviceBLESteamController finalThis = this;
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
finalThis.checkConnectionForChromebookIssue();
}
}, CHROMEBOOK_CONNECTION_CHECK_INTERVAL);
}
private boolean isRegistered() {
return mIsRegistered;
}
private void setRegistered() {
mIsRegistered = true;
}
private boolean probeService(HIDDeviceBLESteamController controller) {
if (isRegistered()) {
return true;
}
if (!mIsConnected) {
return false;
}
Log.v(TAG, "probeService controller=" + controller);
for (BluetoothGattService service : mGatt.getServices()) {
if (service.getUuid().equals(steamControllerService)) {
Log.v(TAG, "Found Valve steam controller service " + service.getUuid());
for (BluetoothGattCharacteristic chr : service.getCharacteristics()) {
if (chr.getUuid().equals(inputCharacteristic)) {
Log.v(TAG, "Found input characteristic");
// Start notifications
BluetoothGattDescriptor cccd = chr.getDescriptor(UUID.fromString("00002902-0000-1000-8000-00805f9b34fb"));
if (cccd != null) {
enableNotification(chr.getUuid());
}
}
}
return true;
}
}
if ((mGatt.getServices().size() == 0) && mIsChromebook && !mIsReconnecting) {
Log.e(TAG, "Chromebook: Discovered services were empty; this almost certainly means the BtGatt.ContextMap bug has bitten us.");
mIsConnected = false;
mIsReconnecting = true;
mGatt.disconnect();
mGatt = connectGatt(false);
}
return false;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////
private void finishCurrentGattOperation() {
GattOperation op = null;
synchronized (mOperations) {
if (mCurrentOperation != null) {
op = mCurrentOperation;
mCurrentOperation = null;
}
}
if (op != null) {
boolean result = op.finish(); // TODO: Maybe in main thread as well?
// Our operation failed, let's add it back to the beginning of our queue.
if (!result) {
mOperations.addFirst(op);
}
}
executeNextGattOperation();
}
private void executeNextGattOperation() {
synchronized (mOperations) {
if (mCurrentOperation != null)
return;
if (mOperations.isEmpty())
return;
mCurrentOperation = mOperations.removeFirst();
}
// Run in main thread
mHandler.post(new Runnable() {
@Override
public void run() {
synchronized (mOperations) {
if (mCurrentOperation == null) {
Log.e(TAG, "Current operation null in executor?");
return;
}
mCurrentOperation.run();
// now wait for the GATT callback and when it comes, finish this operation
}
}
});
}
private void queueGattOperation(GattOperation op) {
synchronized (mOperations) {
mOperations.add(op);
}
executeNextGattOperation();
}
private void enableNotification(UUID chrUuid) {
GattOperation op = HIDDeviceBLESteamController.GattOperation.enableNotification(mGatt, chrUuid);
queueGattOperation(op);
}
public void writeCharacteristic(UUID uuid, byte[] value) {
GattOperation op = HIDDeviceBLESteamController.GattOperation.writeCharacteristic(mGatt, uuid, value);
queueGattOperation(op);
}
public void readCharacteristic(UUID uuid) {
GattOperation op = HIDDeviceBLESteamController.GattOperation.readCharacteristic(mGatt, uuid);
queueGattOperation(op);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////
////////////// BluetoothGattCallback overridden methods
//////////////////////////////////////////////////////////////////////////////////////////////////////
public void onConnectionStateChange(BluetoothGatt g, int status, int newState) {
//Log.v(TAG, "onConnectionStateChange status=" + status + " newState=" + newState);
mIsReconnecting = false;
if (newState == 2) {
mIsConnected = true;
// Run directly, without GattOperation
if (!isRegistered()) {
mHandler.post(new Runnable() {
@Override
public void run() {
mGatt.discoverServices();
}
});
}
}
else if (newState == 0) {
mIsConnected = false;
}
// Disconnection is handled in SteamLink using the ACTION_ACL_DISCONNECTED Intent.
}
public void onServicesDiscovered(BluetoothGatt gatt, int status) {
//Log.v(TAG, "onServicesDiscovered status=" + status);
if (status == 0) {
if (gatt.getServices().size() == 0) {
Log.v(TAG, "onServicesDiscovered returned zero services; something has gone horribly wrong down in Android's Bluetooth stack.");
mIsReconnecting = true;
mIsConnected = false;
gatt.disconnect();
mGatt = connectGatt(false);
}
else {
probeService(this);
}
}
}
public void onCharacteristicRead(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) {
//Log.v(TAG, "onCharacteristicRead status=" + status + " uuid=" + characteristic.getUuid());
if (characteristic.getUuid().equals(reportCharacteristic) && !mFrozen) {
mManager.HIDDeviceFeatureReport(getId(), characteristic.getValue());
}
finishCurrentGattOperation();
}
public void onCharacteristicWrite(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) {
//Log.v(TAG, "onCharacteristicWrite status=" + status + " uuid=" + characteristic.getUuid());
if (characteristic.getUuid().equals(reportCharacteristic)) {
// Only register controller with the native side once it has been fully configured
if (!isRegistered()) {
Log.v(TAG, "Registering Steam Controller with ID: " + getId());
mManager.HIDDeviceConnected(getId(), getIdentifier(), getVendorId(), getProductId(), getSerialNumber(), getVersion(), getManufacturerName(), getProductName(), 0, 0, 0, 0);
setRegistered();
}
}
finishCurrentGattOperation();
}
public void onCharacteristicChanged(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic) {
// Enable this for verbose logging of controller input reports
//Log.v(TAG, "onCharacteristicChanged uuid=" + characteristic.getUuid() + " data=" + HexDump.dumpHexString(characteristic.getValue()));
if (characteristic.getUuid().equals(inputCharacteristic) && !mFrozen) {
mManager.HIDDeviceInputReport(getId(), characteristic.getValue());
}
}
public void onDescriptorRead(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, int status) {
//Log.v(TAG, "onDescriptorRead status=" + status);
}
public void onDescriptorWrite(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, int status) {
BluetoothGattCharacteristic chr = descriptor.getCharacteristic();
//Log.v(TAG, "onDescriptorWrite status=" + status + " uuid=" + chr.getUuid() + " descriptor=" + descriptor.getUuid());
if (chr.getUuid().equals(inputCharacteristic)) {
boolean hasWrittenInputDescriptor = true;
BluetoothGattCharacteristic reportChr = chr.getService().getCharacteristic(reportCharacteristic);
if (reportChr != null) {
Log.v(TAG, "Writing report characteristic to enter valve mode");
reportChr.setValue(enterValveMode);
gatt.writeCharacteristic(reportChr);
}
}
finishCurrentGattOperation();
}
public void onReliableWriteCompleted(BluetoothGatt gatt, int status) {
//Log.v(TAG, "onReliableWriteCompleted status=" + status);
}
public void onReadRemoteRssi(BluetoothGatt gatt, int rssi, int status) {
//Log.v(TAG, "onReadRemoteRssi status=" + status);
}
public void onMtuChanged(BluetoothGatt gatt, int mtu, int status) {
//Log.v(TAG, "onMtuChanged status=" + status);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////
//////// Public API
//////////////////////////////////////////////////////////////////////////////////////////////////////
@Override
public int getId() {
return mDeviceId;
}
@Override
public int getVendorId() {
// Valve Corporation
final int VALVE_USB_VID = 0x28DE;
return VALVE_USB_VID;
}
@Override
public int getProductId() {
// We don't have an easy way to query from the Bluetooth device, but we know what it is
final int D0G_BLE2_PID = 0x1106;
return D0G_BLE2_PID;
}
@Override
public String getSerialNumber() {
// This will be read later via feature report by Steam
return "12345";
}
@Override
public int getVersion() {
return 0;
}
@Override
public String getManufacturerName() {
return "Valve Corporation";
}
@Override
public String getProductName() {
return "Steam Controller";
}
@Override
public UsbDevice getDevice() {
return null;
}
@Override
public boolean open() {
return true;
}
@Override
public int sendFeatureReport(byte[] report) {
if (!isRegistered()) {
Log.e(TAG, "Attempted sendFeatureReport before Steam Controller is registered!");
if (mIsConnected) {
probeService(this);
}
return -1;
}
// We need to skip the first byte, as that doesn't go over the air
byte[] actual_report = Arrays.copyOfRange(report, 1, report.length - 1);
//Log.v(TAG, "sendFeatureReport " + HexDump.dumpHexString(actual_report));
writeCharacteristic(reportCharacteristic, actual_report);
return report.length;
}
@Override
public int sendOutputReport(byte[] report) {
if (!isRegistered()) {
Log.e(TAG, "Attempted sendOutputReport before Steam Controller is registered!");
if (mIsConnected) {
probeService(this);
}
return -1;
}
//Log.v(TAG, "sendFeatureReport " + HexDump.dumpHexString(report));
writeCharacteristic(reportCharacteristic, report);
return report.length;
}
@Override
public boolean getFeatureReport(byte[] report) {
if (!isRegistered()) {
Log.e(TAG, "Attempted getFeatureReport before Steam Controller is registered!");
if (mIsConnected) {
probeService(this);
}
return false;
}
//Log.v(TAG, "getFeatureReport");
readCharacteristic(reportCharacteristic);
return true;
}
@Override
public void close() {
}
@Override
public void setFrozen(boolean frozen) {
mFrozen = frozen;
}
@Override
public void shutdown() {
close();
BluetoothGatt g = mGatt;
if (g != null) {
g.disconnect();
g.close();
mGatt = null;
}
mManager = null;
mIsRegistered = false;
mIsConnected = false;
mOperations.clear();
}
}

View file

@ -0,0 +1,669 @@
package org.libsdl.app;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.PendingIntent;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothManager;
import android.bluetooth.BluetoothProfile;
import android.util.Log;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.hardware.usb.*;
import android.os.Handler;
import android.os.Looper;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
public class HIDDeviceManager {
private static final String TAG = "hidapi";
private static final String ACTION_USB_PERMISSION = "org.libsdl.app.USB_PERMISSION";
private static HIDDeviceManager sManager;
private static int sManagerRefCount = 0;
public static HIDDeviceManager acquire(Context context) {
if (sManagerRefCount == 0) {
sManager = new HIDDeviceManager(context);
}
++sManagerRefCount;
return sManager;
}
public static void release(HIDDeviceManager manager) {
if (manager == sManager) {
--sManagerRefCount;
if (sManagerRefCount == 0) {
sManager.close();
sManager = null;
}
}
}
private Context mContext;
private HashMap<Integer, HIDDevice> mDevicesById = new HashMap<Integer, HIDDevice>();
private HashMap<BluetoothDevice, HIDDeviceBLESteamController> mBluetoothDevices = new HashMap<BluetoothDevice, HIDDeviceBLESteamController>();
private int mNextDeviceId = 0;
private SharedPreferences mSharedPreferences = null;
private boolean mIsChromebook = false;
private UsbManager mUsbManager;
private Handler mHandler;
private BluetoothManager mBluetoothManager;
private List<BluetoothDevice> mLastBluetoothDevices;
private final BroadcastReceiver mUsbBroadcast = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action.equals(UsbManager.ACTION_USB_DEVICE_ATTACHED)) {
UsbDevice usbDevice = intent.getParcelableExtra(UsbManager.EXTRA_DEVICE);
handleUsbDeviceAttached(usbDevice);
} else if (action.equals(UsbManager.ACTION_USB_DEVICE_DETACHED)) {
UsbDevice usbDevice = intent.getParcelableExtra(UsbManager.EXTRA_DEVICE);
handleUsbDeviceDetached(usbDevice);
} else if (action.equals(HIDDeviceManager.ACTION_USB_PERMISSION)) {
UsbDevice usbDevice = intent.getParcelableExtra(UsbManager.EXTRA_DEVICE);
handleUsbDevicePermission(usbDevice, intent.getBooleanExtra(UsbManager.EXTRA_PERMISSION_GRANTED, false));
}
}
};
private final BroadcastReceiver mBluetoothBroadcast = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
// Bluetooth device was connected. If it was a Steam Controller, handle it
if (action.equals(BluetoothDevice.ACTION_ACL_CONNECTED)) {
BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
Log.d(TAG, "Bluetooth device connected: " + device);
if (isSteamController(device)) {
connectBluetoothDevice(device);
}
}
// Bluetooth device was disconnected, remove from controller manager (if any)
if (action.equals(BluetoothDevice.ACTION_ACL_DISCONNECTED)) {
BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
Log.d(TAG, "Bluetooth device disconnected: " + device);
disconnectBluetoothDevice(device);
}
}
};
private HIDDeviceManager(final Context context) {
mContext = context;
// Make sure we have the HIDAPI library loaded with the native functions
try {
SDL.loadLibrary("hidapi");
} catch (Throwable e) {
Log.w(TAG, "Couldn't load hidapi: " + e.toString());
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setCancelable(false);
builder.setTitle("SDL HIDAPI Error");
builder.setMessage("Please report the following error to the SDL maintainers: " + e.getMessage());
builder.setNegativeButton("Quit", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
try {
// If our context is an activity, exit rather than crashing when we can't
// call our native functions.
Activity activity = (Activity)context;
activity.finish();
}
catch (ClassCastException cce) {
// Context wasn't an activity, there's nothing we can do. Give up and return.
}
}
});
builder.show();
return;
}
HIDDeviceRegisterCallback();
mSharedPreferences = mContext.getSharedPreferences("hidapi", Context.MODE_PRIVATE);
mIsChromebook = mContext.getPackageManager().hasSystemFeature("org.chromium.arc.device_management");
// if (shouldClear) {
// SharedPreferences.Editor spedit = mSharedPreferences.edit();
// spedit.clear();
// spedit.commit();
// }
// else
{
mNextDeviceId = mSharedPreferences.getInt("next_device_id", 0);
}
initializeUSB();
initializeBluetooth();
}
public Context getContext() {
return mContext;
}
public int getDeviceIDForIdentifier(String identifier) {
SharedPreferences.Editor spedit = mSharedPreferences.edit();
int result = mSharedPreferences.getInt(identifier, 0);
if (result == 0) {
result = mNextDeviceId++;
spedit.putInt("next_device_id", mNextDeviceId);
}
spedit.putInt(identifier, result);
spedit.commit();
return result;
}
private void initializeUSB() {
mUsbManager = (UsbManager)mContext.getSystemService(Context.USB_SERVICE);
/*
// Logging
for (UsbDevice device : mUsbManager.getDeviceList().values()) {
Log.i(TAG,"Path: " + device.getDeviceName());
Log.i(TAG,"Manufacturer: " + device.getManufacturerName());
Log.i(TAG,"Product: " + device.getProductName());
Log.i(TAG,"ID: " + device.getDeviceId());
Log.i(TAG,"Class: " + device.getDeviceClass());
Log.i(TAG,"Protocol: " + device.getDeviceProtocol());
Log.i(TAG,"Vendor ID " + device.getVendorId());
Log.i(TAG,"Product ID: " + device.getProductId());
Log.i(TAG,"Interface count: " + device.getInterfaceCount());
Log.i(TAG,"---------------------------------------");
// Get interface details
for (int index = 0; index < device.getInterfaceCount(); index++) {
UsbInterface mUsbInterface = device.getInterface(index);
Log.i(TAG," ***** *****");
Log.i(TAG," Interface index: " + index);
Log.i(TAG," Interface ID: " + mUsbInterface.getId());
Log.i(TAG," Interface class: " + mUsbInterface.getInterfaceClass());
Log.i(TAG," Interface subclass: " + mUsbInterface.getInterfaceSubclass());
Log.i(TAG," Interface protocol: " + mUsbInterface.getInterfaceProtocol());
Log.i(TAG," Endpoint count: " + mUsbInterface.getEndpointCount());
// Get endpoint details
for (int epi = 0; epi < mUsbInterface.getEndpointCount(); epi++)
{
UsbEndpoint mEndpoint = mUsbInterface.getEndpoint(epi);
Log.i(TAG," ++++ ++++ ++++");
Log.i(TAG," Endpoint index: " + epi);
Log.i(TAG," Attributes: " + mEndpoint.getAttributes());
Log.i(TAG," Direction: " + mEndpoint.getDirection());
Log.i(TAG," Number: " + mEndpoint.getEndpointNumber());
Log.i(TAG," Interval: " + mEndpoint.getInterval());
Log.i(TAG," Packet size: " + mEndpoint.getMaxPacketSize());
Log.i(TAG," Type: " + mEndpoint.getType());
}
}
}
Log.i(TAG," No more devices connected.");
*/
// Register for USB broadcasts and permission completions
IntentFilter filter = new IntentFilter();
filter.addAction(UsbManager.ACTION_USB_DEVICE_ATTACHED);
filter.addAction(UsbManager.ACTION_USB_DEVICE_DETACHED);
filter.addAction(HIDDeviceManager.ACTION_USB_PERMISSION);
mContext.registerReceiver(mUsbBroadcast, filter);
for (UsbDevice usbDevice : mUsbManager.getDeviceList().values()) {
handleUsbDeviceAttached(usbDevice);
}
}
UsbManager getUSBManager() {
return mUsbManager;
}
private void shutdownUSB() {
try {
mContext.unregisterReceiver(mUsbBroadcast);
} catch (Exception e) {
// We may not have registered, that's okay
}
}
private boolean isHIDDeviceInterface(UsbDevice usbDevice, UsbInterface usbInterface) {
if (usbInterface.getInterfaceClass() == UsbConstants.USB_CLASS_HID) {
return true;
}
if (isXbox360Controller(usbDevice, usbInterface) || isXboxOneController(usbDevice, usbInterface)) {
return true;
}
return false;
}
private boolean isXbox360Controller(UsbDevice usbDevice, UsbInterface usbInterface) {
final int XB360_IFACE_SUBCLASS = 93;
final int XB360_IFACE_PROTOCOL = 1; // Wired
final int XB360W_IFACE_PROTOCOL = 129; // Wireless
final int[] SUPPORTED_VENDORS = {
0x0079, // GPD Win 2
0x044f, // Thrustmaster
0x045e, // Microsoft
0x046d, // Logitech
0x056e, // Elecom
0x06a3, // Saitek
0x0738, // Mad Catz
0x07ff, // Mad Catz
0x0e6f, // PDP
0x0f0d, // Hori
0x1038, // SteelSeries
0x11c9, // Nacon
0x12ab, // Unknown
0x1430, // RedOctane
0x146b, // BigBen
0x1532, // Razer Sabertooth
0x15e4, // Numark
0x162e, // Joytech
0x1689, // Razer Onza
0x1bad, // Harmonix
0x24c6, // PowerA
};
if (usbInterface.getInterfaceClass() == UsbConstants.USB_CLASS_VENDOR_SPEC &&
usbInterface.getInterfaceSubclass() == XB360_IFACE_SUBCLASS &&
(usbInterface.getInterfaceProtocol() == XB360_IFACE_PROTOCOL ||
usbInterface.getInterfaceProtocol() == XB360W_IFACE_PROTOCOL)) {
int vendor_id = usbDevice.getVendorId();
for (int supportedVid : SUPPORTED_VENDORS) {
if (vendor_id == supportedVid) {
return true;
}
}
}
return false;
}
private boolean isXboxOneController(UsbDevice usbDevice, UsbInterface usbInterface) {
final int XB1_IFACE_SUBCLASS = 71;
final int XB1_IFACE_PROTOCOL = 208;
final int[] SUPPORTED_VENDORS = {
0x045e, // Microsoft
0x0738, // Mad Catz
0x0e6f, // PDP
0x0f0d, // Hori
0x1532, // Razer Wildcat
0x24c6, // PowerA
0x2e24, // Hyperkin
};
if (usbInterface.getId() == 0 &&
usbInterface.getInterfaceClass() == UsbConstants.USB_CLASS_VENDOR_SPEC &&
usbInterface.getInterfaceSubclass() == XB1_IFACE_SUBCLASS &&
usbInterface.getInterfaceProtocol() == XB1_IFACE_PROTOCOL) {
int vendor_id = usbDevice.getVendorId();
for (int supportedVid : SUPPORTED_VENDORS) {
if (vendor_id == supportedVid) {
return true;
}
}
}
return false;
}
private void handleUsbDeviceAttached(UsbDevice usbDevice) {
connectHIDDeviceUSB(usbDevice);
}
private void handleUsbDeviceDetached(UsbDevice usbDevice) {
List<Integer> devices = new ArrayList<Integer>();
for (HIDDevice device : mDevicesById.values()) {
if (usbDevice.equals(device.getDevice())) {
devices.add(device.getId());
}
}
for (int id : devices) {
HIDDevice device = mDevicesById.get(id);
mDevicesById.remove(id);
device.shutdown();
HIDDeviceDisconnected(id);
}
}
private void handleUsbDevicePermission(UsbDevice usbDevice, boolean permission_granted) {
for (HIDDevice device : mDevicesById.values()) {
if (usbDevice.equals(device.getDevice())) {
boolean opened = false;
if (permission_granted) {
opened = device.open();
}
HIDDeviceOpenResult(device.getId(), opened);
}
}
}
private void connectHIDDeviceUSB(UsbDevice usbDevice) {
synchronized (this) {
for (int interface_index = 0; interface_index < usbDevice.getInterfaceCount(); interface_index++) {
UsbInterface usbInterface = usbDevice.getInterface(interface_index);
if (isHIDDeviceInterface(usbDevice, usbInterface)) {
HIDDeviceUSB device = new HIDDeviceUSB(this, usbDevice, interface_index);
int id = device.getId();
mDevicesById.put(id, device);
HIDDeviceConnected(id, device.getIdentifier(), device.getVendorId(), device.getProductId(), device.getSerialNumber(), device.getVersion(), device.getManufacturerName(), device.getProductName(), usbInterface.getId(), usbInterface.getInterfaceClass(), usbInterface.getInterfaceSubclass(), usbInterface.getInterfaceProtocol());
}
}
}
}
private void initializeBluetooth() {
Log.d(TAG, "Initializing Bluetooth");
if (mContext.getPackageManager().checkPermission(android.Manifest.permission.BLUETOOTH, mContext.getPackageName()) != PackageManager.PERMISSION_GRANTED) {
Log.d(TAG, "Couldn't initialize Bluetooth, missing android.permission.BLUETOOTH");
return;
}
// Find bonded bluetooth controllers and create SteamControllers for them
mBluetoothManager = (BluetoothManager)mContext.getSystemService(Context.BLUETOOTH_SERVICE);
if (mBluetoothManager == null) {
// This device doesn't support Bluetooth.
return;
}
BluetoothAdapter btAdapter = mBluetoothManager.getAdapter();
if (btAdapter == null) {
// This device has Bluetooth support in the codebase, but has no available adapters.
return;
}
// Get our bonded devices.
for (BluetoothDevice device : btAdapter.getBondedDevices()) {
Log.d(TAG, "Bluetooth device available: " + device);
if (isSteamController(device)) {
connectBluetoothDevice(device);
}
}
// NOTE: These don't work on Chromebooks, to my undying dismay.
IntentFilter filter = new IntentFilter();
filter.addAction(BluetoothDevice.ACTION_ACL_CONNECTED);
filter.addAction(BluetoothDevice.ACTION_ACL_DISCONNECTED);
mContext.registerReceiver(mBluetoothBroadcast, filter);
if (mIsChromebook) {
mHandler = new Handler(Looper.getMainLooper());
mLastBluetoothDevices = new ArrayList<BluetoothDevice>();
// final HIDDeviceManager finalThis = this;
// mHandler.postDelayed(new Runnable() {
// @Override
// public void run() {
// finalThis.chromebookConnectionHandler();
// }
// }, 5000);
}
}
private void shutdownBluetooth() {
try {
mContext.unregisterReceiver(mBluetoothBroadcast);
} catch (Exception e) {
// We may not have registered, that's okay
}
}
// Chromebooks do not pass along ACTION_ACL_CONNECTED / ACTION_ACL_DISCONNECTED properly.
// This function provides a sort of dummy version of that, watching for changes in the
// connected devices and attempting to add controllers as things change.
public void chromebookConnectionHandler() {
if (!mIsChromebook) {
return;
}
ArrayList<BluetoothDevice> disconnected = new ArrayList<BluetoothDevice>();
ArrayList<BluetoothDevice> connected = new ArrayList<BluetoothDevice>();
List<BluetoothDevice> currentConnected = mBluetoothManager.getConnectedDevices(BluetoothProfile.GATT);
for (BluetoothDevice bluetoothDevice : currentConnected) {
if (!mLastBluetoothDevices.contains(bluetoothDevice)) {
connected.add(bluetoothDevice);
}
}
for (BluetoothDevice bluetoothDevice : mLastBluetoothDevices) {
if (!currentConnected.contains(bluetoothDevice)) {
disconnected.add(bluetoothDevice);
}
}
mLastBluetoothDevices = currentConnected;
for (BluetoothDevice bluetoothDevice : disconnected) {
disconnectBluetoothDevice(bluetoothDevice);
}
for (BluetoothDevice bluetoothDevice : connected) {
connectBluetoothDevice(bluetoothDevice);
}
final HIDDeviceManager finalThis = this;
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
finalThis.chromebookConnectionHandler();
}
}, 10000);
}
public boolean connectBluetoothDevice(BluetoothDevice bluetoothDevice) {
Log.v(TAG, "connectBluetoothDevice device=" + bluetoothDevice);
synchronized (this) {
if (mBluetoothDevices.containsKey(bluetoothDevice)) {
Log.v(TAG, "Steam controller with address " + bluetoothDevice + " already exists, attempting reconnect");
HIDDeviceBLESteamController device = mBluetoothDevices.get(bluetoothDevice);
device.reconnect();
return false;
}
HIDDeviceBLESteamController device = new HIDDeviceBLESteamController(this, bluetoothDevice);
int id = device.getId();
mBluetoothDevices.put(bluetoothDevice, device);
mDevicesById.put(id, device);
// The Steam Controller will mark itself connected once initialization is complete
}
return true;
}
public void disconnectBluetoothDevice(BluetoothDevice bluetoothDevice) {
synchronized (this) {
HIDDeviceBLESteamController device = mBluetoothDevices.get(bluetoothDevice);
if (device == null)
return;
int id = device.getId();
mBluetoothDevices.remove(bluetoothDevice);
mDevicesById.remove(id);
device.shutdown();
HIDDeviceDisconnected(id);
}
}
public boolean isSteamController(BluetoothDevice bluetoothDevice) {
// Sanity check. If you pass in a null device, by definition it is never a Steam Controller.
if (bluetoothDevice == null) {
return false;
}
// If the device has no local name, we really don't want to try an equality check against it.
if (bluetoothDevice.getName() == null) {
return false;
}
return bluetoothDevice.getName().equals("SteamController") && ((bluetoothDevice.getType() & BluetoothDevice.DEVICE_TYPE_LE) != 0);
}
private void close() {
shutdownUSB();
shutdownBluetooth();
synchronized (this) {
for (HIDDevice device : mDevicesById.values()) {
device.shutdown();
}
mDevicesById.clear();
mBluetoothDevices.clear();
HIDDeviceReleaseCallback();
}
}
public void setFrozen(boolean frozen) {
synchronized (this) {
for (HIDDevice device : mDevicesById.values()) {
device.setFrozen(frozen);
}
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////
private HIDDevice getDevice(int id) {
synchronized (this) {
HIDDevice result = mDevicesById.get(id);
if (result == null) {
Log.v(TAG, "No device for id: " + id);
Log.v(TAG, "Available devices: " + mDevicesById.keySet());
}
return result;
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////
////////// JNI interface functions
//////////////////////////////////////////////////////////////////////////////////////////////////////
public boolean openDevice(int deviceID) {
Log.v(TAG, "openDevice deviceID=" + deviceID);
HIDDevice device = getDevice(deviceID);
if (device == null) {
HIDDeviceDisconnected(deviceID);
return false;
}
// Look to see if this is a USB device and we have permission to access it
UsbDevice usbDevice = device.getDevice();
if (usbDevice != null && !mUsbManager.hasPermission(usbDevice)) {
HIDDeviceOpenPending(deviceID);
try {
mUsbManager.requestPermission(usbDevice, PendingIntent.getBroadcast(mContext, 0, new Intent(HIDDeviceManager.ACTION_USB_PERMISSION), 0));
} catch (Exception e) {
Log.v(TAG, "Couldn't request permission for USB device " + usbDevice);
HIDDeviceOpenResult(deviceID, false);
}
return false;
}
try {
return device.open();
} catch (Exception e) {
Log.e(TAG, "Got exception: " + Log.getStackTraceString(e));
}
return false;
}
public int sendOutputReport(int deviceID, byte[] report) {
try {
//Log.v(TAG, "sendOutputReport deviceID=" + deviceID + " length=" + report.length);
HIDDevice device;
device = getDevice(deviceID);
if (device == null) {
HIDDeviceDisconnected(deviceID);
return -1;
}
return device.sendOutputReport(report);
} catch (Exception e) {
Log.e(TAG, "Got exception: " + Log.getStackTraceString(e));
}
return -1;
}
public int sendFeatureReport(int deviceID, byte[] report) {
try {
//Log.v(TAG, "sendFeatureReport deviceID=" + deviceID + " length=" + report.length);
HIDDevice device;
device = getDevice(deviceID);
if (device == null) {
HIDDeviceDisconnected(deviceID);
return -1;
}
return device.sendFeatureReport(report);
} catch (Exception e) {
Log.e(TAG, "Got exception: " + Log.getStackTraceString(e));
}
return -1;
}
public boolean getFeatureReport(int deviceID, byte[] report) {
try {
//Log.v(TAG, "getFeatureReport deviceID=" + deviceID);
HIDDevice device;
device = getDevice(deviceID);
if (device == null) {
HIDDeviceDisconnected(deviceID);
return false;
}
return device.getFeatureReport(report);
} catch (Exception e) {
Log.e(TAG, "Got exception: " + Log.getStackTraceString(e));
}
return false;
}
public void closeDevice(int deviceID) {
try {
Log.v(TAG, "closeDevice deviceID=" + deviceID);
HIDDevice device;
device = getDevice(deviceID);
if (device == null) {
HIDDeviceDisconnected(deviceID);
return;
}
device.close();
} catch (Exception e) {
Log.e(TAG, "Got exception: " + Log.getStackTraceString(e));
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////// Native methods
//////////////////////////////////////////////////////////////////////////////////////////////////////
private native void HIDDeviceRegisterCallback();
private native void HIDDeviceReleaseCallback();
native void HIDDeviceConnected(int deviceID, String identifier, int vendorId, int productId, String serial_number, int release_number, String manufacturer_string, String product_string, int interface_number, int interface_class, int interface_subclass, int interface_protocol);
native void HIDDeviceOpenPending(int deviceID);
native void HIDDeviceOpenResult(int deviceID, boolean opened);
native void HIDDeviceDisconnected(int deviceID);
native void HIDDeviceInputReport(int deviceID, byte[] report);
native void HIDDeviceFeatureReport(int deviceID, byte[] report);
}

View file

@ -0,0 +1,304 @@
package org.libsdl.app;
import android.hardware.usb.*;
import android.os.Build;
import android.util.Log;
import java.util.Arrays;
class HIDDeviceUSB implements HIDDevice {
private static final String TAG = "hidapi";
protected HIDDeviceManager mManager;
protected UsbDevice mDevice;
protected int mInterfaceIndex;
protected int mInterface;
protected int mDeviceId;
protected UsbDeviceConnection mConnection;
protected UsbEndpoint mInputEndpoint;
protected UsbEndpoint mOutputEndpoint;
protected InputThread mInputThread;
protected boolean mRunning;
protected boolean mFrozen;
public HIDDeviceUSB(HIDDeviceManager manager, UsbDevice usbDevice, int interface_index) {
mManager = manager;
mDevice = usbDevice;
mInterfaceIndex = interface_index;
mInterface = mDevice.getInterface(mInterfaceIndex).getId();
mDeviceId = manager.getDeviceIDForIdentifier(getIdentifier());
mRunning = false;
}
public String getIdentifier() {
return String.format("%s/%x/%x/%d", mDevice.getDeviceName(), mDevice.getVendorId(), mDevice.getProductId(), mInterfaceIndex);
}
@Override
public int getId() {
return mDeviceId;
}
@Override
public int getVendorId() {
return mDevice.getVendorId();
}
@Override
public int getProductId() {
return mDevice.getProductId();
}
@Override
public String getSerialNumber() {
String result = null;
if (Build.VERSION.SDK_INT >= 21) {
result = mDevice.getSerialNumber();
}
if (result == null) {
result = "";
}
return result;
}
@Override
public int getVersion() {
return 0;
}
@Override
public String getManufacturerName() {
String result = null;
if (Build.VERSION.SDK_INT >= 21) {
result = mDevice.getManufacturerName();
}
if (result == null) {
result = String.format("%x", getVendorId());
}
return result;
}
@Override
public String getProductName() {
String result = null;
if (Build.VERSION.SDK_INT >= 21) {
result = mDevice.getProductName();
}
if (result == null) {
result = String.format("%x", getProductId());
}
return result;
}
@Override
public UsbDevice getDevice() {
return mDevice;
}
public String getDeviceName() {
return getManufacturerName() + " " + getProductName() + "(0x" + String.format("%x", getVendorId()) + "/0x" + String.format("%x", getProductId()) + ")";
}
@Override
public boolean open() {
mConnection = mManager.getUSBManager().openDevice(mDevice);
if (mConnection == null) {
Log.w(TAG, "Unable to open USB device " + getDeviceName());
return false;
}
// Force claim our interface
UsbInterface iface = mDevice.getInterface(mInterfaceIndex);
if (!mConnection.claimInterface(iface, true)) {
Log.w(TAG, "Failed to claim interfaces on USB device " + getDeviceName());
close();
return false;
}
// Find the endpoints
for (int j = 0; j < iface.getEndpointCount(); j++) {
UsbEndpoint endpt = iface.getEndpoint(j);
switch (endpt.getDirection()) {
case UsbConstants.USB_DIR_IN:
if (mInputEndpoint == null) {
mInputEndpoint = endpt;
}
break;
case UsbConstants.USB_DIR_OUT:
if (mOutputEndpoint == null) {
mOutputEndpoint = endpt;
}
break;
}
}
// Make sure the required endpoints were present
if (mInputEndpoint == null || mOutputEndpoint == null) {
Log.w(TAG, "Missing required endpoint on USB device " + getDeviceName());
close();
return false;
}
// Start listening for input
mRunning = true;
mInputThread = new InputThread();
mInputThread.start();
return true;
}
@Override
public int sendFeatureReport(byte[] report) {
int res = -1;
int offset = 0;
int length = report.length;
boolean skipped_report_id = false;
byte report_number = report[0];
if (report_number == 0x0) {
++offset;
--length;
skipped_report_id = true;
}
res = mConnection.controlTransfer(
UsbConstants.USB_TYPE_CLASS | 0x01 /*RECIPIENT_INTERFACE*/ | UsbConstants.USB_DIR_OUT,
0x09/*HID set_report*/,
(3/*HID feature*/ << 8) | report_number,
mInterface,
report, offset, length,
1000/*timeout millis*/);
if (res < 0) {
Log.w(TAG, "sendFeatureReport() returned " + res + " on device " + getDeviceName());
return -1;
}
if (skipped_report_id) {
++length;
}
return length;
}
@Override
public int sendOutputReport(byte[] report) {
int r = mConnection.bulkTransfer(mOutputEndpoint, report, report.length, 1000);
if (r != report.length) {
Log.w(TAG, "sendOutputReport() returned " + r + " on device " + getDeviceName());
}
return r;
}
@Override
public boolean getFeatureReport(byte[] report) {
int res = -1;
int offset = 0;
int length = report.length;
boolean skipped_report_id = false;
byte report_number = report[0];
if (report_number == 0x0) {
/* Offset the return buffer by 1, so that the report ID
will remain in byte 0. */
++offset;
--length;
skipped_report_id = true;
}
res = mConnection.controlTransfer(
UsbConstants.USB_TYPE_CLASS | 0x01 /*RECIPIENT_INTERFACE*/ | UsbConstants.USB_DIR_IN,
0x01/*HID get_report*/,
(3/*HID feature*/ << 8) | report_number,
mInterface,
report, offset, length,
1000/*timeout millis*/);
if (res < 0) {
Log.w(TAG, "getFeatureReport() returned " + res + " on device " + getDeviceName());
return false;
}
if (skipped_report_id) {
++res;
++length;
}
byte[] data;
if (res == length) {
data = report;
} else {
data = Arrays.copyOfRange(report, 0, res);
}
mManager.HIDDeviceFeatureReport(mDeviceId, data);
return true;
}
@Override
public void close() {
mRunning = false;
if (mInputThread != null) {
while (mInputThread.isAlive()) {
mInputThread.interrupt();
try {
mInputThread.join();
} catch (InterruptedException e) {
// Keep trying until we're done
}
}
mInputThread = null;
}
if (mConnection != null) {
UsbInterface iface = mDevice.getInterface(mInterfaceIndex);
mConnection.releaseInterface(iface);
mConnection.close();
mConnection = null;
}
}
@Override
public void shutdown() {
close();
mManager = null;
}
@Override
public void setFrozen(boolean frozen) {
mFrozen = frozen;
}
protected class InputThread extends Thread {
@Override
public void run() {
int packetSize = mInputEndpoint.getMaxPacketSize();
byte[] packet = new byte[packetSize];
while (mRunning) {
int r;
try
{
r = mConnection.bulkTransfer(mInputEndpoint, packet, packetSize, 1000);
}
catch (Exception e)
{
Log.v(TAG, "Exception in UsbDeviceConnection bulktransfer: " + e);
break;
}
if (r < 0) {
// Could be a timeout or an I/O error
}
if (r > 0) {
byte[] data;
if (r == packetSize) {
data = packet;
} else {
data = Arrays.copyOfRange(packet, 0, r);
}
if (!mFrozen) {
mManager.HIDDeviceInputReport(mDeviceId, data);
}
}
}
}
}
}

View file

@ -2,6 +2,8 @@ package org.libsdl.app;
import android.content.Context;
import java.lang.reflect.*;
/**
SDL library initialization
*/
@ -33,5 +35,50 @@ public class SDL {
return mContext;
}
public static void loadLibrary(String libraryName) throws UnsatisfiedLinkError, SecurityException, NullPointerException {
if (libraryName == null) {
throw new NullPointerException("No library name provided.");
}
try {
// Let's see if we have ReLinker available in the project. This is necessary for
// some projects that have huge numbers of local libraries bundled, and thus may
// trip a bug in Android's native library loader which ReLinker works around. (If
// loadLibrary works properly, ReLinker will simply use the normal Android method
// internally.)
//
// To use ReLinker, just add it as a dependency. For more information, see
// https://github.com/KeepSafe/ReLinker for ReLinker's repository.
//
Class relinkClass = mContext.getClassLoader().loadClass("com.getkeepsafe.relinker.ReLinker");
Class relinkListenerClass = mContext.getClassLoader().loadClass("com.getkeepsafe.relinker.ReLinker$LoadListener");
Class contextClass = mContext.getClassLoader().loadClass("android.content.Context");
Class stringClass = mContext.getClassLoader().loadClass("java.lang.String");
// Get a 'force' instance of the ReLinker, so we can ensure libraries are reinstalled if
// they've changed during updates.
Method forceMethod = relinkClass.getDeclaredMethod("force");
Object relinkInstance = forceMethod.invoke(null);
Class relinkInstanceClass = relinkInstance.getClass();
// Actually load the library!
Method loadMethod = relinkInstanceClass.getDeclaredMethod("loadLibrary", contextClass, stringClass, stringClass, relinkListenerClass);
loadMethod.invoke(relinkInstance, mContext, libraryName, null, null);
}
catch (final Throwable e) {
// Fall back
try {
System.loadLibrary(libraryName);
}
catch (final UnsatisfiedLinkError ule) {
throw ule;
}
catch (final SecurityException se) {
throw se;
}
}
}
protected static Context mContext;
}

View file

@ -1,6 +1,7 @@
package org.libsdl.app;
import android.media.*;
import android.os.Build;
import android.util.Log;
public class SDLAudioManager
@ -17,41 +18,250 @@ public class SDLAudioManager
// Audio
/**
* This method is called by SDL using JNI.
*/
public static int audioOpen(int sampleRate, boolean is16Bit, boolean isStereo, int desiredFrames) {
int channelConfig = isStereo ? AudioFormat.CHANNEL_CONFIGURATION_STEREO : AudioFormat.CHANNEL_CONFIGURATION_MONO;
int audioFormat = is16Bit ? AudioFormat.ENCODING_PCM_16BIT : AudioFormat.ENCODING_PCM_8BIT;
int frameSize = (isStereo ? 2 : 1) * (is16Bit ? 2 : 1);
protected static String getAudioFormatString(int audioFormat) {
switch (audioFormat) {
case AudioFormat.ENCODING_PCM_8BIT:
return "8-bit";
case AudioFormat.ENCODING_PCM_16BIT:
return "16-bit";
case AudioFormat.ENCODING_PCM_FLOAT:
return "float";
default:
return Integer.toString(audioFormat);
}
}
Log.v(TAG, "SDL audio: wanted " + (isStereo ? "stereo" : "mono") + " " + (is16Bit ? "16-bit" : "8-bit") + " " + (sampleRate / 1000f) + "kHz, " + desiredFrames + " frames buffer");
protected static int[] open(boolean isCapture, int sampleRate, int audioFormat, int desiredChannels, int desiredFrames) {
int channelConfig;
int sampleSize;
int frameSize;
Log.v(TAG, "Opening " + (isCapture ? "capture" : "playback") + ", requested " + desiredFrames + " frames of " + desiredChannels + " channel " + getAudioFormatString(audioFormat) + " audio at " + sampleRate + " Hz");
/* On older devices let's use known good settings */
if (Build.VERSION.SDK_INT < 21) {
if (desiredChannels > 2) {
desiredChannels = 2;
}
if (sampleRate < 8000) {
sampleRate = 8000;
} else if (sampleRate > 48000) {
sampleRate = 48000;
}
}
if (audioFormat == AudioFormat.ENCODING_PCM_FLOAT) {
int minSDKVersion = (isCapture ? 23 : 21);
if (Build.VERSION.SDK_INT < minSDKVersion) {
audioFormat = AudioFormat.ENCODING_PCM_16BIT;
}
}
switch (audioFormat)
{
case AudioFormat.ENCODING_PCM_8BIT:
sampleSize = 1;
break;
case AudioFormat.ENCODING_PCM_16BIT:
sampleSize = 2;
break;
case AudioFormat.ENCODING_PCM_FLOAT:
sampleSize = 4;
break;
default:
Log.v(TAG, "Requested format " + audioFormat + ", getting ENCODING_PCM_16BIT");
audioFormat = AudioFormat.ENCODING_PCM_16BIT;
sampleSize = 2;
break;
}
if (isCapture) {
switch (desiredChannels) {
case 1:
channelConfig = AudioFormat.CHANNEL_IN_MONO;
break;
case 2:
channelConfig = AudioFormat.CHANNEL_IN_STEREO;
break;
default:
Log.v(TAG, "Requested " + desiredChannels + " channels, getting stereo");
desiredChannels = 2;
channelConfig = AudioFormat.CHANNEL_IN_STEREO;
break;
}
} else {
switch (desiredChannels) {
case 1:
channelConfig = AudioFormat.CHANNEL_OUT_MONO;
break;
case 2:
channelConfig = AudioFormat.CHANNEL_OUT_STEREO;
break;
case 3:
channelConfig = AudioFormat.CHANNEL_OUT_STEREO | AudioFormat.CHANNEL_OUT_FRONT_CENTER;
break;
case 4:
channelConfig = AudioFormat.CHANNEL_OUT_QUAD;
break;
case 5:
channelConfig = AudioFormat.CHANNEL_OUT_QUAD | AudioFormat.CHANNEL_OUT_FRONT_CENTER;
break;
case 6:
channelConfig = AudioFormat.CHANNEL_OUT_5POINT1;
break;
case 7:
channelConfig = AudioFormat.CHANNEL_OUT_5POINT1 | AudioFormat.CHANNEL_OUT_BACK_CENTER;
break;
case 8:
if (Build.VERSION.SDK_INT >= 23) {
channelConfig = AudioFormat.CHANNEL_OUT_7POINT1_SURROUND;
} else {
Log.v(TAG, "Requested " + desiredChannels + " channels, getting 5.1 surround");
desiredChannels = 6;
channelConfig = AudioFormat.CHANNEL_OUT_5POINT1;
}
break;
default:
Log.v(TAG, "Requested " + desiredChannels + " channels, getting stereo");
desiredChannels = 2;
channelConfig = AudioFormat.CHANNEL_OUT_STEREO;
break;
}
/*
Log.v(TAG, "Speaker configuration (and order of channels):");
if ((channelConfig & 0x00000004) != 0) {
Log.v(TAG, " CHANNEL_OUT_FRONT_LEFT");
}
if ((channelConfig & 0x00000008) != 0) {
Log.v(TAG, " CHANNEL_OUT_FRONT_RIGHT");
}
if ((channelConfig & 0x00000010) != 0) {
Log.v(TAG, " CHANNEL_OUT_FRONT_CENTER");
}
if ((channelConfig & 0x00000020) != 0) {
Log.v(TAG, " CHANNEL_OUT_LOW_FREQUENCY");
}
if ((channelConfig & 0x00000040) != 0) {
Log.v(TAG, " CHANNEL_OUT_BACK_LEFT");
}
if ((channelConfig & 0x00000080) != 0) {
Log.v(TAG, " CHANNEL_OUT_BACK_RIGHT");
}
if ((channelConfig & 0x00000100) != 0) {
Log.v(TAG, " CHANNEL_OUT_FRONT_LEFT_OF_CENTER");
}
if ((channelConfig & 0x00000200) != 0) {
Log.v(TAG, " CHANNEL_OUT_FRONT_RIGHT_OF_CENTER");
}
if ((channelConfig & 0x00000400) != 0) {
Log.v(TAG, " CHANNEL_OUT_BACK_CENTER");
}
if ((channelConfig & 0x00000800) != 0) {
Log.v(TAG, " CHANNEL_OUT_SIDE_LEFT");
}
if ((channelConfig & 0x00001000) != 0) {
Log.v(TAG, " CHANNEL_OUT_SIDE_RIGHT");
}
*/
}
frameSize = (sampleSize * desiredChannels);
// Let the user pick a larger buffer if they really want -- but ye
// gods they probably shouldn't, the minimums are horrifyingly high
// latency already
desiredFrames = Math.max(desiredFrames, (AudioTrack.getMinBufferSize(sampleRate, channelConfig, audioFormat) + frameSize - 1) / frameSize);
int minBufferSize;
if (isCapture) {
minBufferSize = AudioRecord.getMinBufferSize(sampleRate, channelConfig, audioFormat);
} else {
minBufferSize = AudioTrack.getMinBufferSize(sampleRate, channelConfig, audioFormat);
}
desiredFrames = Math.max(desiredFrames, (minBufferSize + frameSize - 1) / frameSize);
if (mAudioTrack == null) {
mAudioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, sampleRate,
channelConfig, audioFormat, desiredFrames * frameSize, AudioTrack.MODE_STREAM);
int[] results = new int[4];
// Instantiating AudioTrack can "succeed" without an exception and the track may still be invalid
// Ref: https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/media/java/android/media/AudioTrack.java
// Ref: http://developer.android.com/reference/android/media/AudioTrack.html#getState()
if (isCapture) {
if (mAudioRecord == null) {
mAudioRecord = new AudioRecord(MediaRecorder.AudioSource.DEFAULT, sampleRate,
channelConfig, audioFormat, desiredFrames * frameSize);
if (mAudioTrack.getState() != AudioTrack.STATE_INITIALIZED) {
Log.e(TAG, "Failed during initialization of Audio Track");
mAudioTrack = null;
return -1;
// see notes about AudioTrack state in audioOpen(), above. Probably also applies here.
if (mAudioRecord.getState() != AudioRecord.STATE_INITIALIZED) {
Log.e(TAG, "Failed during initialization of AudioRecord");
mAudioRecord.release();
mAudioRecord = null;
return null;
}
mAudioRecord.startRecording();
}
mAudioTrack.play();
results[0] = mAudioRecord.getSampleRate();
results[1] = mAudioRecord.getAudioFormat();
results[2] = mAudioRecord.getChannelCount();
results[3] = desiredFrames;
} else {
if (mAudioTrack == null) {
mAudioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, sampleRate, channelConfig, audioFormat, desiredFrames * frameSize, AudioTrack.MODE_STREAM);
// Instantiating AudioTrack can "succeed" without an exception and the track may still be invalid
// Ref: https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/media/java/android/media/AudioTrack.java
// Ref: http://developer.android.com/reference/android/media/AudioTrack.html#getState()
if (mAudioTrack.getState() != AudioTrack.STATE_INITIALIZED) {
/* Try again, with safer values */
Log.e(TAG, "Failed during initialization of Audio Track");
mAudioTrack.release();
mAudioTrack = null;
return null;
}
mAudioTrack.play();
}
results[0] = mAudioTrack.getSampleRate();
results[1] = mAudioTrack.getAudioFormat();
results[2] = mAudioTrack.getChannelCount();
results[3] = desiredFrames;
}
Log.v(TAG, "SDL audio: got " + ((mAudioTrack.getChannelCount() >= 2) ? "stereo" : "mono") + " " + ((mAudioTrack.getAudioFormat() == AudioFormat.ENCODING_PCM_16BIT) ? "16-bit" : "8-bit") + " " + (mAudioTrack.getSampleRate() / 1000f) + "kHz, " + desiredFrames + " frames buffer");
Log.v(TAG, "Opening " + (isCapture ? "capture" : "playback") + ", got " + results[3] + " frames of " + results[2] + " channel " + getAudioFormatString(results[1]) + " audio at " + results[0] + " Hz");
return 0;
return results;
}
/**
* This method is called by SDL using JNI.
*/
public static int[] audioOpen(int sampleRate, int audioFormat, int desiredChannels, int desiredFrames) {
return open(false, sampleRate, audioFormat, desiredChannels, desiredFrames);
}
/**
* This method is called by SDL using JNI.
*/
public static void audioWriteFloatBuffer(float[] buffer) {
if (mAudioTrack == null) {
Log.e(TAG, "Attempted to make audio call with uninitialized audio!");
return;
}
for (int i = 0; i < buffer.length;) {
int result = mAudioTrack.write(buffer, i, buffer.length - i, AudioTrack.WRITE_BLOCKING);
if (result > 0) {
i += result;
} else if (result == 0) {
try {
Thread.sleep(1);
} catch(InterruptedException e) {
// Nom nom
}
} else {
Log.w(TAG, "SDL audio: error return from write(float)");
return;
}
}
}
/**
@ -63,7 +273,7 @@ public class SDLAudioManager
return;
}
for (int i = 0; i < buffer.length; ) {
for (int i = 0; i < buffer.length;) {
int result = mAudioTrack.write(buffer, i, buffer.length - i);
if (result > 0) {
i += result;
@ -88,7 +298,7 @@ public class SDLAudioManager
Log.e(TAG, "Attempted to make audio call with uninitialized audio!");
return;
}
for (int i = 0; i < buffer.length; ) {
int result = mAudioTrack.write(buffer, i, buffer.length - i);
if (result > 0) {
@ -109,53 +319,33 @@ public class SDLAudioManager
/**
* This method is called by SDL using JNI.
*/
public static int captureOpen(int sampleRate, boolean is16Bit, boolean isStereo, int desiredFrames) {
int channelConfig = isStereo ? AudioFormat.CHANNEL_CONFIGURATION_STEREO : AudioFormat.CHANNEL_CONFIGURATION_MONO;
int audioFormat = is16Bit ? AudioFormat.ENCODING_PCM_16BIT : AudioFormat.ENCODING_PCM_8BIT;
int frameSize = (isStereo ? 2 : 1) * (is16Bit ? 2 : 1);
public static int[] captureOpen(int sampleRate, int audioFormat, int desiredChannels, int desiredFrames) {
return open(true, sampleRate, audioFormat, desiredChannels, desiredFrames);
}
Log.v(TAG, "SDL capture: wanted " + (isStereo ? "stereo" : "mono") + " " + (is16Bit ? "16-bit" : "8-bit") + " " + (sampleRate / 1000f) + "kHz, " + desiredFrames + " frames buffer");
// Let the user pick a larger buffer if they really want -- but ye
// gods they probably shouldn't, the minimums are horrifyingly high
// latency already
desiredFrames = Math.max(desiredFrames, (AudioRecord.getMinBufferSize(sampleRate, channelConfig, audioFormat) + frameSize - 1) / frameSize);
if (mAudioRecord == null) {
mAudioRecord = new AudioRecord(MediaRecorder.AudioSource.DEFAULT, sampleRate,
channelConfig, audioFormat, desiredFrames * frameSize);
// see notes about AudioTrack state in audioOpen(), above. Probably also applies here.
if (mAudioRecord.getState() != AudioRecord.STATE_INITIALIZED) {
Log.e(TAG, "Failed during initialization of AudioRecord");
mAudioRecord.release();
mAudioRecord = null;
return -1;
}
mAudioRecord.startRecording();
}
Log.v(TAG, "SDL capture: got " + ((mAudioRecord.getChannelCount() >= 2) ? "stereo" : "mono") + " " + ((mAudioRecord.getAudioFormat() == AudioFormat.ENCODING_PCM_16BIT) ? "16-bit" : "8-bit") + " " + (mAudioRecord.getSampleRate() / 1000f) + "kHz, " + desiredFrames + " frames buffer");
return 0;
/** This method is called by SDL using JNI. */
public static int captureReadFloatBuffer(float[] buffer, boolean blocking) {
return mAudioRecord.read(buffer, 0, buffer.length, blocking ? AudioRecord.READ_BLOCKING : AudioRecord.READ_NON_BLOCKING);
}
/** This method is called by SDL using JNI. */
public static int captureReadShortBuffer(short[] buffer, boolean blocking) {
// !!! FIXME: this is available in API Level 23. Until then, we always block. :(
//return mAudioRecord.read(buffer, 0, buffer.length, blocking ? AudioRecord.READ_BLOCKING : AudioRecord.READ_NON_BLOCKING);
return mAudioRecord.read(buffer, 0, buffer.length);
if (Build.VERSION.SDK_INT < 23) {
return mAudioRecord.read(buffer, 0, buffer.length);
} else {
return mAudioRecord.read(buffer, 0, buffer.length, blocking ? AudioRecord.READ_BLOCKING : AudioRecord.READ_NON_BLOCKING);
}
}
/** This method is called by SDL using JNI. */
public static int captureReadByteBuffer(byte[] buffer, boolean blocking) {
// !!! FIXME: this is available in API Level 23. Until then, we always block. :(
//return mAudioRecord.read(buffer, 0, buffer.length, blocking ? AudioRecord.READ_BLOCKING : AudioRecord.READ_NON_BLOCKING);
return mAudioRecord.read(buffer, 0, buffer.length);
if (Build.VERSION.SDK_INT < 23) {
return mAudioRecord.read(buffer, 0, buffer.length);
} else {
return mAudioRecord.read(buffer, 0, buffer.length, blocking ? AudioRecord.READ_BLOCKING : AudioRecord.READ_NON_BLOCKING);
}
}
/** This method is called by SDL using JNI. */
public static void audioClose() {
if (mAudioTrack != null) {
@ -174,5 +364,24 @@ public class SDLAudioManager
}
}
/** This method is called by SDL using JNI. */
public static void audioSetThreadPriority(boolean iscapture, int device_id) {
try {
/* Set thread name */
if (iscapture) {
Thread.currentThread().setName("SDLAudioC" + device_id);
} else {
Thread.currentThread().setName("SDLAudioP" + device_id);
}
/* Set thread priority */
android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_AUDIO);
} catch (Exception e) {
Log.v(TAG, "modify thread properties failed " + e.toString());
}
}
public static native int nativeSetupJNI();
}

View file

@ -11,7 +11,7 @@ import android.view.*;
import android.util.Log;
public class SDLControllerManager
public class SDLControllerManager
{
public static native int nativeSetupJNI();
@ -36,23 +36,21 @@ public class SDLControllerManager
private static final String TAG = "SDLControllerManager";
public static void initialize() {
mJoystickHandler = null;
mHapticHandler = null;
SDLControllerManager.setup();
}
public static void setup() {
if (Build.VERSION.SDK_INT >= 19) {
mJoystickHandler = new SDLJoystickHandler_API19();
} else if (Build.VERSION.SDK_INT >= 16) {
mJoystickHandler = new SDLJoystickHandler_API16();
} else if (Build.VERSION.SDK_INT >= 12) {
mJoystickHandler = new SDLJoystickHandler_API12();
} else {
mJoystickHandler = new SDLJoystickHandler();
if (mJoystickHandler == null) {
if (Build.VERSION.SDK_INT >= 19) {
mJoystickHandler = new SDLJoystickHandler_API19();
} else {
mJoystickHandler = new SDLJoystickHandler_API16();
}
}
if (mHapticHandler == null) {
if (Build.VERSION.SDK_INT >= 26) {
mHapticHandler = new SDLHapticHandler_API26();
} else {
mHapticHandler = new SDLHapticHandler();
}
}
mHapticHandler = new SDLHapticHandler();
}
// Joystick glue code, just a series of stubs that redirect to the SDLJoystickHandler instance
@ -77,8 +75,16 @@ public class SDLControllerManager
/**
* This method is called by SDL using JNI.
*/
public static void hapticRun(int device_id, int length) {
mHapticHandler.run(device_id, length);
public static void hapticRun(int device_id, float intensity, int length) {
mHapticHandler.run(device_id, intensity, length);
}
/**
* This method is called by SDL using JNI.
*/
public static void hapticStop(int device_id)
{
mHapticHandler.stop(device_id);
}
// Check if a given device is considered a possible SDL joystick
@ -93,8 +99,8 @@ public class SDLControllerManager
/* This is called for every button press, so let's not spam the logs */
/**
if ((sources & InputDevice.SOURCE_CLASS_JOYSTICK) == InputDevice.SOURCE_CLASS_JOYSTICK) {
Log.v(TAG, "Input device " + device.getName() + " is a joystick.");
if ((sources & InputDevice.SOURCE_CLASS_JOYSTICK) != 0) {
Log.v(TAG, "Input device " + device.getName() + " has class joystick.");
}
if ((sources & InputDevice.SOURCE_DPAD) == InputDevice.SOURCE_DPAD) {
Log.v(TAG, "Input device " + device.getName() + " is a dpad.");
@ -104,7 +110,7 @@ public class SDLControllerManager
}
**/
return (((sources & InputDevice.SOURCE_CLASS_JOYSTICK) == InputDevice.SOURCE_CLASS_JOYSTICK) ||
return ((sources & InputDevice.SOURCE_CLASS_JOYSTICK) != 0 ||
((sources & InputDevice.SOURCE_DPAD) == InputDevice.SOURCE_DPAD) ||
((sources & InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD)
);
@ -112,7 +118,6 @@ public class SDLControllerManager
}
/* A null joystick handler for API level < 12 devices (the accelerometer is handled separately) */
class SDLJoystickHandler {
/**
@ -132,7 +137,7 @@ class SDLJoystickHandler {
}
/* Actual joystick functionality available for API >= 12 devices */
class SDLJoystickHandler_API12 extends SDLJoystickHandler {
class SDLJoystickHandler_API16 extends SDLJoystickHandler {
static class SDLJoystick {
public int device_id;
@ -144,13 +149,27 @@ class SDLJoystickHandler_API12 extends SDLJoystickHandler {
static class RangeComparator implements Comparator<InputDevice.MotionRange> {
@Override
public int compare(InputDevice.MotionRange arg0, InputDevice.MotionRange arg1) {
return arg0.getAxis() - arg1.getAxis();
// Some controllers, like the Moga Pro 2, return AXIS_GAS (22) for right trigger and AXIS_BRAKE (23) for left trigger - swap them so they're sorted in the right order for SDL
int arg0Axis = arg0.getAxis();
int arg1Axis = arg1.getAxis();
if (arg0Axis == MotionEvent.AXIS_GAS) {
arg0Axis = MotionEvent.AXIS_BRAKE;
} else if (arg0Axis == MotionEvent.AXIS_BRAKE) {
arg0Axis = MotionEvent.AXIS_GAS;
}
if (arg1Axis == MotionEvent.AXIS_GAS) {
arg1Axis = MotionEvent.AXIS_BRAKE;
} else if (arg1Axis == MotionEvent.AXIS_BRAKE) {
arg1Axis = MotionEvent.AXIS_GAS;
}
return arg0Axis - arg1Axis;
}
}
private ArrayList<SDLJoystick> mJoysticks;
public SDLJoystickHandler_API12() {
public SDLJoystickHandler_API16() {
mJoysticks = new ArrayList<SDLJoystick>();
}
@ -254,6 +273,12 @@ class SDLJoystickHandler_API12 extends SDLJoystickHandler {
}
public String getJoystickDescriptor(InputDevice joystickDevice) {
String desc = joystickDevice.getDescriptor();
if (desc != null && !desc.isEmpty()) {
return desc;
}
return joystickDevice.getName();
}
public int getProductId(InputDevice joystickDevice) {
@ -267,20 +292,6 @@ class SDLJoystickHandler_API12 extends SDLJoystickHandler {
}
}
class SDLJoystickHandler_API16 extends SDLJoystickHandler_API12 {
@Override
public String getJoystickDescriptor(InputDevice joystickDevice) {
String desc = joystickDevice.getDescriptor();
if (desc != null && !desc.isEmpty()) {
return desc;
}
return super.getJoystickDescriptor(joystickDevice);
}
}
class SDLJoystickHandler_API19 extends SDLJoystickHandler_API16 {
@Override
@ -387,6 +398,38 @@ class SDLJoystickHandler_API19 extends SDLJoystickHandler_API16 {
}
}
class SDLHapticHandler_API26 extends SDLHapticHandler {
@Override
public void run(int device_id, float intensity, int length) {
SDLHaptic haptic = getHaptic(device_id);
if (haptic != null) {
Log.d("SDL", "Rtest: Vibe with intensity " + intensity + " for " + length);
if (intensity == 0.0f) {
stop(device_id);
return;
}
int vibeValue = Math.round(intensity * 255);
if (vibeValue > 255) {
vibeValue = 255;
}
if (vibeValue < 1) {
stop(device_id);
return;
}
try {
haptic.vib.vibrate(VibrationEffect.createOneShot(length, vibeValue));
}
catch (Exception e) {
// Fall back to the generic method, which uses DEFAULT_AMPLITUDE, but works even if
// something went horribly wrong with the Android 8.0 APIs.
haptic.vib.vibrate(length);
}
}
}
}
class SDLHapticHandler {
class SDLHaptic {
@ -396,20 +439,27 @@ class SDLHapticHandler {
}
private ArrayList<SDLHaptic> mHaptics;
public SDLHapticHandler() {
mHaptics = new ArrayList<SDLHaptic>();
}
public void run(int device_id, int length) {
public void run(int device_id, float intensity, int length) {
SDLHaptic haptic = getHaptic(device_id);
if (haptic != null) {
haptic.vib.vibrate (length);
haptic.vib.vibrate(length);
}
}
public void stop(int device_id) {
SDLHaptic haptic = getHaptic(device_id);
if (haptic != null) {
haptic.vib.cancel();
}
}
public void pollHapticDevices() {
final int deviceId_VIBRATOR_SERVICE = 999999;
boolean hasVibratorService = false;
@ -419,21 +469,18 @@ class SDLHapticHandler {
// so the first controller seen by SDL matches what the receiver
// considers to be the first controller
if (Build.VERSION.SDK_INT >= 16)
{
for (int i = deviceIds.length - 1; i > -1; i--) {
SDLHaptic haptic = getHaptic(deviceIds[i]);
if (haptic == null) {
InputDevice device = InputDevice.getDevice(deviceIds[i]);
Vibrator vib = device.getVibrator();
if (vib.hasVibrator()) {
haptic = new SDLHaptic();
haptic.device_id = deviceIds[i];
haptic.name = device.getName();
haptic.vib = vib;
mHaptics.add(haptic);
SDLControllerManager.nativeAddHaptic(haptic.device_id, haptic.name);
}
for (int i = deviceIds.length - 1; i > -1; i--) {
SDLHaptic haptic = getHaptic(deviceIds[i]);
if (haptic == null) {
InputDevice device = InputDevice.getDevice(deviceIds[i]);
Vibrator vib = device.getVibrator();
if (vib.hasVibrator()) {
haptic = new SDLHaptic();
haptic.device_id = deviceIds[i];
haptic.name = device.getName();
haptic.vib = vib;
mHaptics.add(haptic);
SDLControllerManager.nativeAddHaptic(haptic.device_id, haptic.name);
}
}
}
@ -441,11 +488,7 @@ class SDLHapticHandler {
/* Check VIBRATOR_SERVICE */
Vibrator vib = (Vibrator) SDL.getContext().getSystemService(Context.VIBRATOR_SERVICE);
if (vib != null) {
if (Build.VERSION.SDK_INT >= 11) {
hasVibratorService = vib.hasVibrator();
} else {
hasVibratorService = true;
}
hasVibratorService = vib.hasVibrator();
if (hasVibratorService) {
SDLHaptic haptic = getHaptic(deviceId_VIBRATOR_SERVICE);
@ -453,7 +496,7 @@ class SDLHapticHandler {
haptic = new SDLHaptic();
haptic.device_id = deviceId_VIBRATOR_SERVICE;
haptic.name = "VIBRATOR_SERVICE";
haptic.vib = vib;
haptic.vib = vib;
mHaptics.add(haptic);
SDLControllerManager.nativeAddHaptic(haptic.device_id, haptic.name);
}
@ -495,7 +538,7 @@ class SDLHapticHandler {
}
}
return null;
}
}
}
class SDLGenericMotionListener_API12 implements View.OnGenericMotionListener {
@ -512,22 +555,19 @@ class SDLGenericMotionListener_API12 implements View.OnGenericMotionListener {
return SDLControllerManager.handleJoystickMotionEvent(event);
case InputDevice.SOURCE_MOUSE:
if (!SDLActivity.mSeparateMouseAndTouch) {
break;
}
action = event.getActionMasked();
switch (action) {
case MotionEvent.ACTION_SCROLL:
x = event.getAxisValue(MotionEvent.AXIS_HSCROLL, 0);
y = event.getAxisValue(MotionEvent.AXIS_VSCROLL, 0);
SDLActivity.onNativeMouse(0, action, x, y);
SDLActivity.onNativeMouse(0, action, x, y, false);
return true;
case MotionEvent.ACTION_HOVER_MOVE:
x = event.getX(0);
y = event.getY(0);
SDLActivity.onNativeMouse(0, action, x, y);
SDLActivity.onNativeMouse(0, action, x, y, false);
return true;
default:
@ -542,5 +582,207 @@ class SDLGenericMotionListener_API12 implements View.OnGenericMotionListener {
// Event was not managed
return false;
}
public boolean supportsRelativeMouse() {
return false;
}
public boolean inRelativeMode() {
return false;
}
public boolean setRelativeMouseEnabled(boolean enabled) {
return false;
}
public void reclaimRelativeMouseModeIfNeeded()
{
}
public float getEventX(MotionEvent event) {
return event.getX(0);
}
public float getEventY(MotionEvent event) {
return event.getY(0);
}
}
class SDLGenericMotionListener_API24 extends SDLGenericMotionListener_API12 {
// Generic Motion (mouse hover, joystick...) events go here
private boolean mRelativeModeEnabled;
@Override
public boolean onGenericMotion(View v, MotionEvent event) {
// Handle relative mouse mode
if (mRelativeModeEnabled) {
if (event.getSource() == InputDevice.SOURCE_MOUSE) {
int action = event.getActionMasked();
if (action == MotionEvent.ACTION_HOVER_MOVE) {
float x = event.getAxisValue(MotionEvent.AXIS_RELATIVE_X);
float y = event.getAxisValue(MotionEvent.AXIS_RELATIVE_Y);
SDLActivity.onNativeMouse(0, action, x, y, true);
return true;
}
}
}
// Event was not managed, call SDLGenericMotionListener_API12 method
return super.onGenericMotion(v, event);
}
@Override
public boolean supportsRelativeMouse() {
return true;
}
@Override
public boolean inRelativeMode() {
return mRelativeModeEnabled;
}
@Override
public boolean setRelativeMouseEnabled(boolean enabled) {
mRelativeModeEnabled = enabled;
return true;
}
@Override
public float getEventX(MotionEvent event) {
if (mRelativeModeEnabled) {
return event.getAxisValue(MotionEvent.AXIS_RELATIVE_X);
}
else {
return event.getX(0);
}
}
@Override
public float getEventY(MotionEvent event) {
if (mRelativeModeEnabled) {
return event.getAxisValue(MotionEvent.AXIS_RELATIVE_Y);
}
else {
return event.getY(0);
}
}
}
class SDLGenericMotionListener_API26 extends SDLGenericMotionListener_API24 {
// Generic Motion (mouse hover, joystick...) events go here
private boolean mRelativeModeEnabled;
@Override
public boolean onGenericMotion(View v, MotionEvent event) {
float x, y;
int action;
switch ( event.getSource() ) {
case InputDevice.SOURCE_JOYSTICK:
case InputDevice.SOURCE_GAMEPAD:
case InputDevice.SOURCE_DPAD:
return SDLControllerManager.handleJoystickMotionEvent(event);
case InputDevice.SOURCE_MOUSE:
// DeX desktop mouse cursor is a separate non-standard input type.
case InputDevice.SOURCE_MOUSE | InputDevice.SOURCE_TOUCHSCREEN:
action = event.getActionMasked();
switch (action) {
case MotionEvent.ACTION_SCROLL:
x = event.getAxisValue(MotionEvent.AXIS_HSCROLL, 0);
y = event.getAxisValue(MotionEvent.AXIS_VSCROLL, 0);
SDLActivity.onNativeMouse(0, action, x, y, false);
return true;
case MotionEvent.ACTION_HOVER_MOVE:
x = event.getX(0);
y = event.getY(0);
SDLActivity.onNativeMouse(0, action, x, y, false);
return true;
default:
break;
}
break;
case InputDevice.SOURCE_MOUSE_RELATIVE:
action = event.getActionMasked();
switch (action) {
case MotionEvent.ACTION_SCROLL:
x = event.getAxisValue(MotionEvent.AXIS_HSCROLL, 0);
y = event.getAxisValue(MotionEvent.AXIS_VSCROLL, 0);
SDLActivity.onNativeMouse(0, action, x, y, false);
return true;
case MotionEvent.ACTION_HOVER_MOVE:
x = event.getX(0);
y = event.getY(0);
SDLActivity.onNativeMouse(0, action, x, y, true);
return true;
default:
break;
}
break;
default:
break;
}
// Event was not managed
return false;
}
@Override
public boolean supportsRelativeMouse() {
return (!SDLActivity.isDeXMode() || (Build.VERSION.SDK_INT >= 27));
}
@Override
public boolean inRelativeMode() {
return mRelativeModeEnabled;
}
@Override
public boolean setRelativeMouseEnabled(boolean enabled) {
if (!SDLActivity.isDeXMode() || (Build.VERSION.SDK_INT >= 27)) {
if (enabled) {
SDLActivity.getContentView().requestPointerCapture();
}
else {
SDLActivity.getContentView().releasePointerCapture();
}
mRelativeModeEnabled = enabled;
return true;
}
else
{
return false;
}
}
@Override
public void reclaimRelativeMouseModeIfNeeded()
{
if (mRelativeModeEnabled && !SDLActivity.isDeXMode()) {
SDLActivity.getContentView().requestPointerCapture();
}
}
@Override
public float getEventX(MotionEvent event) {
// Relative mouse in capture mode will only have relative for X/Y
return event.getX(0);
}
@Override
public float getEventY(MotionEvent event) {
// Relative mouse in capture mode will only have relative for X/Y
return event.getY(0);
}
}

View file

@ -3,9 +3,10 @@
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:3.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@ -15,6 +16,7 @@ buildscript {
allprojects {
repositories {
jcenter()
google()
}
}

View file

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip

View file

@ -69,6 +69,6 @@ ndk-build \
NDK_LIBS_OUT=$lib \
APP_BUILD_SCRIPT=Android.mk \
APP_ABI="armeabi-v7a arm64-v8a x86 x86_64" \
APP_PLATFORM=android-14 \
APP_PLATFORM=android-16 \
APP_MODULES="SDL2 SDL2_main" \
$ndk_args

0
build-scripts/config.guess vendored Normal file → Executable file
View file

0
build-scripts/config.sub vendored Normal file → Executable file
View file

View file

@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2005-02-02.21
scriptversion=2011-11-20.07; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@ -35,42 +35,72 @@ scriptversion=2005-02-02.21
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# 'make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# from scratch.
nl='
'
IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
doit=${DOITPROG-}
if test -z "$doit"; then
doit_exec=exec
else
doit_exec=$doit
fi
# put in absolute paths if you don't have them in your path; or use env. vars.
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_glob='?'
initialize_posix_glob='
test "$posix_glob" != "?" || {
if (set -f) 2>/dev/null; then
posix_glob=
else
posix_glob=:
fi
}
'
posix_mkdir=
# Desired mode of installed file.
mode=0755
chmodcmd="$chmodprog 0755"
chowncmd=
chgrpcmd=
stripcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
mvcmd="$mvprog"
stripcmd=
src=
dst=
dir_arg=
dstarg=
dst_arg=
copy_on_change=false
no_target_directory=
usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
@ -80,108 +110,148 @@ In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
-c (ignored)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
--help display this help and exit.
--version display version info and exit.
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test -n "$1"; do
while test $# -ne 0; do
case $1 in
-c) shift
continue;;
-c) ;;
-d) dir_arg=true
shift
continue;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
shift;;
--help) echo "$usage"; exit $?;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-m) mode=$2
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
shift;;
-s) stripcmd=$stripprog
shift
continue;;
-s) stripcmd=$stripprog;;
-t) dstarg=$2
shift
shift
continue;;
-t) dst_arg=$2
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
shift;;
-T) no_target_directory=true
shift
continue;;
-T) no_target_directory=true;;
--version) echo "$0 $scriptversion"; exit $?;;
*) # When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
test -n "$dir_arg$dstarg" && break
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dstarg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dstarg"
shift # fnord
fi
shift # arg
dstarg=$arg
done
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
if test -z "$1"; then
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call `install-sh -d' without argument.
# It's OK to call 'install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
trap "ret=130; $do_exit" 2
trap "ret=141; $do_exit" 13
trap "ret=143; $do_exit" 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names starting with `-'.
# Protect names problematic for 'test' and other utilities.
case $src in
-*) src=./$src ;;
-* | [=\(\)!]) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
src=
if test -d "$dst"; then
mkdircmd=:
chmodcmd=
else
mkdircmd=$mkdirprog
fi
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
@ -190,71 +260,194 @@ do
exit 1
fi
if test -z "$dstarg"; then
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dstarg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst ;;
esac
dst=$dst_arg
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dstarg: Is a directory" >&2
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dst=$dst/`basename "$src"`
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
test -d "$dstdir"
dstdir_status=$?
fi
fi
# This sed command emulates the dirname command.
dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
obsolete_mkdir_used=false
# Make sure that the destination directory exists.
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
# Skip lots of stat calls in the usual case.
if test ! -d "$dstdir"; then
defaultIFS='
'
IFS="${IFS-$defaultIFS}"
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
oIFS=$IFS
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
shift
IFS=$oIFS
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
pathcomp=
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
while test $# -ne 0 ; do
pathcomp=$pathcomp$1
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
[-=\(\)!]*) prefix='./';;
*) prefix='';;
esac
eval "$initialize_posix_glob"
oIFS=$IFS
IFS=/
$posix_glob set -f
set fnord $dstdir
shift
if test ! -d "$pathcomp"; then
$mkdirprog "$pathcomp"
# mkdir can fail with a `File exist' error in case several
# install-sh are creating the directory concurrently. This
# is OK.
test -d "$pathcomp" || exit
$posix_glob set +f
IFS=$oIFS
prefixes=
for d
do
test X"$d" = X && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
pathcomp=$pathcomp/
done
fi
fi
if test -n "$dir_arg"; then
$doit $mkdircmd "$dst" \
&& { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
&& { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
dstfile=`basename "$dst"`
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
@ -262,10 +455,9 @@ do
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
trap '(exit $?); exit' 1 2 13 15
# Copy the file name to the temp name.
$doit $cpprog "$src" "$dsttmp" &&
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
@ -273,51 +465,63 @@ do
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
&& { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# Now rename the file to the real destination.
{ $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
|| {
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
if test -f "$dstdir/$dstfile"; then
$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
|| $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
|| {
echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
(exit 1); exit 1
}
else
:
fi
} &&
eval "$initialize_posix_glob" &&
$posix_glob set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
$posix_glob set +f &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
}
}
fi || { (exit 1); exit 1; }
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# The final little trick to "correctly" pass the exit status to the exit trap.
{
(exit 0); exit 0
}
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

View file

@ -1,29 +1,59 @@
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain
scriptversion=2009-04-28.21; # UTC
# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain.
#
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
nl='
'
IFS=" "" $nl"
errstatus=0
dirmode=""
dirmode=
usage="\
Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
Create each directory DIR (with mode MODE, if specified), including all
leading file name components.
Report bugs to <bug-automake@gnu.org>."
# process command line arguments
while test $# -gt 0 ; do
case "${1}" in
-h | --help | --h* ) # -h for help
echo "${usage}" 1>&2; exit 0 ;;
-m ) # -m PERM arg
shift
test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
dirmode="${1}"
shift ;;
-- ) shift; break ;; # stop option processing
-* ) echo "${usage}" 1>&2; exit 1 ;; # unknown option
* ) break ;; # first non-opt arg
esac
case $1 in
-h | --help | --h*) # -h for help
echo "$usage"
exit $?
;;
-m) # -m PERM arg
shift
test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
dirmode=$1
shift
;;
--version)
echo "$0 $scriptversion"
exit $?
;;
--) # stop option processing
shift
break
;;
-*) # unknown option
echo "$usage" 1>&2
exit 1
;;
*) # first non-opt arg
break
;;
esac
done
for file
@ -36,64 +66,97 @@ do
done
case $# in
0) exit 0 ;;
0) exit 0 ;;
esac
# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and
# mkdir -p a/c at the same time, both will detect that a is missing,
# one will create a, then the other will try to create a and die with
# a "File exists" error. This is a problem when calling mkinstalldirs
# from a parallel make. We use --version in the probe to restrict
# ourselves to GNU mkdir, which is thread-safe.
case $dirmode in
'')
if mkdir -p -- . 2>/dev/null; then
echo "mkdir -p -- $*"
exec mkdir -p -- "$@"
fi ;;
*)
if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
echo "mkdir -m $dirmode -p -- $*"
exec mkdir -m "$dirmode" -p -- "$@"
fi ;;
'')
if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
echo "mkdir -p -- $*"
exec mkdir -p -- "$@"
else
# On NextStep and OpenStep, the 'mkdir' command does not
# recognize any option. It will interpret all options as
# directories to create, and then abort because '.' already
# exists.
test -d ./-p && rmdir ./-p
test -d ./--version && rmdir ./--version
fi
;;
*)
if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
test ! -d ./--version; then
echo "mkdir -m $dirmode -p -- $*"
exec mkdir -m "$dirmode" -p -- "$@"
else
# Clean up after NextStep and OpenStep mkdir.
for d in ./-m ./-p ./--version "./$dirmode";
do
test -d $d && rmdir $d
done
fi
;;
esac
for file
do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
case $file in
/*) pathcomp=/ ;;
*) pathcomp= ;;
esac
oIFS=$IFS
IFS=/
set fnord $file
shift
IFS=$oIFS
pathcomp=
for d
do
pathcomp="$pathcomp$d"
case "$pathcomp" in
-* ) pathcomp=./$pathcomp ;;
esac
for d
do
test "x$d" = x && continue
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp"
pathcomp=$pathcomp$d
case $pathcomp in
-*) pathcomp=./$pathcomp ;;
esac
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp"
if test ! -d "$pathcomp"; then
errstatus=$lasterr
else
if test ! -z "$dirmode"; then
echo "chmod $dirmode $pathcomp"
mkdir "$pathcomp" || lasterr=$?
lasterr=""
chmod "$dirmode" "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
else
if test ! -z "$dirmode"; then
echo "chmod $dirmode $pathcomp"
lasterr=
chmod "$dirmode" "$pathcomp" || lasterr=$?
if test ! -z "$lasterr"; then
errstatus=$lasterr
fi
if test ! -z "$lasterr"; then
errstatus=$lasterr
fi
fi
fi
fi
fi
pathcomp="$pathcomp/"
done
pathcomp=$pathcomp/
done
done
exit $errstatus
# Local Variables:
# mode: shell-script
# sh-indentation: 3
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
# mkinstalldirs ends here

42
build-scripts/os2-buildbot.sh Executable file
View file

@ -0,0 +1,42 @@
#!/bin/bash
# This is the script buildbot.libsdl.org uses to cross-compile SDL2 from
# x86 Linux to OS/2, using OpenWatcom.
# The final zipfile can be unpacked on any machine that supports OpenWatcom
# (Windows, Linux, OS/2, etc). Point the compiler at the include directory
# and link against the SDL2.lib file. Ship the SDL2.dll with your app.
if [ -z "$WATCOM" ]; then
echo "This script expects \$WATCOM to be set to the OpenWatcom install dir." 1>&2
echo "This is often something like '/usr/local/share/watcom'" 1>&2
exit 1
fi
export PATH="$WATCOM/binl:$PATH"
ZIPFILE="$1"
if [ -z $1 ]; then
ZIPFILE=sdl-os2.zip
fi
ZIPDIR=SDL2-os2
set -e
set -x
cd `dirname "$0"`
cd ..
rm -f $ZIPFILE
wmake -f Makefile.os2
rm -rf $ZIPDIR
mkdir $ZIPDIR
chmod a+r SDL2.lib SDL2.dll
mv SDL2.lib SDL2.dll $ZIPDIR/
cp -R include $ZIPDIR/
zip -9r "$ZIPFILE" $ZIPDIR
wmake -f Makefile.os2 distclean
set +x
echo "All done. Final installable is in $ZIPFILE ...";

View file

@ -42,7 +42,7 @@ SYSROOT="/opt/rpi-sysroot"
export CC="ccache /opt/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc --sysroot=$SYSROOT -I$SYSROOT/opt/vc/include -I$SYSROOT/usr/include -I$SYSROOT/opt/vc/include/interface/vcos/pthreads -I$SYSROOT/opt/vc/include/interface/vmcs_host/linux -L$SYSROOT/opt/vc/lib"
# -L$SYSROOT/usr/lib/arm-linux-gnueabihf"
# !!! FIXME: shouldn't have to --disable-* things here.
../configure --with-sysroot=$SYSROOT --host=arm-raspberry-linux-gnueabihf --prefix=$PWD/rpi-sdl2-installed --disable-pulseaudio --disable-esd --disable-video-mir --disable-video-wayland
../configure --with-sysroot=$SYSROOT --host=arm-raspberry-linux-gnueabihf --prefix=$PWD/rpi-sdl2-installed --disable-pulseaudio --disable-esd --disable-video-wayland
$MAKE
$MAKE install
# Fix up a few things to a real install path on a real Raspberry Pi...

View file

@ -39,7 +39,7 @@
#
# Base version of SDL, used for packaging purposes
$SDLVersion = "2.0.7"
$SDLVersion = "2.0.12"
# Gets the .bat file that sets up an MSBuild environment, given one of
# Visual Studio's, "PlatformToolset"s.

View file

@ -381,9 +381,21 @@ macro(CheckX11)
FindLibraryAndSONAME("${_LIB}")
endforeach()
find_path(X_INCLUDEDIR X11/Xlib.h)
find_path(X_INCLUDEDIR X11/Xlib.h
/usr/pkg/xorg/include
/usr/X11R6/include
/usr/X11R7/include
/usr/local/include/X11
/usr/include/X11
/usr/openwin/include
/usr/openwin/share/include
/opt/graphics/OpenGL/include
/opt/X11/include
)
if(X_INCLUDEDIR)
set(X_CFLAGS "-I${X_INCLUDEDIR}")
list(APPEND EXTRA_CFLAGS "-I${X_INCLUDEDIR}")
list(APPEND CMAKE_REQUIRED_INCLUDES "${X_INCLUDEDIR}")
endif()
check_include_file(X11/Xcursor/Xcursor.h HAVE_XCURSOR_H)
@ -420,7 +432,7 @@ macro(CheckX11)
endif()
if(NOT HAVE_SHMAT)
add_definitions(-DNO_SHARED_MEMORY)
set(X_CFLAGS "${X_CFLAGS} -DNO_SHARED_MEMORY")
list(APPEND EXTRA_CFLAGS "-DNO_SHARED_MEMORY")
endif()
endif()
@ -439,8 +451,6 @@ macro(CheckX11)
endif()
endif()
set(SDL_CFLAGS "${SDL_CFLAGS} ${X_CFLAGS}")
set(CMAKE_REQUIRED_LIBRARIES ${X11_LIB} ${X11_LIB})
check_c_source_compiles("
#include <X11/Xlib.h>
@ -554,46 +564,6 @@ macro(CheckX11)
endif()
endmacro()
# Requires:
# - EGL
# - PkgCheckModules
# Optional:
# - MIR_SHARED opt
# - HAVE_DLOPEN opt
macro(CheckMir)
if(VIDEO_MIR)
find_library(MIR_LIB mirclient mircommon egl)
pkg_check_modules(MIR_TOOLKIT mirclient>=0.26 mircommon)
pkg_check_modules(EGL egl)
pkg_check_modules(XKB xkbcommon)
if (MIR_LIB AND MIR_TOOLKIT_FOUND AND EGL_FOUND AND XKB_FOUND)
set(HAVE_VIDEO_MIR TRUE)
set(HAVE_SDL_VIDEO TRUE)
file(GLOB MIR_SOURCES ${SDL2_SOURCE_DIR}/src/video/mir/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${MIR_SOURCES})
set(SDL_VIDEO_DRIVER_MIR 1)
list(APPEND EXTRA_CFLAGS ${MIR_TOOLKIT_CFLAGS} ${EGL_CFLAGS} ${XKB_CFLAGS})
if(MIR_SHARED)
if(NOT HAVE_DLOPEN)
message_warn("You must have SDL_LoadObject() support for dynamic Mir loading")
else()
FindLibraryAndSONAME(mirclient)
FindLibraryAndSONAME(xkbcommon)
set(SDL_VIDEO_DRIVER_MIR_DYNAMIC "\"${MIRCLIENT_LIB_SONAME}\"")
set(SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON "\"${XKBCOMMON_LIB_SONAME}\"")
set(HAVE_MIR_SHARED TRUE)
endif()
else()
set(EXTRA_LIBS ${MIR_TOOLKIT_LIBRARIES} ${EXTRA_LIBS})
endif()
endif()
endif()
endmacro()
macro(WaylandProtocolGen _SCANNER _XML _PROTL)
set(_WAYLAND_PROT_C_CODE "${CMAKE_CURRENT_BINARY_DIR}/wayland-generated-protocols/${_PROTL}-protocol.c")
set(_WAYLAND_PROT_H_CODE "${CMAKE_CURRENT_BINARY_DIR}/wayland-generated-protocols/${_PROTL}-client-protocol.h")
@ -625,35 +595,6 @@ macro(CheckWayland)
if(VIDEO_WAYLAND)
pkg_check_modules(WAYLAND wayland-client wayland-scanner wayland-protocols wayland-egl wayland-cursor egl xkbcommon)
# We have to generate some protocol interface code for some various Wayland features.
if(WAYLAND_FOUND)
execute_process(
COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=pkgdatadir wayland-client
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
RESULT_VARIABLE WAYLAND_CORE_PROTOCOL_DIR_RC
OUTPUT_VARIABLE WAYLAND_CORE_PROTOCOL_DIR
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(NOT WAYLAND_CORE_PROTOCOL_DIR_RC EQUAL 0)
set(WAYLAND_FOUND FALSE)
endif()
endif()
if(WAYLAND_FOUND)
execute_process(
COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=pkgdatadir wayland-protocols
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
RESULT_VARIABLE WAYLAND_PROTOCOLS_DIR_RC
OUTPUT_VARIABLE WAYLAND_PROTOCOLS_DIR
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(NOT WAYLAND_PROTOCOLS_DIR_RC EQUAL 0)
set(WAYLAND_FOUND FALSE)
endif()
endif()
if(WAYLAND_FOUND)
execute_process(
COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=wayland_scanner wayland-scanner
@ -685,11 +626,10 @@ macro(CheckWayland)
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/wayland-generated-protocols")
include_directories("${CMAKE_CURRENT_BINARY_DIR}/wayland-generated-protocols")
WaylandProtocolGen("${WAYLAND_SCANNER}" "${WAYLAND_CORE_PROTOCOL_DIR}/wayland.xml" "wayland")
foreach(_PROTL relative-pointer-unstable-v1 pointer-constraints-unstable-v1 xdg-shell-unstable-v6)
string(REGEX REPLACE "\\-unstable\\-.*$" "" PROTSUBDIR ${_PROTL})
WaylandProtocolGen("${WAYLAND_SCANNER}" "${WAYLAND_PROTOCOLS_DIR}/unstable/${PROTSUBDIR}/${_PROTL}.xml" "${_PROTL}")
file(GLOB WAYLAND_PROTOCOLS_XML RELATIVE "${SDL2_SOURCE_DIR}/wayland-protocols/" "${SDL2_SOURCE_DIR}/wayland-protocols/*.xml")
foreach(_XML ${WAYLAND_PROTOCOLS_XML})
string(REGEX REPLACE "\\.xml$" "" _PROTL "${_XML}")
WaylandProtocolGen("${WAYLAND_SCANNER}" "${SDL2_SOURCE_DIR}/wayland-protocols/${_XML}" "${_PROTL}")
endforeach()
if(VIDEO_WAYLAND_QT_TOUCH)
@ -1125,6 +1065,44 @@ macro(CheckUSBHID)
endif()
endmacro()
# Check for HIDAPI joystick drivers. This is currently a Unix thing, not Windows or macOS!
macro(CheckHIDAPI)
if(HIDAPI)
if(HIDAPI_SKIP_LIBUSB)
set(HAVE_HIDAPI TRUE)
else()
set(HAVE_HIDAPI FALSE)
pkg_check_modules(LIBUSB libusb)
if (LIBUSB_FOUND)
check_include_file(libusb.h HAVE_LIBUSB_H ${LIBUSB_CFLAGS})
if (HAVE_LIBUSB_H)
set(HAVE_HIDAPI TRUE)
endif()
endif()
endif()
if(HAVE_HIDAPI)
set(SDL_JOYSTICK_HIDAPI 1)
set(HAVE_SDL_JOYSTICK TRUE)
file(GLOB HIDAPI_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/hidapi/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${HIDAPI_SOURCES})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBUSB_CFLAGS} -I${SDL2_SOURCE_DIR}/src/hidapi/hidapi")
if(NOT HIDAPI_SKIP_LIBUSB)
if(HIDAPI_ONLY_LIBUSB)
set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/hidapi/libusb/hid.c)
list(APPEND EXTRA_LIBS ${LIBUSB_LIBS})
else()
set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/hidapi/SDL_hidapi.c)
# libusb is loaded dynamically, so don't add it to EXTRA_LIBS
FindLibraryAndSONAME("usb-1.0")
set(SDL_LIBUSB_DYNAMIC "\"${USB_LIB_SONAME}\"")
endif()
endif()
endif()
endif()
endmacro()
# Requires:
# - n/a
macro(CheckRPI)

2486
configure vendored

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

24
debian/changelog vendored
View file

@ -1,3 +1,27 @@
libsdl2 (2.0.12) UNRELEASED; urgency=low
* Updated SDL to version 2.0.12 for development builds
-- Sam Lantinga <slouken@libsdl.org> Sun, 1 Mar 2020 14:57:07 -0800
libsdl2 (2.0.11) UNRELEASED; urgency=low
* Updated SDL to version 2.0.11 for development builds
-- Sam Lantinga <slouken@libsdl.org> Sun, 22 Sep 2019 10:33:03 -0800
libsdl2 (2.0.10) UNRELEASED; urgency=low
* Updated SDL to version 2.0.10
-- Sam Lantinga <slouken@libsdl.org> Mon, 17 Jun 2019 08:48:47 -0800
libsdl2 (2.0.9) UNRELEASED; urgency=low
* Updated SDL to version 2.0.9
-- Sam Lantinga <slouken@libsdl.org> Wed, 26 Sep 2018 10:02:21 -0800
libsdl2 (2.0.8) UNRELEASED; urgency=low
* Updated SDL to version 2.0.8

12
debian/copyright vendored
View file

@ -4,7 +4,7 @@ Upstream-Contact: Sam Lantinga <slouken@libsdl.org>
Source: http://www.libsdl.org/
Files: *
Copyright: 1997-2018 Sam Lantinga <slouken@libsdl.org>
Copyright: 1997-2020 Sam Lantinga <slouken@libsdl.org>
License: zlib/libpng
Files: src/libm/*
@ -12,7 +12,7 @@ Copyright: 1993 by Sun Microsystems, Inc. All rights reserved.
License: SunPro
Files: src/main/windows/SDL_windows_main.c
Copyright: 2018 Sam Lantinga
Copyright: 2020 Sam Lantinga
License: PublicDomain_Sam_Lantinga
Comment: SDL_main.c, placed in the public domain by Sam Lantinga 4/13/98
@ -32,7 +32,7 @@ Copyright: 1995 Erik Corry
License: BrownUn_UnCalifornia_ErikCorry
Files: src/test/SDL_test_md5.c
Copyright: 1997-2018 Sam Lantinga <slouken@libsdl.org>
Copyright: 1997-2020 Sam Lantinga <slouken@libsdl.org>
1990 RSA Data Security, Inc.
License: zlib/libpng and RSA_Data_Security
@ -46,12 +46,12 @@ Copyright: 1994-2003 The XFree86 Project, Inc.
License: MIT/X11
Files: test/testhaptic.c
Copyright: 1997-2018 Sam Lantinga <slouken@libsdl.org>
Copyright: 1997-2020 Sam Lantinga <slouken@libsdl.org>
2008 Edgar Simo Serra
License: BSD_3_clause
Files: test/testrumble.c
Copyright: 1997-2018 Sam Lantinga <slouken@libsdl.org>
Copyright: 1997-2020 Sam Lantinga <slouken@libsdl.org>
2011 Edgar Simo Serra
License: BSD_3_clause
@ -169,7 +169,7 @@ License: BSD_3_clause
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Comment:
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
.
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages

View file

@ -5,4 +5,5 @@ usr/lib/*/*.la
usr/lib/*/*.so
usr/lib/*/pkgconfig/sdl2.pc
usr/lib/*/cmake/SDL2/sdl2-config.cmake
usr/lib/*/cmake/SDL2/sdl2-config-version.cmake
usr/share/aclocal/sdl2.m4

19
debian/rules vendored
View file

@ -4,9 +4,22 @@ DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
confflags = --disable-rpath --disable-video-directfb \
--disable-nas --disable-esd --disable-arts \
--disable-alsa-shared --disable-pulseaudio-shared \
--disable-x11-shared
--disable-nas --disable-esd --disable-arts
# These flags can be used to create a package directly linking with external libraries and having the appropriate package dependencies
#confflags += --disable-alsa-shared
#confflags += --disable-arts-shared
#confflags += --disable-directfb-shared
#confflags += --disable-esd-shared
#confflags += --disable-fusionsound-shared
#confflags += --disable-jack-shared
#confflags += --disable-kmsdrm-shared
#confflags += --disable-libsamplerate-shared
#confflags += --disable-nas-shared
#confflags += --disable-pulseaudio-shared
#confflags += --disable-sndio-shared
#confflags += --disable-wayland-shared
#confflags += --disable-x11-shared
%:
dh $@ --parallel

View file

@ -14,13 +14,13 @@ supported, but you can use the "android-project-ant" directory as a template.
Requirements
================================================================================
Android SDK (version 19 or later)
Android SDK (version 26 or later)
https://developer.android.com/sdk/index.html
Android NDK r10e or later
Android NDK r15c or later
https://developer.android.com/tools/sdk/ndk/index.html
Minimum API level supported by SDL: 14 (Android 4.0.1)
Minimum API level supported by SDL: 16 (Android 4.1)
================================================================================
@ -77,25 +77,42 @@ For more complex projects, follow these instructions:
and rename it to the name of your project.
2. Move or symlink this SDL directory into the "<project>/app/jni" directory
3. Edit "<project>/app/jni/src/Android.mk" to include your source files
4. Run 'ndk-build' (a script provided by the NDK). This compiles the C source
If you want to use Android Studio (recommended), skip to the Android Studio section below.
4a. If you want to use Android Studio, simply open your <project> directory and start building.
5. Run './gradlew installDebug' in the project directory. This compiles the .java, creates an .apk with the native code embedded, and installs it on any connected Android device
4b. If you want to build manually, run './gradlew installDebug' in the project directory. This compiles the .java, creates an .apk with the native code embedded, and installs it on any connected Android device
If you already have a project that uses CMake, the instructions change somewhat:
1. Do points 1 and 2 from the instruction above.
2. Edit "<project>/app/build.gradle" to comment out or remove sections containing ndk-build
and uncomment the cmake sections. Add arguments to the CMake invocation as needed.
3. Edit "<project>/app/jni/CMakeLists.txt" to include your project (it defaults to
adding the "src" subdirectory). Note that you'll have SDL2, SDL2main and SDL2-static
as targets in your project, so you should have "target_link_libraries(yourgame SDL2 SDL2main)"
in your CMakeLists.txt file. Also be aware that you should use add_library() instead of
add_executable() for the target containing your "main" function.
If you wish to use Android Studio, you can skip the last step.
4. Run './gradlew installDebug' or './gradlew installRelease' in the project directory. It will build and install your .apk on any
connected Android device
Here's an explanation of the files in the Android project, so you can customize them:
android-project/app
build.gradle - build info including the application version and SDK
src/main/AndroidManifest.xml - package manifest. Among others, it contains the class name
of the main Activity and the package name of the application.
src/main/AndroidManifest.xml - package manifest. Among others, it contains the class name of the main Activity and the package name of the application.
jni/ - directory holding native code
jni/Application.mk - Application JNI settings, including target platform and STL library
jni/Android.mk - Android makefile that can call recursively the Android.mk files in all subdirectories
jni/CMakeLists.txt - Top-level CMake project that adds SDL as a subproject
jni/SDL/ - (symlink to) directory holding the SDL library files
jni/SDL/Android.mk - Android makefile for creating the SDL shared library
jni/src/ - directory holding your C/C++ source
jni/src/Android.mk - Android makefile that you should customize to include your source code and any library references
jni/src/CMakeLists.txt - CMake file that you may customize to include your source code and any library references
src/main/assets/ - directory holding asset files for your application
src/main/res/ - directory holding resources for your application
src/main/res/mipmap-* - directories holding icons for different phone hardware
@ -176,7 +193,7 @@ http://ponystyle.com/blog/2010/03/26/dealing-with-asset-compression-in-android-a
Pause / Resume behaviour
================================================================================
If SDL is compiled with SDL_ANDROID_BLOCK_ON_PAUSE defined (the default),
If SDL_HINT_ANDROID_BLOCK_ON_PAUSE hint is set (the default),
the event loop will block itself when the app is paused (ie, when the user
returns to the main Android dashboard). Blocking is better in terms of battery
use, and it allows your app to spring back to life instantaneously after resume
@ -216,26 +233,10 @@ detach it.
You can use STL in your project by creating an Application.mk file in the jni
folder and adding the following line:
APP_STL := stlport_static
APP_STL := c++_shared
For more information check out CPLUSPLUS-SUPPORT.html in the NDK documentation.
================================================================================
Additional documentation
================================================================================
The documentation in the NDK docs directory is very helpful in understanding the
build process and how to work with native code on the Android platform.
The best place to start is with docs/OVERVIEW.TXT
================================================================================
Using Android Studio
================================================================================
You can open your project directory with Android Studio and run it normally.
For more information go here:
https://developer.android.com/ndk/guides/cpp-support
================================================================================
@ -291,7 +292,10 @@ You can see the complete command line that ndk-build is using by passing V=1 on
ndk-build V=1
If your application crashes in native code, you can use addr2line to convert the
If your application crashes in native code, you can use ndk-stack to get a symbolic stack trace:
https://developer.android.com/ndk/guides/ndk-stack
If you want to go through the process manually, you can use addr2line to convert the
addresses in the stack trace to lines in your code.
For example, if your crash looks like this:
@ -395,13 +399,13 @@ https://developer.nvidia.com/tegra-graphics-debugger
================================================================================
Why is API level 14 the minimum required?
Why is API level 16 the minimum required?
================================================================================
The latest NDK toolchain doesn't support targeting earlier than API level 14.
The latest NDK toolchain doesn't support targeting earlier than API level 16.
As of this writing, according to https://developer.android.com/about/dashboards/index.html
about 99% of the Android devices accessing Google Play support API level 14 or
higher (October 2017).
about 99% of the Android devices accessing Google Play support API level 16 or
higher (January 2018).
================================================================================
@ -423,6 +427,24 @@ screen each frame.
Reference: http://www.khronos.org/registry/egl/specs/EGLTechNote0001.html
================================================================================
Ending your application
================================================================================
Two legitimate ways:
- return from your main() function. Java side will automatically terminate the
Activity by calling Activity.finish().
- Android OS can decide to terminate your application by calling onDestroy()
(see Activity life cycle). Your application will receive a SDL_QUIT event you
can handle to save things and quit.
Don't call exit() as it stops the activity badly.
NB: "Back button" can be handled as a SDL_KEYDOWN/UP events, with Keycode
SDLK_AC_BACK, for any purpose.
================================================================================
Known issues
================================================================================

View file

@ -15,7 +15,7 @@ platforms:
* Linux
* VS.NET 2010
* MinGW and Msys
* OS X with support for XCode
* macOS, iOS, and tvOS, with support for XCode
================================================================================
@ -30,3 +30,55 @@ Assuming the source for SDL is located at ~/sdl
cmake ../sdl
This will build the static and dynamic versions of SDL in the ~/build directory.
================================================================================
Usage, iOS/tvOS
================================================================================
CMake 3.14+ natively includes support for iOS and tvOS. SDL binaries may be built
using Xcode or Make, possibly among other build-systems.
When using a recent version of CMake (3.14+), it should be possible to:
- build SDL for iOS, both static and dynamic
- build SDL test apps (as iOS/tvOS .app bundles)
- generate a working SDL_config.h for iOS (using SDL_config.h.cmake as a basis)
To use, set the following CMake variables when running CMake's configuration stage:
- `CMAKE_SYSTEM_NAME=<OS>` (either `iOS` or `tvOS`)
- `CMAKE_OSX_SYSROOT=<SDK>` (examples: `iphoneos`, `iphonesimulator`, `iphoneos12.4`, `/full/path/to/iPhoneOS.sdk`,
`appletvos`, `appletvsimulator`, `appletvos12.4`, `/full/path/to/AppleTVOS.sdk`, etc.)
- `CMAKE_OSX_ARCHITECTURES=<semicolon-separated list of CPU architectures>` (example: "arm64;armv7s;x86_64")
### Examples (for iOS/tvOS):
- for iOS-Simulator, using the latest, installed SDK:
`cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_ARCHITECTURES=x86_64`
- for iOS-Device, using the latest, installed SDK, 64-bit only
`cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES=arm64`
- for iOS-Device, using the latest, installed SDK, mixed 32/64 bit
`cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES="arm64;armv7s"`
- for iOS-Device, using a specific SDK revision (iOS 12.4, in this example):
`cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos12.4 -DCMAKE_OSX_ARCHITECTURES=arm64`
- for iOS-Simulator, using the latest, installed SDK, and building SDL test apps (as .app bundles):
`cmake ~/sdl -DSDL_TEST=1 -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_ARCHITECTURES=x86_64`
- for tvOS-Simulator, using the latest, installed SDK:
`cmake ~/sdl -DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvsimulator -DCMAKE_OSX_ARCHITECTURES=x86_64`
- for tvOS-Device, using the latest, installed SDK:
`cmake ~/sdl -DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvos -DCMAKE_OSX_ARCHITECTURES=arm64`

View file

@ -25,9 +25,6 @@ fcitx-libs-dev libsamplerate0-dev libsndio-dev
Ubuntu 16.04+ can also add "libwayland-dev libxkbcommon-dev wayland-protocols"
to that command line for Wayland support.
Ubuntu 16.10 can also add "libmirclient-dev libxkbcommon-dev" to that command
line for Mir support.
NOTES:
- This includes all the audio targets except arts, because Ubuntu pulled the
artsc0-dev package, but in theory SDL still supports it.

View file

@ -100,7 +100,7 @@ You should replace EXE_NAME with the name of the executable. APP_NAME is what
will be visible to the user in the Finder. Usually it will be the same
as EXE_NAME but capitalized. E.g. if EXE_NAME is "testgame" then APP_NAME
usually is "TestGame". You might also want to use `@PACKAGE@` to use the package
name as specified in your configure.in file.
name as specified in your configure.ac file.
If your project builds more than one application, you will have to do a bit
more. For each of your target applications, you need a separate rule.

View file

@ -13,7 +13,7 @@ There are two basic ways of building SDL at the moment:
1. The "UNIX" way: ./configure; make; make install
If you have a GNUish system, then you might try this. Edit configure.in,
If you have a GNUish system, then you might try this. Edit configure.ac,
take a look at the large section labelled:
"Set up the configuration based on the host platform!"

View file

@ -27,6 +27,16 @@ OpenGL ES 2.x, it usually comes pre-installed, but in any case:
sudo apt-get install libraspberrypi0 libraspberrypi-bin libraspberrypi-dev
================================================================================
NEON
================================================================================
If your Pi has NEON support, make sure you add -mfpu=neon to your CFLAGS so
that SDL will select some otherwise-disabled highly-optimized code. The
original Pi units don't have NEON, the Pi2 probably does, and the Pi3
definitely does.
================================================================================
Cross compiling from x86 Linux
================================================================================

View file

@ -296,7 +296,7 @@ A few files should be included directly in your app's MSVC project, specifically
included, mouse-position reporting may fail if and when the cursor is
hidden, due to possible bugs/design-oddities in Windows itself.*
To include these files:
To include these files for C/C++ projects:
1. right-click on your project (again, in Visual C++'s Solution Explorer),
navigate to "Add", then choose "Existing Item...".
@ -313,11 +313,14 @@ To include these files:
7. change the setting for "Consume Windows Runtime Extension" to "Yes (/ZW)".
8. click the OK button. This will close the dialog.
**NOTE: C++/CX compilation is currently required in at least one file of your
app's project. This is to make sure that Visual C++'s linker builds a 'Windows
Metadata' file (.winmd) for your app. Not doing so can lead to build errors.**
For non-C++ projects, you will need to call SDL_WinRTRunApp from your language's
main function, and generate SDL2-WinRTResources.res manually by using `rc` via
the Developer Command Prompt and including it as a <Win32Resource> within the
first <PropertyGroup> block in your Visual Studio project file.
### 6. Add app code and assets ###

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -47,10 +47,12 @@
#include "SDL_loadso.h"
#include "SDL_log.h"
#include "SDL_messagebox.h"
#include "SDL_metal.h"
#include "SDL_mutex.h"
#include "SDL_power.h"
#include "SDL_render.h"
#include "SDL_rwops.h"
#include "SDL_sensor.h"
#include "SDL_shape.h"
#include "SDL_system.h"
#include "SDL_thread.h"
@ -80,10 +82,11 @@ extern "C" {
#define SDL_INIT_HAPTIC 0x00001000u
#define SDL_INIT_GAMECONTROLLER 0x00002000u /**< SDL_INIT_GAMECONTROLLER implies SDL_INIT_JOYSTICK */
#define SDL_INIT_EVENTS 0x00004000u
#define SDL_INIT_SENSOR 0x00008000u
#define SDL_INIT_NOPARACHUTE 0x00100000u /**< compatibility; this flag is ignored. */
#define SDL_INIT_EVERYTHING ( \
SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \
SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER \
SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER | SDL_INIT_SENSOR \
)
/* @} */

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -162,12 +162,29 @@ extern DECLSPEC void SDLCALL SDL_MemoryBarrierAcquireFunction(void);
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory")
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory")
#elif defined(__GNUC__) && defined(__arm__)
#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__)
#if 0 /* defined(__LINUX__) || defined(__ANDROID__) */
/* Information from:
https://chromium.googlesource.com/chromium/chromium/+/trunk/base/atomicops_internals_arm_gcc.h#19
The Linux kernel provides a helper function which provides the right code for a memory barrier,
hard-coded at address 0xffff0fa0
*/
typedef void (*SDL_KernelMemoryBarrierFunc)();
#define SDL_MemoryBarrierRelease() ((SDL_KernelMemoryBarrierFunc)0xffff0fa0)()
#define SDL_MemoryBarrierAcquire() ((SDL_KernelMemoryBarrierFunc)0xffff0fa0)()
#elif 0 /* defined(__QNXNTO__) */
#include <sys/cpuinline.h>
#define SDL_MemoryBarrierRelease() __cpu_membarrier()
#define SDL_MemoryBarrierAcquire() __cpu_membarrier()
#else
#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) || defined(__ARM_ARCH_8A__)
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory")
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory")
#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_5TE__)
#ifdef __thumb__
/* The mcr instruction isn't available in thumb mode, use real functions */
#define SDL_MEMORY_BARRIER_USES_FUNCTION
#define SDL_MemoryBarrierRelease() SDL_MemoryBarrierReleaseFunction()
#define SDL_MemoryBarrierAcquire() SDL_MemoryBarrierAcquireFunction()
#else
@ -177,6 +194,7 @@ extern DECLSPEC void SDLCALL SDL_MemoryBarrierAcquireFunction(void);
#else
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("" : : : "memory")
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("" : : : "memory")
#endif /* __LINUX__ || __ANDROID__ */
#endif /* __GNUC__ && __arm__ */
#else
#if (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120))

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -140,7 +140,8 @@ typedef Uint16 SDL_AudioFormat;
#define SDL_AUDIO_ALLOW_FREQUENCY_CHANGE 0x00000001
#define SDL_AUDIO_ALLOW_FORMAT_CHANGE 0x00000002
#define SDL_AUDIO_ALLOW_CHANNELS_CHANGE 0x00000004
#define SDL_AUDIO_ALLOW_ANY_CHANGE (SDL_AUDIO_ALLOW_FREQUENCY_CHANGE|SDL_AUDIO_ALLOW_FORMAT_CHANGE|SDL_AUDIO_ALLOW_CHANNELS_CHANGE)
#define SDL_AUDIO_ALLOW_SAMPLES_CHANGE 0x00000008
#define SDL_AUDIO_ALLOW_ANY_CHANGE (SDL_AUDIO_ALLOW_FREQUENCY_CHANGE|SDL_AUDIO_ALLOW_FORMAT_CHANGE|SDL_AUDIO_ALLOW_CHANNELS_CHANGE|SDL_AUDIO_ALLOW_SAMPLES_CHANGE)
/* @} */
/* @} *//* Audio flags */
@ -419,23 +420,56 @@ extern DECLSPEC void SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev,
/* @} *//* Pause audio functions */
/**
* This function loads a WAVE from the data source, automatically freeing
* that source if \c freesrc is non-zero. For example, to load a WAVE file,
* you could do:
* \brief Load the audio data of a WAVE file into memory
*
* Loading a WAVE file requires \c src, \c spec, \c audio_buf and \c audio_len
* to be valid pointers. The entire data portion of the file is then loaded
* into memory and decoded if necessary.
*
* If \c freesrc is non-zero, the data source gets automatically closed and
* freed before the function returns.
*
* Supported are RIFF WAVE files with the formats PCM (8, 16, 24, and 32 bits),
* IEEE Float (32 bits), Microsoft ADPCM and IMA ADPCM (4 bits), and A-law and
* µ-law (8 bits). Other formats are currently unsupported and cause an error.
*
* If this function succeeds, the pointer returned by it is equal to \c spec
* and the pointer to the audio data allocated by the function is written to
* \c audio_buf and its length in bytes to \c audio_len. The \ref SDL_AudioSpec
* members \c freq, \c channels, and \c format are set to the values of the
* audio data in the buffer. The \c samples member is set to a sane default and
* all others are set to zero.
*
* It's necessary to use SDL_FreeWAV() to free the audio data returned in
* \c audio_buf when it is no longer used.
*
* Because of the underspecification of the Waveform format, there are many
* problematic files in the wild that cause issues with strict decoders. To
* provide compatibility with these files, this decoder is lenient in regards
* to the truncation of the file, the fact chunk, and the size of the RIFF
* chunk. The hints SDL_HINT_WAVE_RIFF_CHUNK_SIZE, SDL_HINT_WAVE_TRUNCATION,
* and SDL_HINT_WAVE_FACT_CHUNK can be used to tune the behavior of the
* loading process.
*
* Any file that is invalid (due to truncation, corruption, or wrong values in
* the headers), too big, or unsupported causes an error. Additionally, any
* critical I/O error from the data source will terminate the loading process
* with an error. The function returns NULL on error and in all cases (with the
* exception of \c src being NULL), an appropriate error message will be set.
*
* It is required that the data source supports seeking.
*
* Example:
* \code
* SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...);
* \endcode
*
* If this function succeeds, it returns the given SDL_AudioSpec,
* filled with the audio data format of the wave data, and sets
* \c *audio_buf to a malloc()'d buffer containing the audio data,
* and sets \c *audio_len to the length of that audio buffer, in bytes.
* You need to free the audio buffer with SDL_FreeWAV() when you are
* done with it.
*
* This function returns NULL and sets the SDL error message if the
* wave file cannot be opened, uses an unknown data format, or is
* corrupt. Currently raw and MS-ADPCM WAVE files are supported.
* \param src The data source with the WAVE data
* \param freesrc A integer value that makes the function close the data source if non-zero
* \param spec A pointer filled with the audio format of the audio data
* \param audio_buf A pointer filled with the audio data allocated by the function
* \param audio_len A pointer filled with the length of the audio data buffer in bytes
* \return NULL on error, or non-NULL on success.
*/
extern DECLSPEC SDL_AudioSpec *SDLCALL SDL_LoadWAV_RW(SDL_RWops * src,
int freesrc,

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -101,6 +101,15 @@ SDL_MostSignificantBitIndex32(Uint32 x)
#endif
}
SDL_FORCE_INLINE SDL_bool
SDL_HasExactlyOneBitSet32(Uint32 x)
{
if (x && !(x & (x - 1))) {
return SDL_TRUE;
}
return SDL_FALSE;
}
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -50,6 +50,9 @@ typedef enum
SDL_BLENDMODE_MOD = 0x00000004, /**< color modulate
dstRGB = srcRGB * dstRGB
dstA = dstA */
SDL_BLENDMODE_MUL = 0x00000008, /**< color multiply
dstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA))
dstA = (srcA * dstA) + (dstA * (1-srcA)) */
SDL_BLENDMODE_INVALID = 0x7FFFFFFF
/* Additional custom blend modes can be returned by SDL_ComposeCustomBlendMode() */
@ -90,12 +93,12 @@ typedef enum
/**
* \brief Create a custom blend mode, which may or may not be supported by a given renderer
*
* \param srcColorFactor
* \param dstColorFactor
* \param colorOperation
* \param srcAlphaFactor
* \param dstAlphaFactor
* \param alphaOperation
* \param srcColorFactor source color factor
* \param dstColorFactor destination color factor
* \param colorOperation color operation
* \param srcAlphaFactor source alpha factor
* \param dstAlphaFactor destination alpha factor
* \param alphaOperation alpha operation
*
* The result of the blend mode operation will be:
* dstRGB = dstRGB * dstColorFactor colorOperation srcRGB * srcColorFactor

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -41,8 +41,10 @@
#include "SDL_config_android.h"
#elif defined(__PSP__)
#include "SDL_config_psp.h"
#elif defined(__OS2__)
#include "SDL_config_os2.h"
#else
/* This is a minimal configuration just to get SDL running on new platforms */
/* This is a minimal configuration just to get SDL running on new platforms. */
#include "SDL_config_minimal.h"
#endif /* platform config */

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -96,7 +96,10 @@
#cmakedefine HAVE_WCSLEN 1
#cmakedefine HAVE_WCSLCPY 1
#cmakedefine HAVE_WCSLCAT 1
#cmakedefine HAVE_WCSDUP 1
#cmakedefine HAVE_WCSSTR 1
#cmakedefine HAVE_WCSCMP 1
#cmakedefine HAVE_WCSNCMP 1
#cmakedefine HAVE_STRLEN 1
#cmakedefine HAVE_STRLCPY 1
#cmakedefine HAVE_STRLCAT 1
@ -108,6 +111,8 @@
#cmakedefine HAVE_STRCHR 1
#cmakedefine HAVE_STRRCHR 1
#cmakedefine HAVE_STRSTR 1
#cmakedefine HAVE_STRTOK_R 1
#cmakedefine HAVE_STRTOK_S 1
#cmakedefine HAVE_ITOA 1
#cmakedefine HAVE__LTOA 1
#cmakedefine HAVE__UITOA 1
@ -127,6 +132,7 @@
#cmakedefine HAVE_STRCASECMP 1
#cmakedefine HAVE__STRNICMP 1
#cmakedefine HAVE_STRNCASECMP 1
#cmakedefine HAVE_SSCANF 1
#cmakedefine HAVE_VSSCANF 1
#cmakedefine HAVE_VSNPRINTF 1
#cmakedefine HAVE_M_PI 1
@ -144,6 +150,8 @@
#cmakedefine HAVE_COPYSIGNF 1
#cmakedefine HAVE_COS 1
#cmakedefine HAVE_COSF 1
#cmakedefine HAVE_EXP 1
#cmakedefine HAVE_EXPF 1
#cmakedefine HAVE_FABS 1
#cmakedefine HAVE_FABSF 1
#cmakedefine HAVE_FLOOR 1
@ -182,6 +190,7 @@
#cmakedefine HAVE_SEM_TIMEDWAIT 1
#cmakedefine HAVE_GETAUXVAL 1
#cmakedefine HAVE_POLL 1
#cmakedefine HAVE__EXIT 1
#elif __WIN32__
#cmakedefine HAVE_STDARG_H 1
@ -207,6 +216,10 @@
#cmakedefine HAVE_DINPUT_H @HAVE_DINPUT_H@
#cmakedefine HAVE_XINPUT_H @HAVE_XINPUT_H@
#cmakedefine HAVE_DXGI_H @HAVE_DXGI_H@
#cmakedefine HAVE_MMDEVICEAPI_H @HAVE_MMDEVICEAPI_H@
#cmakedefine HAVE_AUDIOCLIENT_H @HAVE_AUDIOCLIENT_H@
#cmakedefine HAVE_XINPUT_GAMEPAD_EX @HAVE_XINPUT_GAMEPAD_EX@
#cmakedefine HAVE_XINPUT_STATE_EX @HAVE_XINPUT_STATE_EX@
@ -221,6 +234,7 @@
#cmakedefine SDL_FILE_DISABLED @SDL_FILE_DISABLED@
#cmakedefine SDL_JOYSTICK_DISABLED @SDL_JOYSTICK_DISABLED@
#cmakedefine SDL_HAPTIC_DISABLED @SDL_HAPTIC_DISABLED@
#cmakedefine SDL_SENSOR_DISABLED @SDL_SENSOR_DISABLED@
#cmakedefine SDL_LOADSO_DISABLED @SDL_LOADSO_DISABLED@
#cmakedefine SDL_RENDER_DISABLED @SDL_RENDER_DISABLED@
#cmakedefine SDL_THREADS_DISABLED @SDL_THREADS_DISABLED@
@ -277,6 +291,7 @@
#cmakedefine SDL_JOYSTICK_WINMM @SDL_JOYSTICK_WINMM@
#cmakedefine SDL_JOYSTICK_USBHID @SDL_JOYSTICK_USBHID@
#cmakedefine SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H @SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H@
#cmakedefine SDL_JOYSTICK_HIDAPI @SDL_JOYSTICK_HIDAPI@
#cmakedefine SDL_JOYSTICK_EMSCRIPTEN @SDL_JOYSTICK_EMSCRIPTEN@
#cmakedefine SDL_HAPTIC_DUMMY @SDL_HAPTIC_DUMMY@
#cmakedefine SDL_HAPTIC_LINUX @SDL_HAPTIC_LINUX@
@ -284,6 +299,12 @@
#cmakedefine SDL_HAPTIC_DINPUT @SDL_HAPTIC_DINPUT@
#cmakedefine SDL_HAPTIC_XINPUT @SDL_HAPTIC_XINPUT@
#cmakedefine SDL_HAPTIC_ANDROID @SDL_HAPTIC_ANDROID@
#cmakedefine SDL_LIBUSB_DYNAMIC @SDL_LIBUSB_DYNAMIC@
/* Enable various sensor drivers */
#cmakedefine SDL_SENSOR_ANDROID @SDL_SENSOR_ANDROID@
#cmakedefine SDL_SENSOR_COREMOTION @SDL_SENSOR_COREMOTION@
#cmakedefine SDL_SENSOR_DUMMY @SDL_SENSOR_DUMMY@
/* Enable various shared object loading systems */
#cmakedefine SDL_LOADSO_DLOPEN @SDL_LOADSO_DLOPEN@
@ -308,9 +329,11 @@
#cmakedefine SDL_VIDEO_DRIVER_ANDROID @SDL_VIDEO_DRIVER_ANDROID@
#cmakedefine SDL_VIDEO_DRIVER_HAIKU @SDL_VIDEO_DRIVER_HAIKU@
#cmakedefine SDL_VIDEO_DRIVER_COCOA @SDL_VIDEO_DRIVER_COCOA@
#cmakedefine SDL_VIDEO_DRIVER_UIKIT @SDL_VIDEO_DRIVER_UIKIT@
#cmakedefine SDL_VIDEO_DRIVER_DIRECTFB @SDL_VIDEO_DRIVER_DIRECTFB@
#cmakedefine SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC @SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC@
#cmakedefine SDL_VIDEO_DRIVER_DUMMY @SDL_VIDEO_DRIVER_DUMMY@
#cmakedefine SDL_VIDEO_DRIVER_OFFSCREEN @SDL_VIDEO_DRIVER_OFFSCREEN@
#cmakedefine SDL_VIDEO_DRIVER_WINDOWS @SDL_VIDEO_DRIVER_WINDOWS@
#cmakedefine SDL_VIDEO_DRIVER_WAYLAND @SDL_VIDEO_DRIVER_WAYLAND@
#cmakedefine SDL_VIDEO_DRIVER_RPI @SDL_VIDEO_DRIVER_RPI@
@ -327,9 +350,6 @@
#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR@
#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON@
#cmakedefine SDL_VIDEO_DRIVER_MIR @SDL_VIDEO_DRIVER_MIR@
#cmakedefine SDL_VIDEO_DRIVER_MIR_DYNAMIC @SDL_VIDEO_DRIVER_MIR_DYNAMIC@
#cmakedefine SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON @SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON@
#cmakedefine SDL_VIDEO_DRIVER_EMSCRIPTEN @SDL_VIDEO_DRIVER_EMSCRIPTEN@
#cmakedefine SDL_VIDEO_DRIVER_X11 @SDL_VIDEO_DRIVER_X11@
#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC @SDL_VIDEO_DRIVER_X11_DYNAMIC@
@ -376,11 +396,15 @@
/* Enable Vulkan support */
#cmakedefine SDL_VIDEO_VULKAN @SDL_VIDEO_VULKAN@
/* Enable Metal support */
#cmakedefine SDL_VIDEO_METAL @SDL_VIDEO_METAL@
/* Enable system power support */
#cmakedefine SDL_POWER_ANDROID @SDL_POWER_ANDROID@
#cmakedefine SDL_POWER_LINUX @SDL_POWER_LINUX@
#cmakedefine SDL_POWER_WINDOWS @SDL_POWER_WINDOWS@
#cmakedefine SDL_POWER_MACOSX @SDL_POWER_MACOSX@
#cmakedefine SDL_POWER_UIKIT @SDL_POWER_UIKIT@
#cmakedefine SDL_POWER_HAIKU @SDL_POWER_HAIKU@
#cmakedefine SDL_POWER_EMSCRIPTEN @SDL_POWER_EMSCRIPTEN@
#cmakedefine SDL_POWER_HARDWIRED @SDL_POWER_HARDWIRED@
@ -397,11 +421,16 @@
/* Enable assembly routines */
#cmakedefine SDL_ASSEMBLY_ROUTINES @SDL_ASSEMBLY_ROUTINES@
#cmakedefine SDL_ALTIVEC_BLITTERS @SDL_ALTIVEC_BLITTERS@
#cmakedefine SDL_ARM_SIMD_BLITTERS @SDL_ARM_SIMD_BLITTERS@
#cmakedefine SDL_ARM_NEON_BLITTERS @SDL_ARM_NEON_BLITTERS@
/* Enable dynamic libsamplerate support */
#cmakedefine SDL_LIBSAMPLERATE_DYNAMIC @SDL_LIBSAMPLERATE_DYNAMIC@
/* Platform specific definitions */
#cmakedefine SDL_IPHONE_KEYBOARD @SDL_IPHONE_KEYBOARD@
#cmakedefine SDL_IPHONE_LAUNCHSCREEN @SDL_IPHONE_LAUNCHSCREEN@
#if !defined(__WIN32__)
# if !defined(_STDINT_H_) && !defined(_STDINT_H) && !defined(HAVE_STDINT_H) && !defined(_HAVE_STDINT_H)
typedef unsigned int size_t;

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -33,7 +33,7 @@
/* Make sure that this isn't included by Visual C++ */
#ifdef _MSC_VER
#error You should run hg revert SDL_config.h
#error You should run hg revert SDL_config.h
#endif
/* C language features */
@ -99,7 +99,10 @@
#undef HAVE_WCSLEN
#undef HAVE_WCSLCPY
#undef HAVE_WCSLCAT
#undef HAVE_WCSDUP
#undef HAVE_WCSSTR
#undef HAVE_WCSCMP
#undef HAVE_WCSNCMP
#undef HAVE_STRLEN
#undef HAVE_STRLCPY
#undef HAVE_STRLCAT
@ -111,6 +114,8 @@
#undef HAVE_STRCHR
#undef HAVE_STRRCHR
#undef HAVE_STRSTR
#undef HAVE_STRTOK_R
#undef HAVE_STRTOK_S
#undef HAVE_ITOA
#undef HAVE__LTOA
#undef HAVE__UITOA
@ -149,6 +154,8 @@
#undef HAVE_COPYSIGNF
#undef HAVE_COS
#undef HAVE_COSF
#undef HAVE_EXP
#undef HAVE_EXPF
#undef HAVE_FABS
#undef HAVE_FABSF
#undef HAVE_FLOOR
@ -187,11 +194,12 @@
#undef HAVE_SEM_TIMEDWAIT
#undef HAVE_GETAUXVAL
#undef HAVE_POLL
#undef HAVE__EXIT
#else
#define HAVE_STDARG_H 1
#define HAVE_STDDEF_H 1
#define HAVE_STDINT_H 1
#define HAVE_STDARG_H 1
#define HAVE_STDDEF_H 1
#define HAVE_STDINT_H 1
#endif /* HAVE_LIBC */
#undef HAVE_ALTIVEC_H
@ -207,6 +215,8 @@
#undef HAVE_DSOUND_H
#undef HAVE_DXGI_H
#undef HAVE_XINPUT_H
#undef HAVE_MMDEVICEAPI_H
#undef HAVE_AUDIOCLIENT_H
#undef HAVE_XINPUT_GAMEPAD_EX
#undef HAVE_XINPUT_STATE_EX
@ -221,6 +231,7 @@
#undef SDL_FILE_DISABLED
#undef SDL_JOYSTICK_DISABLED
#undef SDL_HAPTIC_DISABLED
#undef SDL_SENSOR_DISABLED
#undef SDL_LOADSO_DISABLED
#undef SDL_RENDER_DISABLED
#undef SDL_THREADS_DISABLED
@ -277,6 +288,7 @@
#undef SDL_JOYSTICK_WINMM
#undef SDL_JOYSTICK_USBHID
#undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H
#undef SDL_JOYSTICK_HIDAPI
#undef SDL_JOYSTICK_EMSCRIPTEN
#undef SDL_HAPTIC_DUMMY
#undef SDL_HAPTIC_ANDROID
@ -285,6 +297,10 @@
#undef SDL_HAPTIC_DINPUT
#undef SDL_HAPTIC_XINPUT
/* Enable various sensor drivers */
#undef SDL_SENSOR_ANDROID
#undef SDL_SENSOR_DUMMY
/* Enable various shared object loading systems */
#undef SDL_LOADSO_DLOPEN
#undef SDL_LOADSO_DUMMY
@ -316,9 +332,6 @@
#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL
#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR
#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON
#undef SDL_VIDEO_DRIVER_MIR
#undef SDL_VIDEO_DRIVER_MIR_DYNAMIC
#undef SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON
#undef SDL_VIDEO_DRIVER_X11
#undef SDL_VIDEO_DRIVER_RPI
#undef SDL_VIDEO_DRIVER_KMSDRM
@ -374,6 +387,9 @@
/* Enable Vulkan support */
#undef SDL_VIDEO_VULKAN
/* Enable Metal support */
#undef SDL_VIDEO_METAL
/* Enable system power support */
#undef SDL_POWER_LINUX
#undef SDL_POWER_WINDOWS
@ -396,6 +412,8 @@
/* Enable assembly routines */
#undef SDL_ASSEMBLY_ROUTINES
#undef SDL_ALTIVEC_BLITTERS
#undef SDL_ARM_SIMD_BLITTERS
#undef SDL_ARM_NEON_BLITTERS
/* Enable ime support */
#undef SDL_USE_IME
@ -403,6 +421,9 @@
/* Enable dynamic udev support */
#undef SDL_UDEV_DYNAMIC
/* Enable dynamic libusb support */
#undef SDL_LIBUSB_DYNAMIC
/* Enable dynamic libsamplerate support */
#undef SDL_LIBSAMPLERATE_DYNAMIC

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -71,6 +71,7 @@
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
#define HAVE_STRTOK_R 1
#define HAVE_STRTOL 1
#define HAVE_STRTOUL 1
#define HAVE_STRTOLL 1
@ -98,6 +99,8 @@
#define HAVE_COPYSIGNF 1
#define HAVE_COS 1
#define HAVE_COSF 1
#define HAVE_EXP 1
#define HAVE_EXPF 1
#define HAVE_FABS 1
#define HAVE_FABSF 1
#define HAVE_FLOOR 1
@ -128,12 +131,17 @@
/* Enable various audio drivers */
#define SDL_AUDIO_DRIVER_ANDROID 1
#define SDL_AUDIO_DRIVER_OPENSLES 1
#define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable various input drivers */
#define SDL_JOYSTICK_ANDROID 1
#define SDL_JOYSTICK_HIDAPI 1
#define SDL_HAPTIC_ANDROID 1
/* Enable sensor driver */
#define SDL_SENSOR_ANDROID 1
/* Enable various shared object loading systems */
#define SDL_LOADSO_DLOPEN 1

Some files were not shown because too many files have changed in this diff Show more