Commit Graph

9341 Commits

Author SHA1 Message Date
Ryan C. Gordon
2f563d7f93 audio: Added SSE3 implementation of SDL_ConvertStereoToMono(). 2017-01-23 00:57:19 -05:00
Ryan C. Gordon
45b8749071 audio: don't cast to double in SDL_ConvertStereoToMono().
It's expensive and (hopefully) unnecessary. If this becomes an overflow
problem, we could multiply both values by 0.5f before adding them, but let's
see if we can get by without the extra multiplication first.
2017-01-22 20:18:59 -05:00
Ryan C. Gordon
2eff2773e3 audio: removed conditional from simple resampler's inner loop.
We never seem to overflow the source buffer now; this might have been a
leftover from a bug that was covered by Vitaly's fixes?

Removing this conditional makes the resampler 10-20% faster. Left an
assert in there for debug builds, in case this still happens.
2017-01-20 16:26:24 -05:00
Philipp Wiesemann
e1087cd67e Haiku: Fixed memory leak if creating framebuffer failed. 2017-01-22 22:15:36 +01:00
Philipp Wiesemann
8e185ea2db WinRT: Fixed typo in README. 2017-01-22 22:15:24 +01:00
Philipp Wiesemann
8ff6299a1f Haiku: Removed unused variable.
Found by Cppcheck.
2017-01-21 22:01:17 +01:00
Philipp Wiesemann
c370750a65 Fixed compiler warning about returning a value in a void function. 2017-01-21 22:00:56 +01:00
Philipp Wiesemann
715bc7f1f1 Fixed copyright symbol in testgles2 program. 2017-01-21 22:00:40 +01:00
Sam Lantinga
d1508cc1ad Fixed mapping the PG-9021 which, on Linux, emits a button partway through the trigger press along with axis motion all along the pull 2017-01-20 16:40:11 -08:00
Sam Lantinga
2e6f3f1808 Added support for the 8Bitdo Zero GamePad 2017-01-20 08:13:23 -08:00
Sam Lantinga
7ac28607b4 Fixed mingw64 32-bit build, which does have the correct structure definitions 2017-01-19 20:19:37 -08:00
Sam Lantinga
9ac97dd412 Removed unused variable 2017-01-18 12:19:57 -08:00
Sam Lantinga
9fa40e721d Fixed bug 3533 - Enumeration joystick devices omitted during directinput enumeration
white.magic

The logic which decides if a device enumerated via the direct input system in the function EnumJoysticksCallback in SDL_dinputjoystick.c is processed is discarding valid joystick devices due to the assumption that devices of the type DI8DEVTYPE_SUPPLEMENTAL are not valid devices.

This change was added with 2.0.4 with this commit http://hg.libsdl.org/SDL/rev/d5adc0c06a03 that is linked to this bug report https://bugzilla.libsdl.org/show_bug.cgi?id=2460 which indicates that in that case devices of the type DI8DEVTYPE_SUPPLEMENTAL were not desirable as they caused a singular device to emit multiple "device added" events.

Since then there appear to have been a few fixes to handle devices that fall into various other classes in the following two commits:
http://hg.libsdl.org/SDL/rev/b9488c689ce3 and http://hg.libsdl.org/SDL/rev/161fee58e36f

Two devices I have reports of failing to be listed when the DI8DEVTYPE_SUPPLEMENTAL type is excluded are ECS Gametric Throttle and Thrustmaster MFD Cougar.

Sam Lantinga

I verified that the OUYA controller shows up as a single device with this change, so I've reverted the change to ignore supplemental devices, leaving framework in place to easily add devices that we want to ignore.
2017-01-18 12:18:50 -08:00
Sam Lantinga
c5fca62860 Fixed bug 3561 - Re-acquire device before playing effects if needed.
Mathieu Laurendeau

