Commit Graph

11460 Commits

Author SHA1 Message Date
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
David Ludwig
1c80b35817 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
bdef323c5b 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
439e9540d4 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")
2019-08-27 12:30:20 -04:00
David Ludwig
2039634de3 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
2019-08-27 11:07:43 -04:00
Jinke Fan
9c507c2e13 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
7b5253e603 SDL_messagebox.h: remove comma at end of enumerator list 2019-09-22 21:41:20 +03:00
Ozkan Sezer
b91c79b211 update version number in Makefile.os2 too 2019-09-22 20:47:00 +03:00
Sam Lantinga
ac13c85597 Updated SDL development builds to version 2.0.11 2019-09-22 10:37:16 -07:00
Sam Lantinga
a4183be1c5 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
ad63851807 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
4d7951aff9 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
49781c6770 test: replace some exit()s with returns. 2019-09-10 10:03:20 +03:00
Sam Lantinga
2d61cc55a4 Fixed compiler warning on Android 2019-09-09 13:50:46 -07:00
Sam Lantinga
5d828dc200 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
ab6d986e8c 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
2d654f5bdb 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
28c770db7b SDL_windowsevents.c: remove isVistaOrNewer (not used since 8254c364ec4a) 2019-09-05 20:47:20 +03:00
Ozkan Sezer
7ff04f4c26 fix permissions 2019-09-05 13:21:02 +03:00
Sylvain Becker
d46ee9f303 SDL_windowsmessagebox.c: remove unused variable 2019-09-05 10:49:53 +02:00
Sylvain Becker
92629a5a51 SDL_bmp.c: remove unused variable warnings 2019-09-05 10:08:47 +02:00
Sam Lantinga
14cb33df7e x11: add a hint to force the VisualID used when creating a window. 2019-09-04 09:27:58 -07:00
Ryan C. Gordon
2961493479 stdinc: On macOS and iOS, use memset_pattern4() for SDL_memset4().
Fixes Bugzilla #4724.
2019-09-04 00:39:47 -04:00
Sam Lantinga
38897ead6d 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
8ca869b0cb SDL_bmp.c: restore most of the original formatting. 2019-09-02 12:35:00 +03:00
Ryan C. Gordon
123d506254 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
56752d2226 d3d11: Fixed VB state, avoiding unnecessary recreation (Thanks, Alex!).
Fixes Bugzilla #4779.
2019-09-01 22:41:44 -04:00
Sylvain Becker
f1e7d71a20 LoadBMP: fix some warnings 2019-08-31 22:58:11 +02:00
Sylvain Becker
35244c4817 LoadBMP: use code from SDL_image which allows loading compressed BMP files 2019-08-31 22:52:15 +02:00
Sam Lantinga
7960b838eb Allow mouse messages from Wacom pens, e.g. right click pen buttons, etc. 2019-08-30 15:32:15 -07:00
Sam Lantinga
ba94236e2a 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
eedd651cef use 'U' suffix on constants instead of (unsigned int) cast. 2019-08-30 11:35:20 +03:00
Sylvain Becker
32913d0f64 Android: minor warning 2019-08-30 09:00:06 +02:00
Sylvain Becker
7f1bffc694 Android: fix corresponding warnings 2019-08-30 08:55:20 +02:00
Sylvain Becker
0a4221377f Android: add more warning flags 2019-08-30 08:43:13 +02:00
Sylvain Becker
27d9892ec9 Fixed bug 3918 - HIDAPI, CMake support for android project 2019-08-27 11:38:43 +02:00
Sam Lantinga
314b2ee487 Fixed Windows relative mouse coordinates when capturing the mouse over RDP 2019-08-26 17:43:01 -07:00
Alex Szpakowski
333739eb02 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
6ac4927d80 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
4f7b74e536 RPI_FreeCursor: set global_cursor to NULL to prevent double-free (bug 4769) 2019-08-26 18:41:40 +03:00
Sylvain Becker
78881f3e1d Fixed bug 1663 - SDL_EventState(SDL_DOLLARGESTURE,SDL_IGNORE) etc. has no effect 2019-08-24 20:40:37 +02:00