Commit graph

10206 commits

Author SHA1 Message Date
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
Anonymous Maarten c7950bf0c6 cmake: only add -Wl,--undefined=WinMain when building an executable
(cherry-picked from commit 653e433c08)
2022-09-27 14:37:55 +03:00
Sylvain 0f2503cf8a Fixed bug #6287 - SDL_FillRect failed for SDL_Surface with BitsPerPixel == 4
(cherry-picked from commit d71df6448b)
2022-09-27 14:22:32 +03:00
Ozkan Sezer 6ba5f08e5d add missing quotes to the fallback CHECK_OBJC_SOURCE_COMPILES macro
Closes:  https://github.com/libsdl-org/SDL/issues/6268 .
(cherry picked from commit 098a7a043e)
2022-09-21 10:37:40 +03:00
Ozkan Sezer 7bf4ca60f6 autotools: stop using AC_FUNC_MEMCMP and AC_FUNC_STRTOD
Closes:  https://github.com/libsdl-org/SDL/issues/6266 .
(cherry picked from commit db225dec41)
2022-09-20 21:39:10 +03:00
Anonymous Maarten 4d78a6fad4 cmake: only add -Wl,--undefined=WinMain when building an executable
(cherry picked from commit 3b20e0ecef)
2022-09-19 05:02:04 +03:00
Cameron Cawley 59e04dcc0b Fix SDL_PIXELFORMAT_INDEX1LSB test case 2022-09-18 01:29:56 +03:00
Cameron Cawley fa239a2192 Fix incorrect return value in X11_GetPixelFormatFromVisualInfo 2022-09-18 01:29:56 +03:00
Ozkan Sezer 45362dfe31 SDL_windows.h: guard WIN32_LEAN_AND_MEAN and STRICT macro defines.
also define them as 1, instead of empty.
Reference issue: https://github.com/libsdl-org/SDL/issues/6239
(cherry picked from commit 339f7a2f6b)
2022-09-17 17:40:10 +03:00
Ozkan Sezer 0df4d123db SDL_offscreenwindow.c: swap include order of SDL_egl_c.h/SDL_sysvideo.h
Fixes redefinition warnings from windows builds.
Reference issue: https://github.com/libsdl-org/SDL/issues/6239
(cherry picked from commit d86cb8ec9e)
2022-09-17 17:40:07 +03:00
Sam Lantinga ffcf32b4ff Fixed building with libusb not dynamicaly loaded
(cherry-picked from commit 3f89d1704d)
(cherry-picked from commit 4ebf34857a)
(cherry-picked from commit 5767dc710e)
(cherry-picked from commit 9d77945d36)
(cherry-picked from commit 2847696338)
2022-09-12 23:55:56 +03:00
Sam Lantinga 531ddf5eb5 Fixed macOS framework detection in sdl2.m4
Fixes https://github.com/libsdl-org/SDL/issues/6141
(cherry picked from commit 3d516b841a)
2022-09-12 23:28:28 +03:00
Sam Lantinga abac672a2d Fixed crash if there are no devices available
(cherry picked from commit 679582e702)
2022-09-12 21:33:50 +03:00
Ozkan Sezer 782862b95c apply commit d0a3570300 to cmake side too.
(cherry-picked from commit 5b2884cb02)
2022-09-12 20:37:56 +03:00
Ozkan Sezer 525e201728 regenerated configure script.
(cherry-picked from commit d936499670)
2022-09-12 20:37:56 +03:00
Sam James 0680314c2a configure.ac: fix configure tests broken with Clang 15 (implicit function declarations)
Clang 15 makes implicit function declarations fatal by default which
leads to some configure tests silently failing/returning
the wrong result.

