Commit graph

1252 commits

Author SHA1 Message Date
Sam Lantinga
54dbdfc8eb Ignore axis jitter when mapping controllers 2019-12-05 13:18:56 -08:00
Sam Lantinga
dee346af66 Fixed mapping controllers that have axes that start at -32768 and then snap to 0 at the first input report 2019-11-28 11:44:15 -08:00
Sam Lantinga
e061577afb Added SDL_GameControllerTypeForIndex() and SDL_GameControllerGetType() to return the type of controller attached. 2019-11-22 13:12:12 -08:00
Sam Lantinga
7ee14a9bc1 Turned on controllermap debug output by default 2019-11-21 10:09:26 -08:00
Cameron Cawley
935a136364 Added SDL_PIXELFORMAT_BGR444 2019-11-02 22:58:52 +00:00
Brandon Schaefer
937d0c8ded 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
a2af92e8eb 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
36e1615cf0 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

--HG--
extra : rebase_source : 0c6beeec1886332c685dad6c665085ed4e7f2a3e
2019-08-27 11:07:43 -04:00
Ozkan Sezer
43d3bedb26 test: replace some exit()s with returns. 2019-09-10 10:03:20 +03:00
Ozkan Sezer
2467ed197c minor warning fixes. 2019-08-04 14:56:02 +03:00
Ozkan Sezer
0f3d9a7186 remove test/aclocal.m4 2019-08-03 12:49:50 +03:00
Ozkan Sezer
32894f4f11 use SDL_zeroa at more places where the argument is an array. 2019-07-31 05:11:40 +03:00
Sam Lantinga
41ee61e718 Fixed bug 4708 - testdropfile: double-free
Juha Niemimäki

SDLTest_CommonEvent seems to free the file name so testdropfile prints some garbage to console and crashes when freeing the name again.
2019-07-03 02:37:15 -07:00
Ryan C. Gordon
c827b5db23 testoverlay2: Changed some C runtime calls to be SDL equivalents. 2019-06-11 02:32:43 -04:00
Ryan C. Gordon
3d85deba6b test: unify all the command line usage logging.
--HG--
extra : rebase_source : dd9a05d9ee69ae14e8462bee898c5df4e372424b
2019-05-28 17:39:13 -04:00
Ryan C. Gordon
7e89e2dcd4 test: added SDLTest_CommonDefaultArgs()
This is for test apps that don't need custom command line arguments; it lets
us reduce the boilerplate code a tiny bit.
2019-05-19 01:45:15 -04:00
Ryan C. Gordon
86819b840e test: configure/make shouldn't build GL/GLES1/GLES2 programs if unsupported.
--HG--
extra : rebase_source : d9c00eb8bec76420696cd6c107109ec47f205b85
2019-05-18 23:47:57 -04:00
Sam Lantinga
0b8f778883 configure.in: Rename configure.ac to fix an 'aclocal' warning
--HG--
rename : test/configure.in => test/configure.ac
2019-04-02 05:31:08 -07:00
Ryan C. Gordon
7da64b962d testgesture: Make the background gray.
This is so you can see it on systems that have a minimal window manager and
a black background.
2019-03-17 12:45:19 -04:00
Ryan C. Gordon
a629bd2e6f testgesture: cleaned up code formatting, etc. 2019-03-15 22:39:31 -04:00
Ryan C. Gordon
6c61e6ee73 testgesture: minor cleanups. 2019-03-15 22:17:21 -04:00
Ryan C. Gordon
369d62ff41 test: Moved testgesture.c over to the common SDLtest framework. 2019-03-15 22:16:02 -04:00
Sam Lantinga
af32a2f4cd Updated copyright for 2019 2019-01-04 22:01:14 -08: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
Ozkan Sezer
eb37476b4d minor update to Makefile.os2, added a test/Makefile.os2. 2018-11-20 10:55:00 +03:00
Ryan C. Gordon
b06aace296 testsprite2: report average FPS in blocks of five seconds.
This makes the reporting more accurate, vs startup inefficiencies and other
scheduling burps.

--HG--
branch : SDL-ryan-batching-renderer
extra : source : 6c2ad028778a96a0e34436ab7de121ecae4da0d8
2018-09-20 15:41:57 -04:00
Ryan C. Gordon
2a81de7287 test: Makefile should copy .dat files for testoverlay2. 2018-09-02 00:35:11 -04:00
Jeremy Ong
69441bd02e vulkan: SDL_Vulkan_GetInstanceExtensions should accept a NULL window.
Fixes Bugzilla #4235.
2018-08-24 09:49:48 -04:00
Sam Lantinga
09c276f295 First pass on the new SDL sensor API 2018-08-21 12:11:34 -07:00
Sam Lantinga
db39b4811f Added HIDAPI joystick drivers for more consistent support for Xbox, PS4 and Nintendo Switch Pro controller support across platforms.
Added SDL_GameControllerRumble() and SDL_JoystickRumble() for simple force feedback outside of the SDL haptics API
2018-08-09 16:00:17 -07:00
Ryan C. Gordon
45974c3953 Some drag'and'drop improvements.
First: disable d'n'd events by default; most apps don't need these at all, and
if an app doesn't explicitly handle these, each drop on the window will cause
a memory leak if the events are enabled. This follows the guidelines we have
for SDL_TEXTINPUT events already.

