Commit graph

10235 commits

Author SHA1 Message Date
Sam Lantinga 55b03c7493 Updated to version 2.24.2 for point release 2022-11-01 05:47:12 -07:00
Anonymous Maarten beeac60227 cmake: fix finding wayland-libdecor
It was broken in 11d53c84a7
(cherry-picked from commit 0823b5973a)
2022-10-24 20:37:00 +03:00
Anonymous Maarten 214258660f cmake: use pkg-config's library dirs as hint for finding a shared library
(cherry-picked from commit 11d53c84a7)
2022-10-24 20:37:00 +03:00
Sam Lantinga 08f83f953c Don't use RAWINPUT joystick driver on Windows XP
Fixes https://github.com/libsdl-org/SDL/issues/6400
(cherry-picked from commit 5025f24033)
2022-10-24 20:37:00 +03:00
Sam Lantinga d1dcbfe9e9 Only check to see if the ICC profile changes when the display changes or we gain focus
Fixes https://github.com/libsdl-org/SDL/issues/6366
(cherry-picked from commit 61b5360e17)
2022-10-24 20:37:00 +03:00
Sam Lantinga c0d1f73247 d3d12: actually execute the pending commands before processing resize
This makes sure all the resources are in the expected state

Fix the D3D12 case in https://github.com/libsdl-org/SDL/issues/6376
(cherry-picked from commit df1bd07dee)
2022-10-24 20:37:00 +03:00
Sam Lantinga 923ab93969 d3d12: fixed window resize handling
Fixes https://github.com/libsdl-org/SDL/issues/6355
(cherry-picked from commit f99fc3268e)
2022-10-24 20:37:00 +03:00
Sam Lantinga 1f82b4a96f d3d12: reset the vertex buffer size when it is released
(cherry-picked from commit 490c20f93f)
2022-10-24 20:37:00 +03:00
GNQG a053211a2a fix SDL_SendEditingText when long composition text is enabled and strlen(text) == SDL_TEXTEDITINGEVENT_TEXT_SIZE
(cherry-picked from commit 965ba1e097)
2022-10-24 20:15:00 +03:00
Sam Lantinga 2d580f8f45 Define _USE_MATH_DEFINES for Visual Studio (thanks @pionere!)
Fixes https://github.com/libsdl-org/SDL/issues/3790
(cherry-picked from commit c6e8961979)
2022-10-24 20:04:21 +03:00
Anonymous Maarten b8c6d3d7e1 cmake: mark hidapi as disabled when not found
(cherry-picked from commit 19b13aab98)
(cherry-picked from commit c3495ec6ea)
(cherry-picked from commit 6dfd7a17e1)
2022-10-24 20:04:21 +03:00
Anonymous Maarten 1e5daf1bef cmake: fix build with SDL_WAYLAND_SHARED=OFF
(cherry-picked from commit 711846c1f4)
2022-10-24 20:04:21 +03:00
Simon McVittie 21e23ef913 testevdev: Explain why the test data is encoded the way it is
Signed-off-by: Simon McVittie <smcv@collabora.com>

(cherry-picked from commit 7d230af51d)
2022-10-24 20:04:21 +03:00
Simon McVittie 4a0ad650d0 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>

(cherry-picked from commit 81dee31949)
2022-10-24 20:04:21 +03:00
Helge Deller e07f106760 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>

(cherry-picked from commit fb32effd15)
2022-10-24 20:04:20 +03:00
Sam Lantinga 88e64108f5 Clarified that GNU sort isn't required, we just need the -V option to be supported
(cherry-picked from commit f687cbd4c6)
2022-10-24 20:04:20 +03:00
Sam Lantinga 1b5bf2ac65 GNU sort isn't available on older macOS and some BSD systems
Don't prevent building entirely, just warn that we won't be able to find dynamic libraries in this case.

