Commit Graph

854 Commits (70ccf3458701d8563f4b213b1713eafcc052e34e)

Author SHA1 Message Date
Sam Lantinga cefbeb582f Mouse coordinates are floating point
You can get sub-pixel mouse coordinates and motion depending on the platform and display scaling.

Fixes https://github.com/libsdl-org/SDL/issues/2999
2022-12-29 23:12:19 -08:00
Sam Lantinga 98678b5d8d SDL API renaming: SDL_Alloc*/SDL_Free* -> SDL_Create*/SDL_Destroy*
Fixes https://github.com/libsdl-org/SDL/issues/6945
2022-12-29 15:07:15 -08:00
Sam Lantinga 1b90107fdb Spell out "Float" in function names 2022-12-29 14:50:31 -08:00
Sylvain Becker d7d3c22dbf
Remove more reserved identifiers (#6925) 2022-12-29 13:58:16 -08:00
Sam Lantinga ea0c2f55be SDL API renaming: *Is* functions
Feedback from @icculus:
"IsTablet" uses "is" as a form of "to be" ...like, the actual question is of its nature.

The rest is just a superfluous word in the question and it flows as better English with if (RectEmpty) than if (IsRectEmpty)

Fixes https://github.com/libsdl-org/SDL/issues/6932
2022-12-28 19:40:25 -08:00
Sam Lantinga 66351fd4ba Replace tri-state functions SDL_EventState(), SDL_GetJoystickEventState(), SDL_GetGamepadEventState(), SDL_ShowCursor()
`SDL_QUERY`, `SDL_IGNORE`, `SDL_ENABLE`, and `SDL_DISABLE` have been removed.

SDL_EventState() has been replaced with SDL_SetEventEnabled()
SDL_GetEventState() has been replaced with SDL_EventEnabled()
SDL_GameControllerEventState has been replaced with SDL_SetGamepadEventsEnabled() and SDL_GamepadEventsEnabled()
SDL_JoystickEventState has been replaced with SDL_SetJoystickEventsEnabled() and SDL_JoystickEventsEnabled()

SDL_ShowCursor() has been split into three functions: SDL_ShowCursor(), SDL_HideCursor(), and SDL_CursorVisible()

Fixes https://github.com/libsdl-org/SDL/issues/6929
2022-12-28 17:49:34 -08:00
Sam Lantinga 16092f58bb Updated gamepad, joystick, sensor APIs, removing device indices
Instead of indexing into an internal list of devices which requires locking, we return a list of device IDs which can then be queried individually.

Reference: https://github.com/libsdl-org/SDL/issues/6889
2022-12-28 13:10:27 -08:00
Sylvain aa46ff8f4b Remove SDL_WINDOW_SHOW flag, as redundant with SDL_WINDOW_HIDDEN 2022-12-28 12:16:57 -08:00
Sam Lantinga ab2d007982 More gamepad renaming 2022-12-27 11:31:54 -08:00
Sam Lantinga 58aecf0a54 SDL API renaming: SDL_rect.h
Fixes https://github.com/libsdl-org/SDL/issues/6887
2022-12-27 11:01:11 -08:00
Sam Lantinga 659abc721a SDL API renaming: SDL_gamecontroller.h
SDL_gamecontroller.h has been renamed SDL_gamepad.h, and all APIs have been renamed to match.

Fixes https://github.com/libsdl-org/SDL/issues/6885
2022-12-27 09:47:24 -08:00
Sam Lantinga cc0296c934 SDL API renaming: SDL_surface.h
Fixes https://github.com/libsdl-org/SDL/issues/6884
2022-12-27 06:36:39 -08:00
Sam Lantinga 2db699f48e SDL API renaming: SDL_sensor.h
Fixes https://github.com/libsdl-org/SDL/issues/6888
2022-12-27 06:23:39 -08:00
Sam Lantinga 0d54115235 SDL API renaming: SDL_render.h
Fixes https://github.com/libsdl-org/SDL/issues/6883
2022-12-27 06:21:13 -08:00
Sam Lantinga 083e436a1a SDL API renaming: SDL_pixels.h
Fixes https://github.com/libsdl-org/SDL/issues/6886
2022-12-27 06:08:31 -08:00
Sam Lantinga fc478c1bc0 SDL API renaming: SDL_joystick.h
Fixes https://github.com/libsdl-org/SDL/issues/6881
2022-12-27 05:50:46 -08:00
Sylvain Becker aa0053141b
Remove SDL_VideoInit / Quit. Prefer SDL_SubSytemInit / Quit (#6913) 2022-12-27 05:42:48 -08:00
Sylvain Becker 47170d288e
Don't export SDL_AudioInit/Quit, use SDL_InitSubsystem instead (#6912)
* Don't export SDL_AudioInit/Quit, use SDL_InitSubsystem instead

* Update README

Co-authored-by: Sam Lantinga <slouken@libsdl.org>
2022-12-27 05:22:22 -08:00
Sylvain 3fb0c8b54a Remove/Rename SDL_FreeWAV() to SDL_free() 2022-12-27 05:14:52 -08:00
Sam Lantinga 63724c113b Removed the vi format comments from the source
Vim users can use the [editorconfig plugin](https://github.com/editorconfig/editorconfig-vim) to automatically set tab spacing for the SDL coding style.

Fixes https://github.com/libsdl-org/SDL/issues/6903
2022-12-26 11:17:23 -08:00
Frank Praznik abdfa809db Prepend key modifier enum values with 'SDL_' 2022-12-23 20:35:49 -08:00
Ryan C. Gordon 1cf2b566af cpu: Removed 3DNow! support and SDL_Has3DNow().
Reference Issue #6636.
2022-12-23 09:30:56 -08:00
meyraud705 126c60cb45 Add "SDL_" prefix to RW_SEEK macros 2022-12-23 09:25:37 -08:00
Sam Lantinga 909b513c33 Made SDL_WINDOWEVENT_* and SDL_DISPLAYEVENT_* first class event types
Fixes https://github.com/libsdl-org/SDL/issues/6772
2022-12-22 07:38:13 -08:00
Sylvain b461d9e183
testautomation_rwops: update test because of change in SDL_RWwrite.
when it's not possible to write to memory ( mem_writeconst ), error code is -1 (see #6818)
2022-12-16 10:24:19 +01:00
Daniel Gibson c3bf253b09 Remove SDL3_main from build systems, remove most of src/main/*
XCode is still missing, and src/main/winrt/SDL3-WinRTResource*
still need to find a new home
2022-12-15 08:01:01 -08:00
Daniel Gibson 28b93451dc Make WinRT's SDL_main header-only
As the implementation requires C++, the user will have to include
SDL_main.h in a C++ source file (that needs to be compiled with /ZW).
It's ok to keep the standard main() implementation in plain C and use
an otherwise empty C++ source file for the SDL_main implementation part,
if both source files #include <SDL3/SDL_main.h>

Including SDL_main.h in a C source file will print a message at
compilation (when building for WinRT or possibly other not yet implemented
platforms that require C++ for main), to remind the user of also
including it in a .cpp source file. This message/warning can be disabled
with #define SDL_MAIN_NOIMPL before including SDL_main.h in the C file.
When including it in a .cpp file, there will be a compiler error with
helpful message if it's not compiled with /ZW

For this I renamend _SDL_MAIN_NOIMPL to SDL_MAIN_NOIMPL, because now it's
not for internal use only anymore, but also useful for users (that want
their main() function in a different file than the SDL_main implementation)

Add a project for the testdraw2.c test to the WinRT solution to at least
get some minimal testing on WinRT.
I won't add all tests because it's a lot of manual clicking per test,
but this should be better than nothing :)
2022-12-15 08:01:01 -08:00
Daniel Gibson 22e22ba196 Add SDL_main.h includes to tests
.. including cmake/test/*.c, whatever that does

(this is needed now because SDL.h doesn't include SDL_main.h anymore)
2022-12-15 08:01:01 -08:00
Sylvain ffaf451558
testime.c: fix wrong {} in switch 2022-12-15 14:26:18 +01:00
Sylvain ff3f4236f2
testime.c: add valid cast, since the variable as been tested non negative before 2022-12-15 14:22:11 +01:00
Sylvain 48955cce0e
test/testime.c: put back size_t 2022-12-15 14:19:02 +01:00
Sylvain deba9f4b8b
testime.c: fix various warnings + test error code from SDL_RWread, changing bytesRead to Sint64 (thanks Ozkan) see #6818 2022-12-15 14:11:08 +01:00
Sylvain Becker 1e6d4649c0
fixed build rwops (#6818)
* Fixed build
2022-12-15 10:06:15 +01:00
Ryan C. Gordon 83559503c4
test: patched to compile. 2022-12-14 23:25:09 -05:00
Ryan C. Gordon 72c1f73bc5
rwops: Make read and write work like POSIX, not stdio.
This simplifies some things, clarifies some things, and also allows
for the possibility of RWops that offer non-blocking i/o (although
none of the current built-in ones do, intentionally, we could add this
later if we choose, or people could provide things like network socket
RWops implementations now, etc.

Fixes #6729.
2022-12-14 15:47:13 -05:00
Ryan C. Gordon 5a2d0b69c8
render: Remove SDL_GetRenderDriverInfo and change SDL_CreateRenderer.
Fixes #6625.
2022-12-13 23:27:35 -05:00
Ryan C. Gordon a76053352c
gesture: Removed the gesture API from SDL3.
Fixes #6758.
2022-12-13 14:54:37 -05:00
Pierre Wendling 053ce39d67
N3DS: Semaphore fixes. (#6776)
* N3DS: Make Sem waits cooperative friendly.

The 3DS has a cooperative threading model. Sleeping after TryWait and
WaitTimeout avoid starving other threads. It inccurs a runtime penalty,
but it's better than having to hard reset your console to recover from
a deadlock.
2022-12-11 11:27:16 -08:00
Sylvain c265fb74b0 Renamed AUDIODRIVER and VIDEODRIVER hint/env to AUDIO_DRIVER and VIDEO_DRIVER 2022-12-08 09:50:09 -05:00
Sam Lantinga fcafe40948 Removed balls from the joystick API
They were only used by one joystick decades ago, so removing them for SDL3

Fixes https://github.com/libsdl-org/SDL/issues/6766
2022-12-05 13:17:18 -08:00
Ozkan Sezer 4a22ee7277 tests: avoid redefinition warnings for MSVC _CRT_???_NO_DEPRECATE macros 2022-12-05 00:35:20 +03:00
Sam Lantinga b8760a3ffe The `timestamp_us` member of the sensor events has been renamed `sensor_timestamp` and now represents nanoseconds. 2022-12-04 09:29:28 -08:00
Sam Lantinga 1a890808a4 Fixed build 2022-12-02 13:11:04 -08:00
Sylvain Becker 92cd2c0a74
Enable creation of yuv SDL_Surfaces (#6735) 2022-12-02 12:53:48 -08:00
Sam Lantinga 8121bbd083 Convert ticks to 64-bit, added nanosecond precision to the API
Fixes https://github.com/libsdl-org/SDL/issues/5512
Fixes https://github.com/libsdl-org/SDL/issues/6731
2022-12-02 12:37:41 -08:00
Pierre Wendling 3c501b963d
Clang-Tidy fixes (#6725) 2022-12-01 13:07:03 -08:00
Anonymous Maarten 11ef4df207 cmake: rely on targets from the main cmake script 2022-12-01 20:32:47 +01:00
Sylvain Becker 932f61348d
Remove mask versions of SDL_CreateRGBSurface* #6701 (#6711)
* Rename SDL_CreateRGBSurface{,From} to SDL_CreateSurface{,From}, which now takes a format parameter
2022-12-01 08:04:02 -08:00
Sam Lantinga 5750bcb174
Update for SDL3 coding style (#6717)
I updated .clang-format and ran clang-format 14 over the src and test directories to standardize the code base.

In general I let clang-format have it's way, and added markup to prevent formatting of code that would break or be completely unreadable if formatted.

The script I ran for the src directory is added as build-scripts/clang-format-src.sh

This fixes:
#6592
#6593
#6594
2022-11-30 12:51:59 -08:00
Sam Lantinga c5790359fd
Added precompiled header support for Visual Studio and Xcode (#6710)
Fixes https://github.com/libsdl-org/SDL/issues/6704
2022-11-29 18:34:15 -08:00
Anonymous Maarten e26e893daf
test: build + fix test/testgles2_sdf.c 2022-11-29 22:43:46 +01:00
Sylvain Becker fc4fc5295f
Remove depth field from SDL_CreateRGBSurfaceWithFormat and SDL_Create… (#6685)
* Remove depth field from SDL_CreateRGBSurfaceWithFormat and SDL_CreateRGBSurfaceWithFormatFrom
* Removed unused 'flags' parameter from SDL_CreateRGBSurface and SDL_CreateRGBSurfaceWithFormat
* Removed unused 'flags' parameter from SDL_ConvertSurface and SDL_ConvertSurfaceFormat
2022-11-29 09:40:09 -08:00
Sam Lantinga c2432f8d0d Rename SDLmain to SDL_main and SDLtest to SDL_test for consistency with other SDL libraries 2022-11-28 10:57:59 -08:00
Sylvain Becker 6a2200823c
Cleanup add brace (#6545)
* Add braces after if conditions

* More add braces after if conditions

* Add braces after while() conditions

* Fix compilation because of macro being modified

* Add braces to for loop

* Add braces after if/goto

* Move comments up

* Remove extra () in the 'return ...;' statements

* More remove extra () in the 'return ...;' statements

* More remove extra () in the 'return ...;' statements after merge

* Fix inconsistent patterns are xxx == NULL vs !xxx

* More "{}" for "if() break;"  and "if() continue;"

* More "{}" after if() short statement

* More "{}" after "if () return;" statement

* More fix inconsistent patterns are xxx == NULL vs !xxx

* Revert some modificaion on SDL_RLEaccel.c

* SDL_RLEaccel: no short statement

* Cleanup 'if' where the bracket is in a new line

* Cleanup 'while' where the bracket is in a new line

* Cleanup 'for' where the bracket is in a new line

* Cleanup 'else' where the bracket is in a new line
2022-11-27 08:38:43 -08:00
Sasha Szpakowski 80a9397459 Remove SDL_HINT_IDLE_TIMER_DISABLED.
SDL_DisableScreenSaver can be used instead. Fixes #6660.
2022-11-27 08:23:02 -08:00
Sam Lantinga 0a48abc860 Switch header convention from `#include "SDL.h"` to `#include <SDL3/SDLh>`
I ran this script in the include directory:
```sh
sed -i '' -e 's,#include "\(SDL.*\)",#include <SDL3/\1>,' *.h
```

I ran this script in the src directory:
```sh
for i in ../include/SDL3/SDL*.h
do hdr=$(basename $i)
   if [ x"$(echo $hdr | egrep 'SDL_main|SDL_name|SDL_test|SDL_syswm|SDL_opengl|SDL_egl|SDL_vulkan')" != x ]; then
        find . -type f -exec sed -i '' -e 's,#include "\('$hdr'\)",#include <SDL3/\1>,' {} \;
    else
        find . -type f -exec sed -i '' -e '/#include "'$hdr'"/d' {} \;
    fi
done
```

Fixes https://github.com/libsdl-org/SDL/issues/6575
2022-11-26 22:15:18 -08:00
Anonymous Maarten 1fa80ca529 cmake: testevdev needs build include headers 2022-11-26 15:37:08 -08:00
Sam Lantinga 63f307fe1f Remove SDL_config.h from the public headers
The SDL headers are no longer dependent on the build configuration.

Fixes https://github.com/libsdl-org/SDL/issues/6643 and https://github.com/libsdl-org/SDL/issues/6641
2022-11-26 04:48:36 -08:00
Sam Lantinga 8b5a7ccc76 HAVE_OPENGL is defined by CMake on macOS 2022-11-25 17:12:51 -08:00
Sam Lantinga cc1f9eb983 Use Apple's nomenclature for macOS and iOS
Fixes https://github.com/libsdl-org/SDL/issues/6621
2022-11-25 16:00:06 -08:00
Ozkan Sezer 7b21eaddce remove autotools build system
- TODO: update INSTALL.txt to replace the autotools configure
        instructions with cmake.
- TODO: update make build system to provide an equivalent to
        autotools' `make dist` ?
- TODO: update / revise github actions, replace autotools-only
        ones with cmake (e.g.: vmactions.yml for FreeBSD.)

Reference issue: https://github.com/libsdl-org/SDL/issues/6571
2022-11-25 15:37:30 -08:00
Sam Lantinga 346eeba210 Removed SDL_GetRevisionNumber()
Fixes https://github.com/libsdl-org/SDL/issues/6620
2022-11-25 13:36:14 -08:00
slime ac8fbb7040 Remove SDL_CalculateGammaRamp. 2022-11-25 13:28:56 -08:00
slime 52f4cc843d Remove SDL_SetWindowBrightness and SDL_SetWindowGammaRamp. 2022-11-25 13:28:56 -08:00
Ozkan Sezer 0b8309da0c renamed SDL PI constants to SDL_PI_D and SDL_PI_F. 2022-11-25 22:35:24 +03:00
Sam Lantinga 199423612c Updated test programs with SDL_M_PI* 2022-11-25 10:57:12 -08:00
Sam Lantinga 05139f4a2e Removed SDL_RWFromFP from the public API
This will blow up if the SDL library and the application have a different C runtime, which can easily happen on Windows.
2022-11-25 10:46:26 -08:00
Anonymous Maarten cd13600944 cmake: don't reset check state after pushing state 2022-11-24 23:33:54 +01:00
Sam Lantinga b0840eb32e Updated SDL_syswm.h for SDL 3.0
* The header is no longer dependent on SDL build configuration
* The structures are versioned separately from the rest of SDL
* SDL_GetWindowWMInfo() now returns a standard result code and is passed the version expected by the application
* Updated WhatsNew.txt and docs/README-migration.md with the first API changes in SDL 3.0
2022-11-23 14:05:59 -08:00
ZX_Huang a5b0583b7c
Add mouse test cases (#6563)
* Add mouse test cases

* fix SDL_GetGlobalMouseState result type

* fix other platforms compile error
2022-11-23 14:28:34 -05:00
Ozkan Sezer 34231f5ba0 reverted opengles removal. 2022-11-23 18:50:02 +03:00
Ozkan Sezer bd5d26071a removed testgles.c remnants. 2022-11-22 22:14:14 +03:00
Ozkan Sezer 30b1ab2add removed opengles. 2022-11-22 21:48:40 +03:00
Ozkan Sezer 5cedc2f1ff removed QNX support. 2022-11-22 20:23:40 +03:00
Ozkan Sezer e89a1f9157 removed NaCL support. 2022-11-22 20:10:47 +03:00
Ozkan Sezer 8d6fda4810 removed os2 support & support for building SDL with watcom. 2022-11-22 19:18:47 +03:00
Ozkan Sezer 63243eb3a5 removed pandora support 2022-11-22 18:50:00 +03:00
Sam Lantinga 2c4159b99a First pass at changing SDL 2.0 to SDL 3.0 2022-11-21 20:28:58 -08:00
Sylvain 3e70553c48 Unneed test before calling SDL_FreeSurface 2022-11-18 06:58:34 -08:00
Sylvain 71f2864b3a
Fix usage of sizeof() in test/testgles*.c files 2022-11-17 14:55:49 +01:00
Sylvain ddad901c0d
Remove unneeded semicolon 2022-11-17 10:43:45 +01:00
Sylvain b7358e47d5
Don't compare pointer against '0', but NULL 2022-11-17 09:18:49 +01:00
Sylvain 4192d1a1c7
Fix compilation. It needs to be casted to 'int' type 2022-11-16 21:56:19 +01:00
Sylvain ce5da5d579
Don't compare pointer against '0', but NULL 2022-11-16 21:47:43 +01:00
Anonymous Maarten 55534e277e cmake: add time out to tests to avoid ci timeouts 2022-11-16 15:42:08 +01:00
Anonymous Maarten a22fcf77fd cmake: older emscripten releases have a broken FindOpenGL.cmake
This is fixed since 3.1.10: 485a7b4d6f (diff-034f4d123f23ec5493d0fbf28cba1c36e404a991f286c8d031a22799e4e8b0e5)
2022-11-16 15:42:08 +01:00
Anonymous Maarten d8884b845e emscripten: fix warnings in tests 2022-11-16 15:42:08 +01:00
Anonymous Maarten a71e558d85 cmake: testshader needs -sLEGACY_GL_EMULATION on Emscripten 2022-11-16 15:42:08 +01:00
Anonymous Maarten cfa76973ff cmake: FindOpenGL.cmake shipped by emscripten does not have OpenGL::GL 2022-11-16 15:42:08 +01:00
Anonymous Maarten 76e3cf3840 cmake: use custom add_sdl_test_executable macro to add test 2022-11-16 15:42:08 +01:00
Pierre Wendling d080e3bf3a Silence `-Wmaybe-uninitialized` warnings in tests. 2022-11-14 21:23:08 -08:00
Sam Lantinga 0dfc829a6b Added simple BLE Steam Controller support on all platforms
This is still disabled by default via the hint SDL_HINT_JOYSTICK_HIDAPI_STEAM
2022-11-10 19:17:04 -08:00
Ozkan Sezer db01016dd6 revert replace AM_PATH_SDL2 usage with corresponding PKG_CHECK_MODULES.
Reference issue: https://github.com/libsdl-org/SDL/issues/6494 .
2022-11-07 21:15:30 +03:00
Ozkan Sezer 64c93f7804 replace AM_PATH_SDL2 usage with corresponding PKG_CHECK_MODULES. 2022-11-06 23:51:04 +03:00
Sam Lantinga da478d1f66 Fixed build 2022-10-25 10:30:56 -07:00
Simon McVittie 2dc788cb9f build: Expand version info in SDL_REVISION and SDL_GetRevision()
Instead of using a URL and git sha1, this uses `git describe` to
describe the version relative to the nearest previous git tag, which
gives a better indication of whether this is a release, a prerelease,
a slightly patched prerelease, or a long way after the last release
during active development.

This serves two purposes: it makes those APIs more informative, and it
also puts this information into the binary in a form that is easy to
screen-scrape using strings(1). For instance, if the bundled version of
SDL in a game has this, we can see at a glance what version it is.

It's also shorter than using the web address of the origin git
repository and the full git commit sha1.

Also write the computed version into a file ./VERSION in `make dist`
tarballs, so that when we build from a tarball on a system that doesn't
have git available, we still get the version details.

For the Perforce code path in showrev.sh, output the version number
followed by the Perforce revision, in a format reminiscent of
`git describe` (with p instead of g to indicate Perforce).

For the code path with no VCS available at all, put a suffix on the
version number to indicate that this is just a guess (we can't know
whether this SDL version is actually a git snapshot or has been
patched locally or similar).

Resolves: https://github.com/libsdl-org/SDL/issues/6418
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-10-22 09:27:10 -07:00
Brad Smith f4e3af15a1 Simplify OSS test by removing OpenBSD specific location of the soundcard.h header
OpenBSD has long since stopped using OSS. Remove checking for OpenBSD specific header.
2022-10-17 07:18:47 -07:00
Simon McVittie 7d230af51d testevdev: Explain why the test data is encoded the way it is
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-10-12 19:20:40 +03:00
Simon McVittie 81dee31949 testevdev: Add a static assertion for supported sizeof(long)
If this assertion fails on some platform (unlikely), we will need a
third implementation for SwapLongLE().

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-10-12 19:20:40 +03:00
Helge Deller fb32effd15 testevdev: Fix detection of word size
The check for whether to use a 32- or 64-bit swap for an array of long
values always took the 64-bit path, because <limits.h> wasn't included
and therefore ULONG_MAX wasn't defined. Turn this into a runtime check,
which a reasonable compiler will optimize into a constant.

This fixes testevdev failures on 32-bit big-endian platforms such as hppa
and older powerpc. Little-endian and/or 64-bit platforms are unaffected.

[smcv: Added commit message]
Bug-Debian: https://bugs.debian.org/1021310
Co-authored-by: Simon McVittie <smcv@collabora.com>
2022-10-11 14:33:34 -07:00
Pierre Wendling c1317175b4 PSP: Fix `Wformat` warnings. 2022-10-10 22:31:16 -07:00
Pierre Wendling 6784d84c9d N3DS: Fix `-Wformat` warnings in tests.
All warnings were about invalid specifiers. Since U/Sint32 is a long,
using `%d` emits a -Wformat warning.
2022-10-10 08:50:59 -07:00
Pierre Wendling 655275378d N3DS port (squashed)
A dedicated renderer using Citro3D would likely allow for better
much better graphical performances.
2022-10-10 08:50:59 -07:00
Cameron Gutman ec1137dfbd cmake: Apply CETCOMPAT fix from ef988fe1 to tests 2022-10-09 15:19:47 -05:00
Ozkan Sezer d022039529 testhaptic: fix watcom "&array may not produce intended result" warning 2022-10-09 12:01:02 +03:00
Anonymous Maarten b8a4b8d1cd testautomation_mouse: fix format '%i' expecting 'int' instead of 'Uint32'
Emitted by Nintendo 3DS's gcc
2022-10-08 23:41:07 +02:00
Anonymous Maarten 7ae5d8d406 testmessage: fix conversion from `intptr_t` to `Uint32`
Emitted by MSVC
2022-10-08 23:41:07 +02:00
Anonymous Maarten 02b200ef08 testoffscreen: fix '<': signed/unsigned mismatch
Emitted by MSVC
2022-10-08 23:41:07 +02:00
Anonymous Maarten 7a7980fafa testnative: fix conversion from `time_t` to `unsigned int`
Emitted by MSVC
2022-10-08 23:41:07 +02:00
Anonymous Maarten 8770689525 testmouse: add explicit int-cast to avoid warning about converting `float` to `int`
Emitted by MSVC
2022-10-08 23:41:07 +02:00
Anonymous Maarten 3c251ec41e testintersections: fix conversion from `time_t` to `unsigned int`
Emitted by MSVC
2022-10-08 23:41:07 +02:00
Anonymous Maarten b771d9beec tests: avoid MSVC preaching about unsafe functions 2022-10-08 23:41:07 +02:00
Anonymous Maarten ebae142aa4 testhaptic: fix conversion from `size_t` to `int`
Emitted by MSVC
2022-10-08 23:41:07 +02:00
Anonymous Maarten 18c776e155 testspriteminimal: fix conversion from `time_t` to `unsigned int`
Emitted by MSVC
2022-10-08 23:41:07 +02:00
Anonymous Maarten f3389f13ef testgeometry: fix conversion from 'double' to 'float', possible loss of data
emitted by MSVC
2022-10-08 23:41:07 +02:00
Anonymous Maarten 45da133999 cmake: don't error on apple when using deprecated declarations 2022-10-08 23:41:07 +02:00
Anonymous Maarten 274ec02581 testautomation: avoid format related warnings by using a few pragma's
ci: enable -Werror to a few platforms
2022-10-08 23:41:07 +02:00
Anonymous Maarten d04fa0ef76 controllermap: use enum to avoid '-Wmaybe-uninitialized'
Emitted by MinGW:

In function 'WatchJoystick',
    inlined from 'SDL_main' at D:/a/SDL/SDL/test/controllermap.c:802:9:
D:/a/SDL/SDL/test/controllermap.c:437:9: warning: 'marker' may be used uninitialized [-Wmaybe-uninitialized]
  437 |         SDL_SetTextureAlphaMod(marker, alpha);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:/a/SDL/SDL/test/controllermap.c: In function 'SDL_main':
D:/a/SDL/SDL/test/controllermap.c:355:71: note: 'marker' was declared here
  355 |     SDL_Texture *background_front, *background_back, *button, *axis, *marker;
2022-10-08 23:41:07 +02:00
Anonymous Maarten a905db9d65 testcustomcursor: fix Wswitch warning by casting the arg to an int 2022-10-08 23:41:07 +02:00
Anonymous Maarten bb527678a3 testgamecontroller: fix -Wshadow warning by renaming global axis+button textures 2022-10-08 23:41:07 +02:00
Anonymous Maarten 57c886551f automation_main.c: fix -Wformat-zero-length warning due to SDL_SetError("") 2022-10-08 23:41:07 +02:00
Anonymous Maarten be5f55c47e watcom: add ENABLE_WERROR option to makefiles 2022-10-08 23:41:07 +02:00
Anonymous Maarten 335c672498 autotools: add --enable-werror option 2022-10-08 23:41:07 +02:00
Sam Lantinga 64ea6cefaf SDL_ResetHint() no longer clears the callbacks associated with a hint
Also added SDL_ResetHints() to reset all callbacks, and clarified that SDL_ClearHints() is just used for cleanup at shutdown.

Fixes https://github.com/libsdl-org/SDL/issues/6313
2022-10-02 17:17:31 -07:00
Sam Lantinga 19ecb64e0d Fixed build 2022-10-02 10:18:57 -07:00
Sam Lantinga a00565b8ba Fixed displaying more than 18 buttons 2022-10-02 09:20:12 -07:00
Ethan Lee 0d6c4ff622
testaudioinfo: Initialize deviceName unconditionally 2022-09-29 11:36:07 -04:00
Ethan Lee 1ea1a90edb testaudioinfo: Also test SDL_GetAudioDeviceSpec 2022-09-29 10:41:40 -04:00
Jarod Hillman 40893821f2 coreaudio: Add support for SDL_GetDefaultAudioInfo (#6277)
Co-authored-by: Ethan Lee <flibitijibibo@gmail.com>
Co-authored-by: Ozkan Sezer <sezeroz@gmail.com>
2022-09-29 10:33:07 -04:00
Ryan C. Gordon d843d61cc1
Moved test/versioning.sh to build-scripts/test-versioning.sh
Reference Issue #6171.
2022-09-28 09:09:43 -04:00
Sam Lantinga 2c518747b9 Added microsecond timestamp to sensor values for PS4 and PS5 controllers using the HIDAPI driver 2022-09-27 09:56:49 -07:00
Cameron Cawley 3a6b7c9c69 testiconv: Print the total number of errors at the end 2022-09-24 08:58:51 -07:00
Sam Lantinga 7312b93d32 Fixed crash if a game controller is disconnected while the connect message is in flight 2022-09-22 22:50:28 -07:00
Sam Lantinga c70ffc2a35 Added size_t format specifier test coverage for SDL_snprintf and SDL_sscanf 2022-09-19 15:34:17 -07:00
Ozkan Sezer c833294817 tests, watcom: silence lots of W202 warnings from new vulkan headers. 2022-09-18 17:33:04 +03:00
Cameron Cawley dd51787e07 Fix SDL_PIXELFORMAT_INDEX1LSB test case 2022-09-17 13:18:32 -07:00
DS ac5b9bc4ee
Add support for X11 primary selection (#6132)
X11 has a so-called primary selection, which you can use by marking text and middle-clicking elsewhere to copy the marked text.

There are 3 new API functions in `SDL_clipboard.h`, which work exactly like their clipboard equivalents.

## Test Instructions

* Run the tests (just a copy of the clipboard tests): `$ ./test/testautomation --filter Clipboard`
* Build and run this small application:
<details>
```C
#include <SDL.h>
#include <unistd.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

void print_error(const char *where)
{
	const char *errstr = SDL_GetError();
	if (errstr == NULL || errstr[0] == '\0')
		return;
	fprintf(stderr, "SDL Error after '%s': %s\n", where, errstr);
	SDL_ClearError();
}

int main()
{
	char text_buf[256];

	srand(time(NULL));

	SDL_Init(SDL_INIT_VIDEO);
	print_error("SDL_INIT()");
	SDL_Window *window = SDL_CreateWindow("Primary Selection Test", SDL_WINDOWPOS_UNDEFINED,
			SDL_WINDOWPOS_UNDEFINED, 400, 400, SDL_WINDOW_SHOWN);
	print_error("SDL_CreateWindow()");
	SDL_Renderer *renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED);
	print_error("SDL_CreateRenderer()");

	bool quit = false;
	unsigned int do_render = 0;
	while (!quit) {
		SDL_Event event;
		while (SDL_PollEvent(&event)) {
			print_error("SDL_PollEvent()");
			switch (event.type) {
			case SDL_QUIT: {
				quit = true;
				break;
			} case SDL_KEYDOWN: {
				switch (event.key.keysym.sym) {
				case SDLK_ESCAPE:
				case SDLK_q:
					quit = true;
					break;
				case SDLK_c:
					snprintf(text_buf, sizeof(text_buf), "foo%d", rand());
					SDL_SetClipboardText(text_buf);
					print_error("SDL_SetClipboardText()");
					printf("clipboard: set_to=\"%s\"\n", text_buf);
					break;
				case SDLK_v: {
					printf("clipboard: has=%d, ", SDL_HasClipboardText());
					print_error("SDL_HasClipboardText()");
					char *text = SDL_GetClipboardText();
					print_error("SDL_GetClipboardText()");
					printf("text=\"%s\"\n", text);
					SDL_free(text);
					break;
				} case SDLK_d:
					snprintf(text_buf, sizeof(text_buf), "bar%d", rand());
					SDL_SetPrimarySelectionText(text_buf);
					print_error("SDL_SetPrimarySelectionText()");
					printf("primselec: set_to=\"%s\"\n", text_buf);
					break;
				case SDLK_f: {
					printf("primselec: has=%d, ", SDL_HasPrimarySelectionText());
					print_error("SDL_HasPrimarySelectionText()");
					char *text = SDL_GetPrimarySelectionText();
					print_error("SDL_GetPrimarySelectionText()");
					printf("text=\"%s\"\n", text);
					SDL_free(text);
					break;
				} default:
					break;
				}
				break;
			} default: {
				break;
			}}
		}
		// create less noise with WAYLAND_DEBUG=1
		if (do_render == 0) {
			SDL_RenderPresent(renderer);
			print_error("SDL_RenderPresent()");
		}
		do_render += 1;
		usleep(12000);
	}

	SDL_DestroyRenderer(renderer);
	SDL_DestroyWindow(window);
	SDL_Quit();
	print_error("quit");
	return 0;
}
```
</details>

* Use c,v,d,f to get and set the clipboard and primary selection.
* Mark text and middle-click also in other applications.
* For wayland under x:
  * `$ mutter --wayland --no-x11 --nested`
  * `$ XDG_SESSION_TYPE=wayland SDL_VIDEODRIVER=wayland ./<path_to_test_appl_binary>`
2022-09-14 09:28:35 -07:00
Sam Lantinga a7fde3f835 Allow mapping a controller other than the first one 2022-09-07 01:58:42 -07:00
Sam Lantinga 4018f35ef2 Added left and right sensors for Nintendo Joy-Con and Wii controllers 2022-09-07 00:00:27 -07:00
Ozkan Sezer 911524da45 fix DYLIB version inconsistencies and test failures after #6188. 2022-09-06 03:15:02 +03:00
Sam Lantinga acf397b4df Actually, DYLIB_COMPATIBILITY_VERSION shouldn't be updated for a stable point release
@smcv
2022-09-05 11:21:13 -07:00
Cameron Cawley cf040f8882 testmouse: Allow drawing rectangles as well as lines 2022-09-05 08:51:36 -07:00
Cameron Cawley a932581775 testplatform: Add LSX and LASX checks 2022-09-05 08:50:28 -07:00
Sam Lantinga 4e98ba612b Set DYLIB_COMPATIBILITY_VERSION to DYLIB_CURRENT_VERSION to match autotools
Autotools sets both versions to the same value, so Xcode and CMake need to match for the libraries to be compatible between the different builds.

See these for details:
https://github.com/libsdl-org/sdl12-compat/pull/207
https://github.com/libsdl-org/SDL/issues/2934
https://stackoverflow.com/questions/67055770/usage-of-current-version-and-compatibility-version-on-macos
2022-09-05 08:28:06 -07:00
Érico Porto cbc0d9facc test/versioning.sh also tests configure 2022-09-04 05:20:15 -07:00
Sam Lantinga 6bcf2c1521 Fixed spinning at a very high framerate 2022-09-02 17:04:53 -07:00
Sam Lantinga 3cbfd75d0f Re-added the CRC to the joystick guid
This is now used as a crc field in the mapping rather than directly in mapping guids, for better mapping compatibility between versions of SDL.

Added SDL_GetJoystickGUIDInfo() to get device information encoded in a joystick GUID, so that mapping programs can clear the CRC from the GUID when generating mappings.

sort_controllers.py has been updated to extract the CRC from mappings created by older mapping programs and convert it into the new crc field. It will also take the CRC into account when checking for duplicate mappings.

Also regenerated the GUIDs for the PS2/PSP/Vita controller mappings, fixing https://github.com/libsdl-org/SDL/issues/6151
2022-08-27 19:00:31 -07:00
Cameron Gutman 2ceea46061 cmake: Enable CET compatibility for x86/x64 targets using VS 16.7+ 2022-08-24 11:29:36 -07:00
Cameron Gutman 99e9156ff5 testgles2: Fix typo in help text 2022-08-16 20:38:55 -07:00
Cameron Gutman 222f1a2693 testgles2: Add --threaded option to use a render thread per window
This is helpful for reproducing bugs like #6056
2022-08-16 07:29:07 -07:00
Sam Lantinga aaec244cfd Don't run the stdio automated tests if libc isn't available 2022-08-10 09:05:55 -07:00
Sam Lantinga d4192850c1 Added SDL_ResetHint() to reset a hint to the default value
Resolves question of how to clear an override hint raised by @pionere in https://github.com/libsdl-org/SDL/pull/5309
2022-08-10 08:01:24 -07:00
Pierre Wendling 73d8d02629 Test: Fix Exp base case for Win32.
Add epsilon to the check.
2022-08-09 21:39:46 -07:00
Ryan C. Gordon 3a9295e14f
build-scripts: Removed winrtbuild.*, no longer used.
WinRT/UWP is still supported, but you have to use the VS2019
project files, now.

Fixes #5639.
2022-08-09 16:17:28 -04:00
Sam Lantinga 878259722f Added SDL_GameControllerType enumeration for Nintendo Switch Joy-Con controllers 2022-08-08 08:22:20 -07:00
Francisco Javier Trujillo Mata 46f95a7a5f Create dummy PS2 Video driver 2022-08-02 11:40:31 -07:00
Sam Lantinga 2fa2f9ff77 Greatly improved Nintendo Joy-Con support using the HIDAPI driver
* Added support for mini-gamepad mode for Joy-Con controllers, matching the mapping for hid-nintendo on Linux and iOS 16
* Added the ability to merge left and right Joy-Con controllers into a single Pro-style controller
* Added the hint SDL_HINT_JOYSTICK_HIDAPI_SWITCH_COMBINE_JOY_CONS to control this merging functionality
* Removed the hint SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS
2022-07-28 19:22:27 -07:00
Cameron Gutman b8a5540740 testgamecontroller: Add battery reporting 2022-07-24 15:21:04 -05:00
Anonymous Maarten ac9e8691a2 cmake: only build testnative when X11 is available 2022-07-21 14:49:35 +02:00
Sam Lantinga 7e2a996958 Added a virtual joystick automated test
Useful to verify 4fa2653394 on a big-endian system
2022-07-13 08:58:15 -07:00
Francisco Javier Trujillo Mata 643f9e56d0 Rename folder created in test_filesystem 2022-07-03 09:24:55 -07:00
Cameron Cawley 0a600b1df4
Merge testguid into testautomation (#5873) 2022-07-01 16:27:51 -07:00
Cameron Cawley 0025621b80 Add a default URL in testurl 2022-07-01 13:54:17 -07:00
Sam Lantinga 391dd0d94b Don't spin as quickly as possible in the checkkeys rendering loop 2022-07-01 13:35:41 -07:00
Sam Lantinga e9d5060c4c checkkeys will now render text that is input
Also added test functions for multi-line debug text display

Currently this only supports ASCII, as the font doesn't have the correct Latin-1 characters
2022-07-01 12:56:47 -07:00
Sam Lantinga 24251fb544 Fixed checkkeys closing when tapping the screen on a phone 2022-06-29 17:40:45 -07:00
Sam Lantinga cbd0187475 Removed the limit on the size of the SDL error message
Also added SDL_GetOriginalMemoryFunctions()

Fixes https://github.com/libsdl-org/SDL/issues/5795
2022-06-27 16:59:50 -07:00
chalonverse 3b191580c3
Windows GDK Support (#5830)
* Added GDK

* Simplfied checks in SDL_config_wingdk.h

* Added testgdk sample

* Added GDK readme

* Fixed error in merge of SDL_windows.h

* Additional GDK fixes

* OpenWatcom should not export _SDL_GDKGetTaskQueue

* Formatting fixes

* Moved initialization code into SDL_GDKRunApp
2022-06-27 10:19:39 -07:00
Francisco Javier Trujillo Mata 84d69da4e1 Initial SDL_ps2_main implementation 2022-06-27 00:32:43 -07:00
Anonymous Maarten 965c164537 cmake: let cmake test script make use of the installed cmake scripts 2022-06-23 14:17:38 +02:00
Anonymous Maarten 3e1021239a cmake: also add the recently-added include folder to the public interface 2022-06-22 17:04:58 +02:00
Sam Lantinga 9065897514 Added test for digit count in sscanf, e.g. "%1x" 2022-06-18 06:53:05 -07:00
Sam Lantinga 28ecdc6bc7 No need to cast from char* to const char* 2022-06-18 06:52:46 -07:00
Sam Lantinga 5d5488ca71 Fixed test/versioning.sh on macOS 2022-06-16 12:41:31 -07:00
Francisco Javier Trujillo Mata 580416d3c8 Initial CMake configuration 2022-06-15 15:15:26 -07:00
Pierre Wendling 6bd3e0b189 Test: Check sqrt and atan against the epsilon.
On i686-linux, the `sqrt_regularCases` and `atan_limitCases` tests would
fail as the result was not precise enough.
2022-06-15 23:32:40 +03:00
Pierre Wendling cee47a9ebe Test: Use inexact helper for log10 regular cases.
On ARMv6, the result is not precise enough for this function.
2022-06-15 12:05:30 -07:00
Pierre Wendling a52b8580f0 Test: Tidy up test descriptions and documentation.
Test function documentation now lists the input(s) and expected output(s).
Descriptions in TestCaseReference were updated.
2022-06-15 12:05:30 -07:00
Pierre Wendling 4d7f12f6bd Test: Add Atan2 tests to math suite. 2022-06-15 12:05:30 -07:00
Pierre Wendling 8ebe640a36 Test: Change inexact tests to use an epsilon.
Instead of using `trunc` to check the first ten digits, inexact test now
relies on an epsilon defining an acceptable range for the expected
result to be in.
2022-06-15 12:05:30 -07:00
Pierre Wendling 62fd6aad39 Test: Add Atan tests to math suite. 2022-06-15 12:05:30 -07:00
Pierre Wendling 6a6e93bc29 Test: Add +/-0.0 tests to Acos. 2022-06-15 12:05:30 -07:00
Pierre Wendling 6b4b6d8e59 Test: Add Asin tests to math suite. 2022-06-15 12:05:30 -07:00
Pierre Wendling 43f6983a24 Test: Add Acos tests to math suite. 2022-06-15 12:05:30 -07:00
Pierre Wendling 95f6edb9a5 Test: Refactor trigonometric tests into a helper.
The precision test of these functions need a special helper, it can also
be used for their arc functions down the line.
2022-06-15 12:05:30 -07:00
Pierre Wendling 3b9f47b85f Test: Remove early return in pow test. 2022-06-15 12:05:30 -07:00
Pierre Wendling 6be430c7f7 Test: Add Tan tests to math suite. 2022-06-15 12:05:30 -07:00
Pierre Wendling af79b46f9e Test: Add Sin tests to math suite. 2022-06-15 12:05:30 -07:00
Pierre Wendling b06eda55e9 Test: Fix math suite build on Win32.
The cosine precision test now uses an array of double and the result
gets truncated instead of casted to signed int64.
2022-06-15 12:05:30 -07:00
Pierre Wendling adb445eafb Test: Add Cos tests to math suite. 2022-06-15 12:05:30 -07:00
Pierre Wendling a864180cf3 Test: Add float header for FLT_RADIX definition. 2022-06-15 12:05:30 -07:00
Pierre Wendling 7a55fa4e56 Test: Add Scalbn tests to math suite. 2022-06-15 12:05:30 -07:00
Pierre Wendling afd812374f Test: Add Sqrt tests to math suite. 2022-06-15 12:05:30 -07:00
Pierre Wendling c389c32d30 Test: Change assertion type in range tests.
Changes SDLTest_AssertPass(...) to SDLTest_AssertCheck(SDL_FALSE, ...)
for failed assertions so the internal counter gets updated properly.
2022-06-15 12:05:30 -07:00
Pierre Wendling 5ecc75a4fc Test: Add Pow tests to math suite. 2022-06-15 12:05:30 -07:00
Pierre Wendling 6349ad7319 Test: Add Log10 tests to math suite. 2022-06-15 12:05:30 -07:00
Pierre Wendling 7041bbaf00 Test: Add Log tests to math suite. 2022-06-15 12:05:30 -07:00
Pierre Wendling dd30ff2e31 Test: Add Exp tests to math suite. 2022-06-15 12:05:30 -07:00
Pierre Wendling aacb5e1774 Test: Extract range test parameters into defines. 2022-06-15 12:05:30 -07:00
Pierre Wendling 75b9aab6c1 Test: Add Fmod tests to math suite. 2022-06-15 12:05:30 -07:00
Pierre Wendling 0dbdf90e7b Test: Use SDLCALL in typedefs instead of ifdefs.
Thanks to @sezero for the tip.
2022-06-15 12:05:30 -07:00
Pierre Wendling 2ec48b36ba Test: Fix OS/2 compilation in math suite. 2022-06-15 12:05:30 -07:00
Pierre Wendling 43c22e5d1e Test: Refactor math suite duplicate code.
Many tests were using the same underlying routine, as such three helper
functions were added:
- A wrapper to test double -> double functions.
- A wrapper to test (double, double) -> double functions,
- A wrapper for range tests on double -> double functions.
2022-06-15 12:05:30 -07:00
Pierre Wendling 3d720ba381 Test: Refactor math suites edge cases.
Split infinity and zero checks in their own functions.
The result of NAN tests is now logged.
The SDL_TestCaseReference structure were renamed to be more explicit.
2022-06-15 12:05:30 -07:00
Pierre Wendling a530fc9199 Test: Add Copysign tests to math suite. 2022-06-15 12:05:30 -07:00
Pierre Wendling 48a406db4d Test: Add Fabs tests to math suite. 2022-06-15 12:05:30 -07:00
Pierre Wendling 2130dff0fc Test: Add Round tests to math suite. 2022-06-15 12:05:30 -07:00
Pierre Wendling 324b96153f Test: Add Trunc tests to math suite. 2022-06-15 12:05:30 -07:00
Pierre Wendling b09266a4ef Test: Add Ceil tests to math suite. 2022-06-15 12:05:30 -07:00
Pierre Wendling 9eb09d2392 Test: Refactored and formatted math test suite. 2022-06-15 12:05:30 -07:00
Pierre Wendling 0f630e9177 Test: fix indentation in Makefile.in. 2022-06-15 12:05:30 -07:00
Pierre Wendling 4e3a26e271 Test: Add math test suite to autotools. 2022-06-15 12:05:30 -07:00
Pierre Wendling e64acb619a Test: Fix for-loop for OS/2 in math suite. 2022-06-15 12:05:30 -07:00
Pierre Wendling a3a852e912 Test: Unrolled the array of cases in math suite.
On OS/2, `INFINITY` is a `const double` which cannot be used to
instantiate an array.
2022-06-15 12:05:30 -07:00
Pierre Wendling c23216bf46 Test: Removed static from local variables (Math).
Static would break compilation on OS/2.
2022-06-15 12:05:30 -07:00
Pierre Wendling 6646edf692 Test: Fix Windows build for math suite. 2022-06-15 12:05:30 -07:00
Pierre Wendling d9ff6380ae Test: Add math test suite to Watcom Makefile. 2022-06-15 12:05:30 -07:00
Pierre Wendling 7389eba943 Test: Fix C89 declaration and math include. 2022-06-15 12:05:30 -07:00
Pierre Wendling b3faebb8a8 Test: Add Floor tests to math. 2022-06-15 12:05:30 -07:00
Pierre Wendling b72b5d0f99 Test: Add math automation test suite. 2022-06-15 12:05:30 -07:00
Anonymous Maarten 97711e99fe cmake: no need to explicitly add a depency (target_link_libraries does this implicitly) 2022-06-15 11:11:49 -07:00
Anonymous Maarten ad21c70408 cmake: fix CMP0072 warning by prefering GLVND 2022-06-15 11:11:49 -07:00
Ozkan Sezer 163f669745 minor tidy-up to configury. 2022-06-15 17:00:02 +03:00
Simon McVittie e974985998 test: Add test coverage for surface size overflows
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-06-13 11:53:53 -07:00
Simon McVittie 63b3b9a558 Fix some typos in diagnostic messages
Detected by Debian's packaging QA tool, Lintian.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-06-13 08:33:27 -07:00
Eric Wasylishen 2830895740 testgles2.c: refresh cached SDL_GL_GetDrawableSize() on SDL_WINDOWEVENT_SIZE_CHANGED, not SDL_WINDOWEVENT_RESIZED
Fixes bug with viewport not updating when moving window between monitors with different scale
factors on Windows (this should also fix the same issue on other OS'es, though untested)
2022-06-11 14:19:01 -07:00
Eric Wasylishen df36f926fc testautomation: add video_setWindowCenteredOnDisplay test 2022-06-11 14:19:01 -07:00
Sam Lantinga 51d6d60f11 Updated to autoconf 2.71 2022-06-08 10:14:36 -07:00
Sam Lantinga 30cf26e089 Show the firmware version in testgamecontroller 2022-06-06 06:59:54 -07:00
Christoph Reichenbach 46624b4e1d Removed two distracting gcc-11 warnings 2022-06-05 14:11:10 +03:00
Christoph Reichenbach 3a20274ddf Refactoring: move GUID operations out of Joystick
- SDL_JoystickGUID -> SDL_GUID (though we retain a type alias)
- Operations for GUID <-> String ops are now in
  src/SDL_guid.c and include/SDL_guid.h
- The corresponding Joystick operations delegate to SDL_guid.c
- Added test/testguid.c
2022-06-04 17:22:13 -07:00
Christoph Reichenbach 4e07d4722d Build warning fixes for gcc-11.3 2022-06-04 17:41:00 +03:00
Sam Lantinga 345efdcb10 Wait for all the threads to actually finish before exiting
Fixes https://github.com/libsdl-org/SDL/issues/5748
2022-06-03 08:46:08 -07:00
Cameron Cawley 4c711d2d43 testcustomcursor: Allow running without custom or system cursors 2022-05-25 14:25:54 -07:00
Simon McVittie a95f5a792c test: Use install(1) more portably
I had assumed that only Linux users would be interested in GNOME-style
installed-tests, but in principle there's no reason why they can't be
used on non-Linux.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-20 22:22:20 +03:00
Ozkan Sezer 848d2008c6 test/Makefile.w32: fix minor typo 2022-05-20 21:10:56 +03:00
Cameron Cawley 83ae1b4987 Convert the test executables to AIF in RISC OS CMake builds 2022-05-19 15:26:13 -07:00
Cameron Cawley d2b5965894 Remove extra path separator in GetNearbyFilename 2022-05-19 15:25:49 -07:00
Cameron Cawley aa51a9791a Run tests with OpenWatcom on CI 2022-05-19 20:11:10 +03:00
Cameron Cawley 9dfa000bc0 Initial support for building for Windows with OpenWatcom 2022-05-19 20:11:10 +03:00
Cameron Cawley 5ef36ead08 Add some missing tests to Watcom builds 2022-05-19 20:11:10 +03:00
Cameron Cawley 3066873126 Split the common code in test/Makefile.os2 into a separate file 2022-05-19 20:11:10 +03:00
Cameron Cawley 0cca71a846 Use SDLCALL for callbacks in public APIs 2022-05-18 15:01:27 -07:00
Sam Lantinga 0ffd985972 Check to see if the file exists in the base path before returning it 2022-05-18 10:10:51 -07:00
pionere c4cf63f812 improve test-configuration
- testkeys 'NEEDS_DISPLAY'
- 'disable' relevant tests in case DUMMY audio/video is disabled
2022-05-18 09:06:56 -07:00
pionere ea15253220 fix GetNearbyFilename
- fix memory leak due to variable 'base'
- fix usage of uninitialized variable (path)
2022-05-18 08:30:34 -07:00
Ryan C. Gordon a12ffbd532 testcustomcursor: Log the current cursor type as it changes.
So you know what you're looking at.
2022-05-17 12:49:36 -04:00
Sam Lantinga 1f2a241688 Add new virtual joysticks to the end of the list
This guarantees that the device index that's returned is stable, as long as no joystick hotplug events occur.
2022-05-16 09:02:35 -07:00
Sam Lantinga 3c3ccb1d48 Fixed crash if a virtual joystick was disconnected 2022-05-16 08:56:17 -07:00
Sam Lantinga f0bc5c9cbf Added effects support for virtual controllers 2022-05-16 07:21:28 -07:00