Second: when events are enabled or disabled, signal the video layer, as it
might be able to inform the OS, causing UI changes or optimizations (for
example, dropping a file icon on a Cocoa app that isn't accepting drops will
cause macOS to show a rejection animation instead of the drop operation just
vanishing into the ether, X11 might show a different cursor when dragging
onto an accepting window, etc).

Third: fill in the drop event details in the test library and enable the
events in testwm.c for making sure this all works as expected.

--HG--
extra : rebase_source : a8d5c21e97b34dbd6ce88237863c084d8825350a
extra : amend_source : 81c4acd9f5ca8dc5a4642b250ca6b42fd79cac87
2018-08-02 16:03:47 -04:00
Ryan C. Gordon
3ca98abf96 testresample: correctly output .wav files that have floating point audio.
--HG--
extra : rebase_source : 12727c9fbaead1d9e954b34dbdae5babef3f4dce
extra : histedit_source : bdee71b1310f6a427e0e03ad7c06856ad3c6299f
2018-05-15 00:04:02 -04:00
Ryan C. Gordon
b7560b9599 cpuinfo: Added SDL_HasAVX512F().
This checks for the "foundation" AVX-512 instructions (that all AVX-512
compatible CPUs support).

--HG--
extra : rebase_source : 2857dd04072e2f897e18665d0a4fe2837c06ed9b
extra : histedit_source : 67d0b925bceb2ed2a8f37b5783f2b755e796031f
2018-05-21 11:35:42 -04:00
Sam Lantinga
50baccfbfb Added SDL_THREAD_PRIORITY_TIME_CRITICAL 2018-04-23 22:07:56 -07:00
Sam Lantinga
467b928af2 Added support for adjusting thread priorities using Linux RealtimeKit
Michael Sartain

This is a quick pass at adding Linux RealtimeKit thread priority support to SDL.

It allows me to bump the thread priority to high without root privileges or setting any caps, etc.

rtkit readme here:
    http://git.0pointer.net/rtkit.git/tree/README
2018-04-23 17:10:36 -07:00
Sam Lantinga
b5b3a139dc Added Android custom cursor implementation
This is commented out in SDLActivity.java, with the note #CURSORIMPLEENTATION because it requires API 24, which is higher than the minimum required SDK
2018-03-15 18:22:48 -07:00
Sam Lantinga
507975a360 Fixed bug 4092 - CMake support for building everything in the "test" directory
Eric Wasylishen

Patch to support building the tests with cmake.
Disabled by default, use: "cmake .. -DSDL_TEST=YES" to enable the tests.

Tested on macOS 10.13 with the ninja, makefile, and Xcode generators, and Windows 10 with the Visual Studio 2017 generator.
2018-02-24 08:59:58 -08:00
Ryan C. Gordon
2aca04fbdd testoverlay2: use SDL_atoi, not atoi. 2018-01-22 09:46:48 -05:00
Sam Lantinga
346af016a5 Updated copyright for 2018 2018-01-03 10:03:25 -08:00
Sam Lantinga
72dec56391 Fixed building YUV test programs (thanks Ozkan!) 2017-11-17 10:54:46 -08:00
Sam Lantinga
145d2469ae Updated SDL's YUV support, many thanks to Adrien Descamps
New functions get and set the YUV colorspace conversion mode:
	SDL_SetYUVConversionMode()
	SDL_GetYUVConversionMode()
	SDL_GetYUVConversionModeForResolution()

SDL_ConvertPixels() converts between all supported RGB and YUV formats, with SSE acceleration for converting from planar YUV formats (YV12, NV12, etc) to common RGB/RGBA formats.

Added a new test program, testyuv, to verify correctness and speed of YUV conversion functionality.
2017-11-12 22:51:12 -08:00
Sam Lantinga
fc917367af Added min/max macros for the sized SDL datatypes 2017-10-16 14:39:56 -07:00
Brandon Schaefer
c355765d99 revert files I didnt mean to commit! 2017-09-29 10:15:44 -07:00
Brandon Schaefer
2ba8f45ae6 wayland: Fix bug 3814 -Wmissing-field-initializers 2017-09-29 10:07:37 -07:00
Ryan C. Gordon
8f60f0a775 test: forgot to change a variable.
Fixes Bugzilla #3787.

--HG--
extra : amend_source : c7474d259e202abcde7a917242859f79e5d7d766
2017-08-29 18:25:55 -04:00
Ryan C. Gordon
9b08483ffd test: Fix for negative int that was now a size_t (thanks, Ozkan!).
Fixes Bugzilla #3787.

--HG--
extra : amend_source : 8b47684fad05b69ea4410dfb67dcac382b310914
2017-08-29 18:16:38 -04:00
Ryan C. Gordon
e088b11c8a A few more compiler warnings fixed. 2017-08-29 16:05:03 -04:00
Ryan C. Gordon
fca3874ab4 Fixed a bunch of compiler warnings.
--HG--
extra : rebase_source : a2c94cfaf300f4d9f5b7855489ed05c8e23de9fd
2017-08-29 15:52:49 -04:00
Sam Lantinga
eb767f3e1b Fixed typedef redefinition errors when including both SDL_vulkan.h and vulkan.h
You should always include vulkan/vulkan.h first, then include SDL_vulkan.h
2017-08-27 23:13:15 -07:00
Sam Lantinga
24c5115ef6 Added Vulkan support to the Visual Studio 2010 solution 2017-08-27 22:20:17 -07:00