Commit Graph

11500 Commits

Author SHA1 Message Date
Sam Lantinga
36070b037c 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
fe16299c76 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
39e5c9e296 Merged latest data from Steam 2019-10-17 16:14:17 -07:00
Alex Szpakowski
373d67b24c metal: Fix compilation when using older Apple SDKs (bug #4828). 2019-10-17 18:48:58 -03:00
Ryan C. Gordon
81da0749b6 emscripten: Patched to compile (thanks, Caleb!).
Fixes Bugzilla #4827.
2019-10-16 13:54:35 -04:00
Sam Lantinga
3ad42d8922 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
ccf9360928 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.
2019-10-15 22:36:08 -04:00
Ryan C. Gordon
cff1be51bb video: Make sure SDL_FillRects()'s fill_function isn't used unitialized. 2019-10-15 14:55:09 -04:00
Ryan C. Gordon
a5d7cb771a 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
8d3d552a70 video: Removed unused variables. 2019-10-15 14:04:43 -04:00
Ryan C. Gordon
9eabf1b21c 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
284c9aa392 test: Fixed wrong verbose flag check (thanks, watcom.hecht!).
Fixes Bugzilla #4826.
2019-10-15 12:02:19 -04:00
Ryan C. Gordon
bba79fa627 windows: Remove /ARCH:SSE option from x64 Visual Studio builds.
Fixes Bugzilla #4561.
2019-10-15 09:07:12 -04:00
Ryan C. Gordon
6a5d0c4aa3 test: Fixed compiler warning on Visual Studio. 2019-10-15 08:54:25 -04:00
Cameron Gutman
b1de68d17d 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
baa93f0803 Backed out changeset a429ccdea379
Better commit incoming!
2019-10-14 22:41:27 -07:00
Ryan C. Gordon
a7bfd727c8 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
4576762d8b cocoa: Implement SDL_WINDOW_ALWAYS_ON_TOP support (thanks, Gabriel!).
Fixes Bugzilla #4809.
2019-10-15 00:59:10 -04:00
Ryan C. Gordon
65c132abc1 dynapi: Deal with failure cases better, other fixes.
Fixes Bugzilla #4803.
2019-10-14 12:41:06 -04:00
Sylvain Becker
672c1b5202 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
298fa09a83 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
43aa84bcdf 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
9580e564c2 Fixed bug 4825 - SDL Renderer OpenGL: Buffer overflow (SDL_RENDERCMD_DRAW_LINES) 2019-10-13 20:52:52 +02:00
Alex Szpakowski
c8b08f2468 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
a478cb09aa 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
aa46435788 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
84b6db7037 Remove 'Enum' suffixes (bug 4813) 2019-10-11 06:18:24 +02:00
Sylvain Becker
6f27e26ec6 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
006c70905e Fixed bug 4820 - SDL assumes RW_SEEK_SET == SEEK_SET 2019-10-10 17:21:46 +02:00
Ryan C. Gordon
dc71d07c8f 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
6d51e7fd26 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
8ceb78b4e8 dynapi: Make gendynapi.pl work on older Perl releases. 2019-10-05 20:19:10 -04:00
David Ludwig
f331d1e020 WinRT: fix a link-time error when building UWP + x64 2019-10-02 14:55:02 -04:00
Sam Lantinga
eae59a24ab Removed unused volume check interval 2019-10-01 08:50:04 -07:00
Ozkan Sezer
a06c541fa0 endpointvolume.h checks not needed since changeset 13078:ae4f9911321a . 2019-10-01 14:00:02 +03:00
Sylvain Becker
93eef619ea SDL_LockTextureToSurface: robustness of locked region compared to texture size 2019-10-01 09:26:30 +02:00
Ozkan Sezer
6d13e9ae72 dynapi: move new SDL_LockTextureToSurface addition to the end of file. 2019-10-01 00:05:50 +03:00
Sylvain Becker
634ae03efb 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
48970efc66 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
71b8566abd Fixed rtkit feature guard 2019-09-27 15:21:31 -07:00
Sam Lantinga
218eb2cef3 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
b8bbb98cac stdlib: Patched to compile. 2019-09-26 13:44:49 -04:00
Ryan C. Gordon
d50976e0eb 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
78ab3e0b7b 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
4d7a6a501e coreaudio: Apple doesn't support U16 data, so convert in that case. 2019-09-25 15:07:07 -04:00
Brandon Schaefer
9f39b04812 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
f7b60be667 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
efee6e6d43 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
48a9485982 CMake: tabs to spaces in new parts of README-cmake.md 2019-09-23 18:30:22 -04:00
David Ludwig
d1202f45fd CMake: document iOS/tvOS support in README-cmake.md 2019-09-23 18:27:14 -04:00