Commit Graph

11339 Commits (927c4d4aa45d79d6e0235a8f85b41f77c39d135b)

Author SHA1 Message Date
Shawn Hoffman 927c4d4aa4 fix string literal constness warnings
# Conflicts:
#	src/video/winrt/SDL_winrtvideo.cpp
2022-12-22 10:03:40 -08:00
Ryan C. Gordon 7a5a1b16ce
events: Make sure new display events don't overlap with sdl2-compat.
Reference PR #6867.
2022-12-22 11:47:54 -05:00
Ryan C. Gordon 3197632347
include: Renamed begin_code.h and close_code.h to have SDL_ prefixes.
Fixes #6864.
2022-12-22 11:39:26 -05: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
Anonymous Maarten 4676d1d31e android: register all methods using JNI_OnLoad 2022-12-21 23:00:58 -08:00
Ryan C. Gordon c9887c5c72
include: Split out functions in SDL.h to SDL_init.h.
SDL.h now exists solely as a header that includes everything else, instead
of one that forces you to include everything else when you just want the
declaration for SDL_Init().

Fixes #6840.
2022-12-22 01:05:10 -05:00
Ryan C. Gordon 182806e39f
docs: Updated migration notes for SDL_RWops. 2022-12-22 00:55:54 -05:00
Anonymous Maarten 3b8548cdcf android: fix java fingerprint fo nativeAddJoystick 2022-12-21 09:39:22 -08:00
Anonymous Maarten 9e6952ed8c android: fix android-prefab.sh for SDL3 2022-12-21 09:39:22 -08:00
Anonymous Maarten 19d4d64cfe cmake: disable precompiled header for SDL_spinlock.c when targeting Android
This fixes the following error:
error: PCH file was compiled for the target 'thumbv7-none-linux-android16' but the current translation unit is being compiled for target 'armv7-none-linux-android16'
2022-12-21 09:39:22 -08:00
Anonymous Maarten 9421828e7e gendynapi.py: add android native symbols to SDL_dynapi.sym 2022-12-21 09:39:22 -08:00
Anonymous Maarten 063cb60659 gendynapi.py: use pathlib + uppercase global variables 2022-12-21 09:39:22 -08:00
Caleb Cornett 19039b6ca4 Fix GDK OpenGL build error 2022-12-20 23:18:04 -05:00
Caleb Cornett 3ebfb15469 gdk: Add support for building with OpenGL on Xbox 2022-12-19 17:57:06 -05:00
Sam Lantinga de871dc5f7 Sorted headers in Xcode project
This lets us more easily see when one is missing
2022-12-19 09:55:53 -08:00
Sam Lantinga 0d172ccb40 Fixed marking SDL headers as public in the Xcode project
Fixes https://github.com/libsdl-org/SDL/issues/6851
2022-12-19 09:45:43 -08:00
Anonymous Maarten 8f9227e4be cmake: use CMakePushCheckState to handle check states 2022-12-19 09:19:45 -08:00
Anonymous Maarten fab33545fa cmake: remove outdated fixme 2022-12-19 09:19:45 -08:00
Anonymous Maarten fe8291e09a cmake: only install SDL_test*.h headers when building SDL_test library 2022-12-19 09:19:45 -08:00
Anonymous Maarten d53cd7161a sdlwiki: SDL_version.h moved to include/SDL3 2022-12-19 09:19:45 -08:00
Anonymous Maarten 653893f188 cmake: declutter root + remove obsolete variables 2022-12-19 09:19:45 -08:00
Anonymous Maarten 39a7abad7a cmake: lowercase all macros 2022-12-19 09:19:45 -08:00
Anonymous Maarten 289b024715 cmake: add function to print dict list 2022-12-19 09:19:45 -08:00
Anonymous Maarten a787b1c0b7 cmake: LINKER_LANGUAGE is a target property, not a cmake variable
LINKER_LANGUAGE needs to be used as following:
Usage

  cmake [options] <path-to-source>
  cmake [options] <path-to-existing-build>
  cmake [options] -S <path-to-source> -B <path-to-build>

Specify a source directory to (re-)generate a build system for it in the
current working directory.  Specify an existing build directory to
re-generate its build system.

Run 'cmake --help' for more information.

Haiku does not not this property explicitly set because CMake knows .cc files are c++
2022-12-19 09:19:45 -08:00
Anonymous Maarten 69812678cf cmake: cache cmake config installation folder in SDL_INSTALL_CMAKEDIR_ROOT
Make sure SDLx is not part of the cached variable such that it can be re-used by SDL2 and SDL3
2022-12-19 09:19:45 -08:00
Anonymous Maarten 88784ba547 .editorconfig: remove autotools files + trim whitespace from cmake files 2022-12-19 09:19:45 -08:00
Sam Lantinga 83b29f9ce1 Don't send Razer devices the Sony third-party query feature report
Some of them lock up or reset, and the vast majority of devices are not actually game controllers.

