Commit graph

9484 commits

Author SHA1 Message Date
Philipp Wiesemann
d2bcd9e6eb Fixed copyright symbol in testgles2 program. 2017-01-21 22:00:40 +01:00
Sam Lantinga
b5f23df6a8 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
88fd1d721d Added support for the 8Bitdo Zero GamePad 2017-01-20 08:13:23 -08:00
Sam Lantinga
e8a0188c9f Fixed mingw64 32-bit build, which does have the correct structure definitions 2017-01-19 20:19:37 -08:00
Sam Lantinga
2b509445d8 Removed unused variable 2017-01-18 12:19:57 -08:00
Sam Lantinga
2129c44985 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
9413c74045 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
101fc7428b Fixed building with mingw32 2017-01-18 11:57:27 -08:00
Ryan C. Gordon
adb1d6888f audio: Several fixes to "simple" resampler (thanks, Vitaly!).
Fixes Bugzilla #3551.
2017-01-18 02:11:56 -05:00
Sam Lantinga
61e4e371fa 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
f025391f8c 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
c40d568133 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.

--HG--
extra : rebase_source : c803b416ec487b8c0feba780ac06f8d11e90879b
2017-01-15 05:01:59 -05:00
Philipp Wiesemann
f8d3d73cc9 Fixed comments. 2017-01-14 21:36:06 +01:00
Philipp Wiesemann
fb2c2f5703 Fixed doxygen warning and linking of function names. 2017-01-14 21:35:49 +01:00
Philipp Wiesemann
741322863f Changed Bugzilla link in README.md to HTTPS like in BUGS.txt. 2017-01-14 21:35:18 +01:00
Philipp Wiesemann
f5eb780fe9 Fixed warnings about missing initializers in testoverlay2 program. 2017-01-14 21:34:45 +01:00
Sam Lantinga
db23e877e1 Fixed comment 2017-01-13 11:37:12 -08:00
dmuratshin
65283bda93 fixed SENSOR_LANDSCAPE and SENSOR_PORTRAIT mode false nativeResume bug 2017-01-12 10:58:35 -08:00
Sam Lantinga
c5d89dc186 We don't actually build with the Xt library 2017-01-10 23:23:32 -08:00
Sam Lantinga
d6742bbdf5 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
8eb437d4e7 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
27737db314 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.

--HG--
extra : rebase_source : 4c5656de3d1de9f88d6368e5ca363d834fc93af1
2017-01-09 16:31:57 -05:00
Ryan C. Gordon
240e448d41 testresample: write correct length to the .wav header.
--HG--
extra : rebase_source : 2cd3479500c472e06b74b6d640970d991c269696
2017-01-09 15:56:11 -05:00
Sam Lantinga
86f6ab1b62 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
435a9e75c7 Fixed spacing 2017-01-09 11:30:29 -08:00
Sam Lantinga
b59bd003d7 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
2f283c2beb audio: Replaced older resamplers in SDL_AudioCVT with the new ones.
--HG--
extra : rebase_source : a4df0c56d61d9927e97bbd738c12a3043f44742e
2017-01-09 06:00:58 -05:00
Ryan C. Gordon
575a388ff4 audio: Patched to compile if linking directly to libsamplerate.
--HG--
extra : rebase_source : 32676dd43d1d33c1985c4dc6cef969ddbc082935
2017-01-09 05:59:30 -05:00
Sam Lantinga
9558d55a84 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
def09bbf54 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
5913d167bd 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
be34ee410d Check the return value of SDL_EVDEV_Init() 2017-01-08 18:32:20 -08:00
Ryan C. Gordon
9268415b53 audio: Improvements in channel conversion code.
--HG--
extra : amend_source : 521d4d1f25bba02be473faa4d573928ea9007452
2017-01-08 16:18:49 -05:00
Ryan C. Gordon
ba27cf3fc1 audio: Patched to compile with libsamplerate support (again). 2017-01-08 14:28:44 -05:00
Ryan C. Gordon
d8f718f75d audio: Patched to compile with libsamplerate support. 2017-01-08 14:23:15 -05:00
Ryan C. Gordon
f904fecce3 audio: libsamplerate loading now happens once at init time.
--HG--
extra : rebase_source : b88014744534e382d6b6ea004554ffcebe5caffe
2017-01-08 14:18:03 -05:00
Ryan C. Gordon
d81fb0038f Fixed coding style on a function signature.
--HG--
extra : rebase_source : ccbcdf0c433bac0ad213f4a377674363b1fab87e
2017-01-08 14:17:09 -05:00
Ryan C. Gordon
c5c2526b7a README-linux: added notes about libsamplerate.
--HG--
extra : rebase_source : a865ab45d6fbb2fe94bb130f3e16de26907cfe14
2017-01-08 14:16:19 -05:00
Sam Lantinga
5f89fe73fa 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
d01010338e 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
4f3c7c976f 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
9414004279 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
472b34a08c 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
Ryan C. Gordon
1720fdee1d Fixed a bunch of compiler warnings in the test code. 2017-01-07 22:24:45 -05:00
Ryan C. Gordon
021504c71a x11: make the X11 target work on macOS with Xquartz.
--HG--
extra : rebase_source : c39bb96dea5512d268ffbf1903dae9283b9b6b63
2017-01-07 19:55:29 -05:00
Ryan C. Gordon
7b6965f75b Replaced a few single-line "//" comments.
--HG--
extra : rebase_source : a1bd030f02288429951a77df9555944cf2657f90
2017-01-07 17:09:14 -05:00
Sam Lantinga
58f6b7d511 Really fixed blit issue for capehill 2017-01-07 16:51:48 -08:00
Sam Lantinga
294906558e Fixed bug 3469 - Keypresses leak to the console with 2.0.5
tvc

I believe this patch should fix it, instead of looping through all the tty's and seemingly selecting the wrong one and corrupting the console I've just made SDL open /dev/tty which is the console attached to the current process anyway.
2017-01-07 10:13:04 -08:00
Sam Lantinga
5a0aef995a Added configure and cmake support for libsamplerate 2017-01-06 20:43:53 -08:00
Ryan C. Gordon
8ab0ba202d audio: Don't call a NULL function pointer when clearing audio streams.
(Partially?) fixes Bugzilla #3547.
2017-01-06 21:23:51 -05:00