Commit graph

11215 commits

Author SHA1 Message Date
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