Fixes https://github.com/libsdl-org/SDL/pull/6338
(cherry-picked from commit 8c587636dc)
2022-10-24 20:04:20 +03:00
Ozkan Sezer 679d33ab44 updated VS project file
(cherry-picked from commit e3b2830f99)
2022-10-24 20:04:20 +03:00
Ozkan Sezer 9e72ec4ed9 Makefile.w32: no need for the description field, we have a *.res already
(cherry-picked from commit 1b52145bad)
2022-10-24 20:04:20 +03:00
Ozkan Sezer 8104992064 testhaptic: fix watcom "&array may not produce intended result" warning
(cherry-picked from commit d022039529)
2022-10-24 20:04:20 +03:00
Ozkan Sezer 51958da000 loadso, dlsym, SDL_LoadFunction: cleanup the underscored name path.
- strlcpy was passed a wrong buffer length parameter. has worked so
  far by luck.
- use memcpy instead of strlcpy for simplicity.
- 'append' has been a typo: should be 'prepend'.

(cherry-picked from commit 3d415bc5d6)
2022-10-22 20:04:20 +03:00
Ozkan Sezer b435252b29 hidapi, libusb: remove os/2 symbol load hack after os/2 loadso updates
(cherry-picked from commit 65a38a4015)
2022-10-22 20:04:20 +03:00
Ozkan Sezer eb43d57880 os2 loadso improvements:
- SDL_LoadObject: upon failure, strip the .dll extension and retry,
  but only if module name has no path.
- SDL_LoadFunction: upon failure, retry with an underscore prepended,
  e.g. for gcc-built dlls.

(cherry-picked from commit 3f1b5efcca)
2022-10-22 20:04:20 +03:00
Ozkan Sezer 92937ff5e0 os2: fix error message for SDL_LoadObject()
(cherry-picked from commit 4264c0b674)
2022-10-22 20:04:20 +03:00
Anonymous Maarten 36b987dabe cmake: else() does not need an argument 2022-10-20 13:30:37 +02:00
Ryan C. Gordon 266ca2c933 coreaudio: Dispose of AudioQueue before waiting on the thread.
Otherwise the thread might block for a long time (more than 10 seconds!).
It's not clear to me why this happens, or why its safe to do this with a
resource that's still in use, but we have, until recently, always
disposed of the AudioQueue first, so changing back is probably okay.

Also changed the disposal to allow in-flight buffers to reach hardware;
otherwise you lose the last little bit of audio that's already been queued
but not played, which you can hear clearly in the loopwave test program.

Fixes #6377.
(cherry picked from commit e7ab581d79)
2022-10-19 20:29:24 +03:00
Ethan Lee b7e8e6f3b8 wayland: Check for the input handle before checking the keyboard handle
(cherry picked from commit be2cb00066)
2022-10-11 08:31:49 -07:00
Sam Lantinga 30579c8cd7 Don't try to create a semaphore for the mutex implementation if threads are disabled
Fixes https://github.com/libsdl-org/SDL/issues/6344

(cherry picked from commit 17b43b0fdd)
2022-10-10 14:35:30 -07:00
Ozkan Sezer 4726270ead WIN_GetDrawableSize: avoid NULL pointer dereference
Fixes https://github.com/libsdl-org/SDL/issues/6356
2022-10-08 23:01:28 +03:00
Sam Lantinga a1d1946dcb Use DWARF 4 debug information when building using mingw
See this bug for more information:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101377

Fixes https://github.com/libsdl-org/SDL/issues/6139

(cherry picked from commit f18fae4c68)
2022-10-04 16:48:08 -07:00
Sam Lantinga 36524373db Updated version to 2.24.1 for point release
Also merged some updates to test-versioning.sh from main to correctly verify the version
2022-10-04 14:06:15 -07:00
Sam Lantinga 77f3a9cbe8 Only advertise the SDL_PIXELFORMAT_EXTERNAL_OES format if we can build the shader for it
(cherry picked from commit 5bc85d6788)
2022-10-04 12:33:16 -07:00
Sam Lantinga b8dacc37b5 Pretty print shaders for debugging purposes
(cherry picked from commit 2970710b5d)
2022-10-04 12:33:16 -07:00
Sam Lantinga a49a25671d Fixed OpenGL ES shader compilation on Linux
(cherry picked from commit bc57d3e35c)
2022-10-04 12:33:16 -07:00
Sam Lantinga 284cf11778 Fixed uninitialized variable warning
(cherry picked from commit 8a15a738f3)
2022-10-04 12:33:16 -07:00
Sam Lantinga 949addc94e Fixed OpenGLES shaders failing after renderer has been created
Cache all the shaders up front, so we can verify that they won't silently fail at runtime.