Signed-off-by: Sam James <sam@gentoo.org>
(cherry-picked from commit d0a3570300)
2022-09-12 20:37:56 +03:00
Ozkan Sezer 7be77f0b3d Fix https://github.com/libsdl-org/SDL/issues/6191
(cherry picked from commit 5ffede35d9)
2022-09-06 19:56:55 +03:00
Cameron Cawley e70db38d60 Fix compatibility with Windows XP
(cherry picked from commit 10e1ef00e2)
2022-09-06 17:10:00 +03:00
Anonymous Maarten 08e8824372 cmake: fix location of SDL2::SDL2test imported library 2022-09-05 21:54:48 +02:00
Gleb Mazovetskiy b6661c016b CMake: Make SDL_SHARED/STATIC/TEST options
This makes it easier to set these options when SDL is used as a subprojects.
Since CMake v3.13+, one can simply `set(SDL_TEST OFF)` before include the SDL2 subproject because options do not override existing variables. (https://cmake.org/cmake/help/latest/policy/CMP0077.html#policy:CMP0077)
This is also true for `set(CACHE)` commands but only in CMake v3.21+ (https://cmake.org/cmake/help/latest/policy/CMP0126.html).
2022-09-04 13:59:43 +02:00
Anonymous Maarten 62302d08f1 cmake: always create SDL2::SDL2main target in autotools' cmake config script 2022-08-24 06:41:20 -07:00
Anonymous Maarten b19e2f1e56 cmake: create SDL2::SDL2main target in Apple framework official release 2022-08-24 06:41:20 -07:00
Oleg Derevenetz ac44b22a24 Use __ARM_ARCH instead of __ARM_ARCH__ 2022-08-22 18:22:03 -07:00
slime 84004d1e47 cocoa: change Shape data to use ObjC objects instead of C structs.
Fixes #6089
2022-08-21 15:36:34 -07:00
Anonymous Maarten 329794daf3 cmake: add library directories & pthread to imported targets of sdl2-config.cmake
This fixes linking to SDL2::SDL2-static on systems where external libraries such as X11 are not in a standard location.
Pthread also needs special care.
2022-08-20 19:17:37 -07:00
Sam Lantinga 3739dda6bd Fixed minimized window detection when handling WM_WINDOWPOSCHANGED
When minimizing a window, we get this sequence of events:
WM_WINDOWPOSCHANGING
WM_GETMINMAXINFO
WM_NCCALCSIZE
WM_WINDOWPOSCHANGED - IsIconic() is true
WM_MOVE
WM_SIZE - SDL sees minimized state here

When restoring a window, we get this sequence of events:
WM_WINDOWPOSCHANGING
WM_GETMINMAXINFO
WM_NCCALCSIZE
WM_NCPAINT
WM_ERASEBKGND
WM_WINDOWPOSCHANGED - IsIconic() is false
WM_MOVE
WM_SIZE - SDL sees restored state here

On Windows 10 a minimized window has a non-empty client rect, so we were delivering a minimized size before SDL knows that the window is minimized, and then ignoring the restored size when handling the restore message.

The fix is to use IsIconic() which returns the correct window state when WM_WINDOWPOSCHANGED is actually delivered.
2022-08-19 17:40:30 -07:00
Sam Lantinga 8c9beb0c87 Updated to version Updated to version 2.24.0 for release 2022-08-19 08:44:09 -07:00
Sam Lantinga 6e007c36e7 Add null termination to Wayland_data_source_get_data() if requested
Fixes https://github.com/libsdl-org/SDL/issues/6083
2022-08-18 19:05:55 -07:00
Sam Lantinga 948dbe7d3f Don't include the null terminator in Wayland clipboard text
Fixes https://github.com/libsdl-org/SDL/issues/6083
2022-08-18 16:24:20 -07:00
Sam Lantinga f6b81125b3 Always define SDL_COMPILE_TIME_ASSERT as static_assert() in C++
Apparently some versions of gcc will define __STDC_VERSION__ even when compiling in C++ mode.

Fixes https://github.com/libsdl-org/SDL/issues/6078
2022-08-18 16:06:42 -07:00