Check the result of IDirectInputEffect_SetParameters and re-acquire the device to solve concurrency issues.
2017-01-18 11:58:16 -08:00
Sam Lantinga
83184dca24 Fixed building with mingw32 2017-01-18 11:57:27 -08:00
Ryan C. Gordon
c3f4dfdf93 audio: Several fixes to "simple" resampler (thanks, Vitaly!).
Fixes Bugzilla #3551.
2017-01-18 02:11:56 -05:00
Sam Lantinga
73bdeb179a Use icon width * sizeof(Uint32) instead of icon pitch when copying to icon resource data 2017-01-17 21:18:31 -08:00
Ryan C. Gordon
033f17ff44 audio: Implemented SIMD support for audio data type converters.
This currently adds an SSE2 implementation (but it's #ifdef'd out for now,
until it's hooked up to the configure script and such).
2017-01-16 00:58:28 -05:00
Ryan C. Gordon
4080182bac audio: Some fixes to the audio data type converter code.
Removed some needless things ("len / sizeof (Uint8)"), and made sure the
int32 -> float code uses doubles to avoid working with large integer values
in a 32-bit float.
2017-01-15 05:01:59 -05:00
Philipp Wiesemann
35743474ce Fixed comments. 2017-01-14 21:36:06 +01:00
Philipp Wiesemann
74758a9d74 Fixed doxygen warning and linking of function names. 2017-01-14 21:35:49 +01:00
Philipp Wiesemann
35b0f86be6 Changed Bugzilla link in README.md to HTTPS like in BUGS.txt. 2017-01-14 21:35:18 +01:00
Philipp Wiesemann
e5d8e161d0 Fixed warnings about missing initializers in testoverlay2 program. 2017-01-14 21:34:45 +01:00
Sam Lantinga
570688e552 Fixed comment 2017-01-13 11:37:12 -08:00
dmuratshin
83727f6cdb fixed SENSOR_LANDSCAPE and SENSOR_PORTRAIT mode false nativeResume bug 2017-01-12 10:58:35 -08:00
Sam Lantinga
cc9b924c51 We don't actually build with the Xt library 2017-01-10 23:23:32 -08:00
Sam Lantinga
9fca03e6fd Fixed bugs 2570, 3145, improved OpenGL ES context support on Windows and X11
Mark Callow

The attached patch does the following for the X11 and Windows platforms, the only ones where SDL attempts to use context_create_es_profile:

- Adds SDL_HINT_OPENGL_ES_DRIVER by which the application can
  say to use the OpenGL ES driver & EGL rather than the Open GL
  driver. (For bug #2570)
- Adds code to {WIN,X11}_GL_InitExtensions to determine the maximum
  OpenGL ES version supported by the OpenGL driver (for bug #3145)
- Modifies the test that determines whether to use the OpenGL
  driver or the real OpenGL ES driver to take into account the
  hint, the requested and supported ES version and whether ES 1.X
  is being requested. (For bug #2570 & bug #3145)
- Enables the testgles2 test for __WINDOWS__ and __LINUX__ and adds
  the test to the VisualC projects.

With the fix in place I have run testdraw2, testgl and testgles2 without any issues and have run my own apps that use OpenGL, OpenGL ES 3 and OpenGL ES 1.1.
2017-01-10 08:54:33 -08:00
Sam Lantinga
6fcde18035 Fixed bug 3552 - Building SDL in release mode fails under VS 2017 RC
Lukasz Biel

Tried to compile SDL2 using newest version of VS.

Got:
SDL_audiocvt.obj : error LNK2019: unresolved external symbol memcpy referenced in function SDL_ResampleCVT
1>E:\Users\dotPo\Lib\SDL\VisualC\x64\Release\SDL2.dll : fatal error LNK1120: 1 unresolved externals

whole compilation process: http://pastebin.com/eWDAvBce

Steps to reproduce:
clone http://hg.libsdl.org/SDL using tortoise hg,
open SDL\VisualC\SDL.sln,
when promted if should retarget solution click ok,
select release x64 build type,
Build/Build Solution

attempt 2, using Visual Studio cmake support:
open folder SDL\
select release x64 build type,
run CMake\Build CMakeLists.txt
build fails

When switched to debug build type, buils succeeds in both cases.
VS 2017 is still beta.
2017-01-09 20:37:52 -08:00
Ryan C. Gordon
847a5cfd86 audio: Don't ever use libsamplerate in the SDL_AudioCVT codepath.
It causes audio pops if you're converting in chunks (and needs to
allocate/initialize/free on each convert). We'll either adjust this interface
when we break ABI for 2.1 to make this usable, or publish the SDL_AudioStream
API for those that want a streaming solution.

In the meantime, the "simple" resampler produces "good enough" audio without
pops and doesn't have to be initialized, so that'll do for now on the
SDL_AudioCVT interface.
2017-01-09 16:31:57 -05:00
Ryan C. Gordon
01d4ee3876 testresample: write correct length to the .wav header. 2017-01-09 15:56:11 -05:00
Sam Lantinga
05be9212ad We only need the first few keymaps corresponding to the following constants:
K_NORMTAB, K_SHIFTTAB, K_ALTTAB, K_ALTSHIFTTAB

In the normal case we'll load all the keymaps from the kernel, but this reduces the size of the SDL library for the fallback case when we can't get to the tty.
2017-01-09 11:58:01 -08:00
Sam Lantinga
94b00d8b7e Fixed spacing 2017-01-09 11:30:29 -08:00
Sam Lantinga
f7e2f9c098 Fixed bug 3100 - SetSwapInterval should now be enabled for ANGLE/EGL
Mark Logan 2015-08-24 15:57:50 UTC
In SDL_windowsopengles.c, WIN_GLES_SetSwapInterval is as follows:

WIN_GLES_SetSwapInterval(_THIS, int interval)
{
    /* FIXME: This should call SDL_EGL_SetSwapInterval, but ANGLE has a bug that prevents this
     * from working if we do (the window contents freeze and don't swap properly). So, we ignore
     * the request for now.
     */
    SDL_Log("WARNING: Ignoring SDL_GL_SetSwapInterval call due to ANGLE bug");
    return 0;
}

With a recent version of ANGLE (early July) calling SDL_EGL_SetSwapInterval with a D3D11 backend appears to work just fine. I am working on testing this with D3D9.

--

Alex Szpakowski

I found the bug, it was fixed in 2013. https://bugs.chromium.org/p/angleproject/issues/detail?id=481

In my opinion it should be safe to unconditionally use SetSwapInterval now. Anyone who encounters the bug should update their ANGLE to a version less than 3 years old, especially since they'd be using a SDL version that's 3+ years newer than their ANGLE version.
2017-01-09 10:10:33 -08:00
Ryan C. Gordon
f344385ceb audio: Replaced older resamplers in SDL_AudioCVT with the new ones. 2017-01-09 06:00:58 -05:00
Ryan C. Gordon
d794fc120a audio: Patched to compile if linking directly to libsamplerate. 2017-01-09 05:59:30 -05:00
Sam Lantinga
78328cd67d Implemented full evdev keyboard text support
This is based on the Linux kernel driver, and has fallback mapping tables in case we aren't connected to a virtual terminal.
2017-01-09 02:54:42 -08:00
Sam Lantinga
c733b3c0a0 Fixed bug 3545 - SDL_EVDEV_do_text_input() may be too eager to find error cases
Rob

I've ran into an issue where I successfully receive SDL_KEY[UP,DOWN] events but not SDL_TEXTINPUT or SDL_TEXTEDITING.  In my case the code in SDL_EVDEV_do_text_input() is returning early (on error) prior to calling SDL_SendKeyboardText().  I'm running on the RaspberryPi 3, without X11.

In SDL_EVDEV_do_text_input() there is a condition to check keysyms with a type value below 0xf0, then subtract 0xf0 from type.  Without understanding the purpose of this code, I disabled it, recompiled, and I'm getting correct SDL_TEXTINPUT events.  I'm going to guess that my hack/fix is going to be problematic in some other environment, but after some initial testing it looks like everything is running fine in my setup.
2017-01-08 20:03:18 -08:00
Sam Lantinga
164fc4a1a5 Removed console check, let the kernel decide whether muting is appropriate on this terminal.
We don't fail the init if we can't mute the terminal (we might be running from ssh, or on a system without virtual terminals, etc.)
2017-01-08 19:04:38 -08:00
Sam Lantinga
233563d80c Check the return value of SDL_EVDEV_Init() 2017-01-08 18:32:20 -08:00
Ryan C. Gordon
67c4e17d5c audio: Improvements in channel conversion code. 2017-01-08 16:18:49 -05:00
Ryan C. Gordon
fe889522e3 audio: Patched to compile with libsamplerate support (again). 2017-01-08 14:28:44 -05:00
Ryan C. Gordon
e61edeaca4 audio: Patched to compile with libsamplerate support. 2017-01-08 14:23:15 -05:00
Ryan C. Gordon
85fdec59da audio: libsamplerate loading now happens once at init time. 2017-01-08 14:18:03 -05:00
Ryan C. Gordon
62849dceb1 Fixed coding style on a function signature. 2017-01-08 14:17:09 -05:00
Ryan C. Gordon
a612eae69e README-linux: added notes about libsamplerate. 2017-01-08 14:16:19 -05:00
Sam Lantinga
06a7429702 Fixed attempting to dynamically load libsamplerate when shared object loading is disabled.
Thanks to Ozkan Sezer for pointing this out
2017-01-08 10:52:02 -08:00
Sam Lantinga
030ce1fe57 Fixed bug 3304 - Android black screen on resume
Richard Russell

Resuming from a suspended state results in a black screen.  This only happens when using GLES 1.1 (GLES 2 resumes correctly) and when the render target has been changed using SDL_SetRenderTarget.  This problem is new in 2.0.4.

The attached test case demonstrates the issue.

Sylvain Becker has apparently found a fix as follows:

"In the opengles leaf function (in 'src/render/opengles/SDL_render_gles.c'), it appears there is a call to 'GLES_ActivateRenderer' in 'GLES_SetRenderTarget', which is not present in opengles2. When commenting out this 'GLES_ActivateRenderer', it seems to resume fine".

This appears to fix the testcase perfectly, but I don't know whether it could have any undesirable side-effects.
2017-01-08 10:41:22 -08:00
Sam Lantinga
87ee83abcb SDL_evdev.c: fix building against old kernel headers (K_OFF may not be defined.) 2017-01-08 10:15:22 -08:00
Sam Lantinga
bf17aaf493 Don't fail if we can't open the tty, this can be a legitimate use case. 2017-01-07 16:49:23 -08:00
Sam Lantinga
1a6d67b9f4 Added mappings for the 8Bitdo NES30 Pro and iBuffalo SNES Controller
Also swapped the Wii U Pro controller button mappings to position instead of label, as emulators expect from XBox controllers.
2017-01-07 13:47:34 -08:00