If compiling the fragment shaders with the precision hint fails, try again without specifying precision.

Fixes https://github.com/libsdl-org/SDL/issues/6166
Fixes https://github.com/libsdl-org/SDL/issues/6174

(cherry picked from commit b5102a551b)
2022-10-04 12:33:16 -07:00
Amir 23a4b9bdd6 android: fix some compiler warnings
(cherry picked from commit 7f415ce587)
2022-10-04 12:32:10 -07:00
Sam Lantinga ce29ebc3b8 Add GLES2 shader prologue infrastructure. (by @eloj)
There is supposedly an OpenGL ES2 target that does not support precision specifiers. However, the existing logic to detect this is currently broken in two ways:

1) There's a typo of the `#ifdef` as `#if`.
2) Checking for `GL_FRAGMENT_PRECISION_HIGH` can not be the correct way to detect this platform. Other targets, including some desktops, will also not have this defined (for various reasons).

Because some of the shader code is missing precision specifiers, and because a default is ONLY provided if `GL_FRAGMENT_PRECISION_HIGH` is set, these other targets break.

Instead of 'hard-coding' the prologue string into shaders in the C source, use our ability to provide a list of strings to `glShaderSource` instead, leaving the determination to run-time.

This commit closes https://github.com/libsdl-org/SDL/pull/6182

(cherry picked from commit 29f4a5ba0e)
2022-10-04 12:29:27 -07:00
Ryan C. Gordon 0733ef7e3f
build: Fixed some references to renamed test-versioning.sh
(cherry picked from commit f648c000bd)
2022-10-04 15:22:41 -04:00
Ryan C. Gordon d1b2f1ebb5
Moved test/versioning.sh to build-scripts/test-versioning.sh
Reference Issue #6171.

(cherry picked from commit d843d61cc1)
2022-10-04 15:22:33 -04:00
Ryan C. Gordon 15496201c9
build-scripts: Added update-version.sh
Fixes #6171.

(cherry picked from commit 8e14647759)
2022-10-04 15:22:08 -04:00
Anonymous Maarten a23b54b74a cmake+xcode: only create SDL2::SDL2main target when it does not exist again 2022-10-04 21:17:29 +02:00
Ryan C. Gordon b0a2164b2c coreaudio: Possibly fixed another shutdown race condition.
Reference Issue #6159.
(cherry picked from commit e6640ef2d4)
2022-10-02 12:22:20 +03:00
Ozkan Sezer 14bf8237c1 hidapi, libusb: backport read_thread indefinite loop fix from mainstream
Mainstream commit:
5ce9051e2f
(cherry picked from commit 8bcbdc706c)
2022-09-28 18:35:24 +03:00
Ryan C. Gordon cedd8e1138 coreaudio: Remove redundant variable.
(cherry picked from commit f6565c329b)
2022-09-28 17:05:50 +03:00
Ryan C. Gordon d6e939ddb5 coreaudio: Don't crash on shutdown in a race condition.
Fixed #6159.
(cherry picked from commit 411582c710)
2022-09-28 17:01:50 +03:00
Ryan C. Gordon 128c34b839 cocoa: Fix new windows setting SDL_WINDOW_BORDERLESS flag incorrectly.
Fixes #6172.
(cherry picked from commit 57b20e7b9e)
2022-09-27 21:33:40 +03:00
Anonymous Maarten a1026d6368 cmake: use check_symbol_exists to check dlopen + need for dl library
(cherry-picked from commit bfecd78159)
2022-09-27 17:01:01 +03:00
Ozkan Sezer d8b2a165af autotools: revised and silenced esound detection a bit.
(cherry-picked from commit 6b75a592a4)
2022-09-27 17:01:01 +03:00
Simon McVittie 4657d8be0d autotools: Require GNU sort
find_lib() uses sort -V, which is a GNU extension. Users of non-GNU
operating systems should either install GNU coreutils (assumed to
provide a gsort executable), or use the CMake build system.

Resolves: https://github.com/libsdl-org/SDL/issues/6106
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry-picked from commit 732e1530e3)
2022-09-27 17:01:01 +03:00