Fixes https://github.com/libsdl-org/SDL/issues/6733
2022-12-19 09:14:55 -08:00
Maido 94a0e5ea8d
Android active driver check (#6850)
Check if a driver is active before attempting to handle the devices.
Otherwise an assertion will fail.
2022-12-19 16:02:10 +01:00
Sylvain Becker 5bf8bc2241
Android JAVA DetectDevices: 'is_capture' is inverted (#6845)
* Android JAVA DetectDevices: 'is_capture' is inversed
* Android Audio: adding audio device. also inverted capture, from jni side
2022-12-18 16:55:59 +01:00
Yevhen Babiichuk (DustDFG) 7fc8533b62
Use alias types for which members of event structs instead of plain types (#6841)
Signed-off-by: Yevhen Babiichuk (DustDFG) <dfgdust@gmail.com>

Signed-off-by: Yevhen Babiichuk (DustDFG) <dfgdust@gmail.com>
2022-12-18 12:10:15 +01:00
Sylvain Becker 186687bda9
Android: make Detect devices common between aaudio and android driver. (#6828)
remove VLA, dynamic alloc, check max length get using GetIntArrayRegion
2022-12-18 12:07:38 +01:00
Ryan C. Gordon 78725dc0cd
include: Fixed a C++-style single line comment.
Reference Issue #6838.
2022-12-17 23:52:33 -05:00
Ryan C. Gordon d927befcd7
docs: Just adjusting some link text. 2022-12-17 13:06:44 -05:00
Ryan C. Gordon 7b25f04476
README-migration.md: Point to the SDL_gesture repository. 2022-12-17 13:05:00 -05:00
Ryan C. Gordon 3b5780ba0a
README-migration.md: Updated stdio RWops example code for new API. 2022-12-17 13:05:00 -05:00
Sam Lantinga d305bc6d55 Fixed order of operations problem when tearing down the window
Make sure the window framebuffer is cleaned up before shutting down OpenGL, as it might be implemented using an OpenGL texture.

Fixes this call stack:
```
(gdb) p _this
$1 = (SDL_VideoDevice *) 0x42e360
(gdb) p _this->egl_data
$2 = (struct SDL_EGL_VideoData *) 0x0
```
2022-12-17 07:09:24 -08:00
Sam Lantinga b678a98024 Fixed compiler warning
```
 ./src/thread/pthread/SDL_syssem.c:140:12: warning: variable 'retval' is used uninitialized whenever 'while' loop exits because its condition is false [-Wsometimes-uninitialized]
    while (sem_trywait(&sem->sem) != 0) {
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
./src/thread/pthread/SDL_syssem.c:149:12: note: uninitialized use occurs here
    return retval;
           ^~~~~~
./src/thread/pthread/SDL_syssem.c:140:12: note: remove the condition if it is always true
    while (sem_trywait(&sem->sem) != 0) {
```

This was a legitimate bug, thank you clang!

Fixes https://github.com/libsdl-org/SDL/issues/6830
2022-12-17 06:58:02 -08:00
Sam Lantinga 9c9e6e3aa3 Fixed compiler warning
```
 ./src/joystick/SDL_joystick.c:105:12: warning: no previous extern declaration for non-static variable 'SDL_joystick_lock' [-Wmissing-variable-declarations]
SDL_mutex *SDL_joystick_lock = NULL; /* This needs to support recursive locks */
           ^
./src/joystick/SDL_joystick.c:105:1: note: declare 'static' if the variable is not intended to be used outside of this translation unit
SDL_mutex *SDL_joystick_lock = NULL; /* This needs to support recursive locks */
^
```
1 warning generated.

(cherry picked from commit 3b0cd441584ada86c4456afb4e8b3edaf2173073)
2022-12-17 06:54:33 -08:00
Sylvain dce2546534
Revert wrong comment in SDL_surface.h for SDL3 (see #6824) 2022-12-16 16:42:06 +01:00
Maido abf5cc5203
Android audio device selection (#6824)
Make it possible to select a specific audio device for Android
2022-12-16 16:40:02 +01: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
Sam Lantinga 6570febd47 Sorted PS4 controllers, note that the NACON Wireless Controller for PS4 actually reports as an XInput device
(cherry picked from commit a53382e460f43873ce5362460af6a47a528a6425)
2022-12-15 18:02:24 -08:00
Sam Lantinga 0da118ce45 Note that the NACON Daija Arcade Stick is an arcade stick
(cherry picked from commit e99b9ca9c0c4c5a03d0a9088bee623218ac840a5)
2022-12-15 18:02:15 -08:00
Sam Lantinga 5a45d2e58b Updated Xcode project for SDL_main as a header-only library 2022-12-15 10:53:44 -08:00
Daniel Gibson ab554c8392 Update doc/README-* for header-only SDL_main 2022-12-15 08:01:01 -08: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 63d3fb469d Move src/main/haiku/ to src/core/
turns out that this wasn't even built as a static libSDLmain,
but as part of the (possibly dynamic) libSDL3
2022-12-15 08:01:01 -08:00
Daniel Gibson 989a8ca90e Port PSP SDL_main to header-only + SDL_RunApp() 2022-12-15 08:01:01 -08:00
Daniel Gibson b1b3bd654d Port PS2 SDL_main to header-only + SDL_RunApp() 2022-12-15 08:01:01 -08:00
Daniel Gibson 544f2c7982 Port ngage to header-only SDL_main + SDL_RunApp()
For some reason, ngage doesn't seem to be handled in any of the
build systems, so I couldn't add SDL_ngage_runapp.cpp to any buildscript
2022-12-15 08:01:01 -08:00