Commit Graph

1262 Commits

Author SHA1 Message Date
Sam Lantinga
91ba486f82 Clarified that the clip rectangle is defined relative to the viewport, and added a clip test to testviewport.c 2020-03-08 21:02:40 -07:00
Sam Lantinga
497761c790 Fixed compile warning 2020-03-02 10:58:08 -08:00
Cameron Cawley
931c1b605b test: Improved detection of OpenGL support 2020-02-08 19:34:51 +00:00
Cameron Cawley
a2824c26a7 Add basic support for compiling on RISC OS 2020-02-13 20:50:47 +00:00
Cameron Cawley
d0d4db1378 testfilesystem: Don't exit the application if SDL_GetBasePath isn't supported 2020-02-13 22:58:04 +00:00
Sam Lantinga
0a3e41f83b Use the triggers to test rumble for more fine grained vibration feedback 2020-02-07 11:45:32 -08:00
Sam Lantinga
e82dc25ab8 On Mac OSX there are spurious hat events at program start, so skip these 2020-01-17 11:06:02 -08:00
Sam Lantinga
89be0e49c6 Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
David Ludwig
9962d37621 Emscripten: build fix for testoverlay2.c 2020-01-13 11:46:17 -05:00
Sam Lantinga
cb0cbdf5b4 Automatically assign player indexes to game controllers, and allow changing the player index for game controllers and joysticks.
Added the functions SDL_JoystickFromPlayerIndex(), SDL_JoystickSetPlayerIndex(), SDL_GameControllerFromPlayerIndex(), and SDL_GameControllerSetPlayerIndex()
2019-12-20 20:12:03 -08:00
Sam Lantinga
e312b90195 Ignore axis jitter when mapping controllers 2019-12-05 13:18:56 -08:00
Sam Lantinga
3abe2e2363 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
834512e872 Added SDL_GameControllerTypeForIndex() and SDL_GameControllerGetType() to return the type of controller attached. 2019-11-22 13:12:12 -08:00
Sam Lantinga
a10feb5814 Turned on controllermap debug output by default 2019-11-21 10:09:26 -08:00
Cameron Cawley
a1c11854f2 Added SDL_PIXELFORMAT_BGR444 2019-11-02 22:58:52 +00: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
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
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
Ozkan Sezer
49781c6770 test: replace some exit()s with returns. 2019-09-10 10:03:20 +03:00
Ozkan Sezer
c2cca5d636 minor warning fixes. 2019-08-04 14:56:02 +03:00
Ozkan Sezer
fb740bd37c remove test/aclocal.m4 2019-08-03 12:49:50 +03:00
Ozkan Sezer
5410f2c5dc use SDL_zeroa at more places where the argument is an array. 2019-07-31 05:11:40 +03:00
Sam Lantinga
92d2cf74d1 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
22ac8341d7 testoverlay2: Changed some C runtime calls to be SDL equivalents. 2019-06-11 02:32:43 -04:00
Ryan C. Gordon
128288a92f test: unify all the command line usage logging. 2019-05-28 17:39:13 -04:00
Ryan C. Gordon
7c08f947ab 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
21d8b51221 test: configure/make shouldn't build GL/GLES1/GLES2 programs if unsupported. 2019-05-18 23:47:57 -04:00
Sam Lantinga
5438110caf configure.in: Rename configure.ac to fix an 'aclocal' warning 2019-04-02 05:31:08 -07:00
Ryan C. Gordon
09e22d23a6 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
0c330d1706 testgesture: cleaned up code formatting, etc. 2019-03-15 22:39:31 -04:00
Ryan C. Gordon
c36a588979 testgesture: minor cleanups. 2019-03-15 22:17:21 -04:00
Ryan C. Gordon
d3fa1bfaef test: Moved testgesture.c over to the common SDLtest framework. 2019-03-15 22:16:02 -04:00
Sam Lantinga
a7609d9e2a Updated copyright for 2019 2019-01-04 22:01:14 -08:00
Ryan C. Gordon
72f602c79b testgl2: Press 'o' or 'p' to decrease/increase OpenGL swap interval. 2018-12-16 01:04:07 -05:00
Ozkan Sezer
870acf4dd1 minor update to Makefile.os2, added a test/Makefile.os2. 2018-11-20 10:55:00 +03:00
Ryan C. Gordon
1495475a85 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
2018-09-20 15:41:57 -04:00
Ryan C. Gordon
846526767d test: Makefile should copy .dat files for testoverlay2. 2018-09-02 00:35:11 -04:00
Jeremy Ong
1bb7162872 vulkan: SDL_Vulkan_GetInstanceExtensions should accept a NULL window.
Fixes Bugzilla #4235.
2018-08-24 09:49:48 -04:00
Sam Lantinga
6a6db94f54 First pass on the new SDL sensor API 2018-08-21 12:11:34 -07:00
Sam Lantinga
a7f26f9e6c 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
0df9d798c0 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.
2018-08-02 16:03:47 -04:00
Ryan C. Gordon
10d7249589 testresample: correctly output .wav files that have floating point audio. 2018-05-15 00:04:02 -04:00
Ryan C. Gordon
cc16ae0ff1 cpuinfo: Added SDL_HasAVX512F().
This checks for the "foundation" AVX-512 instructions (that all AVX-512
compatible CPUs support).
2018-05-21 11:35:42 -04:00
Sam Lantinga
d1956793bb Added SDL_THREAD_PRIORITY_TIME_CRITICAL 2018-04-23 22:07:56 -07:00
Sam Lantinga
383a65ef51 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
e99c0c8b98 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
09681aa6bd 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
002d771dc4 testoverlay2: use SDL_atoi, not atoi. 2018-01-22 09:46:48 -05:00
Sam Lantinga
a9072159b2 Updated copyright for 2018 2018-01-03 10:03:25 -08:00
Sam Lantinga
d20102e9e1 Fixed building YUV test programs (thanks Ozkan!) 2017-11-17 10:54:46 -08:00