Commit Graph

221 Commits (0f9b923ff495f21e6a0bb1de1acd32b1c3d65236)

Author SHA1 Message Date
Sam Lantinga 228d9ae791 rename_headers.py covers begin_code.h/close_code.h 2023-01-04 23:50:08 -08:00
Sam Lantinga 566a559beb Fixed parsing symbols from SDL_oldnames.h 2023-01-04 13:51:00 -08:00
Sam Lantinga e76c1d74bc Added a python script to rename SDL2 headers to SDL3 headers 2023-01-04 11:20:38 -08:00
Sam Lantinga 406c8b79fe rename_symbols: only write new file if contents have changed
Also don't stop for other exceptions, just print them and keep going
2023-01-04 10:40:30 -08:00
Sam Lantinga ce412c2c71 Consistency cleanup for README-migration.md 2022-12-29 10:44:54 -08:00
Sam Lantinga 9b8208c195 Updated add_symbol_to_oldnames 2022-12-28 17:49:34 -08:00
Sam Lantinga 1d80082e8e Removed old iOS demos 2022-12-27 16:48:55 -08:00
Sam Lantinga 5baed331f1 Don't add symbol renaming to WhatsNew.txt 2022-12-27 10:00:10 -08:00
Sam Lantinga 84725c00d8 Make sure we update the cmake test programs as well 2022-12-27 09:56:16 -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 59467ff063 Make it easier to mass rename symbols in the SDL API 2022-12-27 07:31:27 -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
Sam Lantinga d31776b17a Also rename the internal function symbol when renaming API functions 2022-12-26 08:57:57 -08:00
Sam Lantinga 32fad06a93 Catch the iOS demos when renaming API functions 2022-12-23 20:32:12 -08:00
Sam Lantinga c309a92034 Added rename_symbols.py to mass rename symbols in an SDL2 codebase 2022-12-23 15:07:21 -08:00
Sam Lantinga 0967a32fc6 Added a --code-only option to rename.py
Also added support for renaming macros and structures
2022-12-23 13:15:19 -08:00
Sam Lantinga b5a92406eb Added infrastructure for renaming API functions
You can rename APIs using rename.py and all the code and documentation will be updated, and entries will be added to WhatsNew.txt and docs/README-migration.md.
e.g.
rename.py SDL_foo.h function SDL_CreateFoo SDL_FooCreate

SDL_oldnames.h is included in the SDL header, and if you define SDL_ENABLE_OLD_NAMES, will redefine the old API functions to call the new ones, and if not, will define them as a symbol letting you what the new API function is.
2022-12-23 11:00:11 -08:00
Anonymous Maarten 9e6952ed8c android: fix android-prefab.sh for SDL3 2022-12-21 09:39:22 -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 7bfc41db3c Unify all the SDL_*RunApp() functions into just SDL_RunApp()
makes the SDL_main code shorter

Also added a generic SDL_RunApp() implementation for platforms that
don't really need it.

Some platforms (that use SDL_main but haven't been ported yet) are
still missing, but are added in the following commits.
2022-12-15 08:01:01 -08:00
Daniel Gibson 2aee3e654d Remove SDL_main from VS Solutions in VisualC/ and VisualC-GDK/
and update README-visualc.md and README-gdk.md accordingly

Also moved src/main/windows/version.rc to src/core/windows/
and adjusted VS solutions, CMakeLists.txt and versioning scripts
in build-scripts/ accordingly.

This will eventually allow us to remove all of src/main/

# Conflicts:
#	VisualC/tests/testgesture/testgesture.vcxproj
2022-12-15 08:01:01 -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 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
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
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 6d103303e7 Added toolchain files for cross-compiling to Windows 2022-11-25 15:37:30 -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 a635a485bc Re-added WinRT support until we're sure that it's no longer being used 2022-11-23 10:41:43 -08:00
Ryan C. Gordon 8b18b09027
fnsince.pl: Make this work with SDL3. 2022-11-22 17:39:56 -05:00
Ozkan Sezer dc2a3e06e9 removed WinRT support. 2022-11-22 23:36:24 +03:00
Sam Lantinga 0c1f9118a7 Removed version updates/checks for Makefile.os2 and Makefile.w32 2022-11-22 09:29:09 -08:00
Sam Lantinga e95819fae2 Update SDL info and Xcode marketing version with version update scripts 2022-11-22 09:27:25 -08:00
Ozkan Sezer e89a1f9157 removed NaCL support. 2022-11-22 20:10:47 +03:00
Sam Lantinga 2c4159b99a First pass at changing SDL 2.0 to SDL 3.0 2022-11-21 20:28:58 -08:00
Sam Lantinga 8ae46a49ea Save the version in VERSION.txt instead of VERSION
Fixes https://github.com/libsdl-org/SDL/issues/6558
2022-11-21 06:57:02 -08:00
Ryan C. Gordon 98dfc9296a
build-scripts/fnsince.pl: Deal with new point-release system.
This ignores 2.x.1 (etc) releases, which prevents it from thinking
the next official non-point-release version is 2.26.1, when it
should be 2.26.0, because it saw the "latest" release is 2.24.1.

This fixes the wiki ending up with imaginary version numbers for
the "this function is available since SDL 2.x.y" sections.

Fixes #6343.
2022-10-25 14:03:32 -04:00
Simon McVittie 4ca5ea5b7e build: Add a mechanism to mark builds with vendor info
Downstream distributors can use this to mark a version with their
preferred version information, like a Linux distribution package version
or the Steam revision it was built to be bundled into, or just to mark
it with the vendor it was built by or the environment it's intended to
be used in.

For instance, in Debian I'd use this by configuring with:

    --enable-vendor-info="${DEB_VENDOR} ${DEB_VERSION}"

to get a SDL_REVISION like:

    release-2.24.1-0-ga1d1946dc (Debian 2.24.1+dfsg-2)

which gives a Debian user enough information to track down the patches
and build-time configuration that were used for package revision 2.

In Autotools and CMake, this is a configure-time option like any other,
and will go into both SDL_REVISION (via SDL_revision.h) and
SDL_GetRevision().

In other build systems (MSVC, Xcode, etc.), defining the
SDL_VENDOR_INFO macro will get it into the output of SDL_GetRevision(),
although not SDL_REVISION.

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
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
Sam Lantinga 5291e5cb76 Added version checking to SDLActivity.java
Make sure the SDL java and C code match when updating SDL in a game.
Right now we're assuming that we only have to make sure release versions match. We can extend the version string with an interface version if we need more fine grained sanity checking.

Fixes https://github.com/libsdl-org/SDL/issues/1540
2022-10-03 17:36:17 -07:00
Anonymous Maarten bac54b3d26 Android: add script for building prefab archive 2022-10-01 22:26:46 -07:00
Ryan C. Gordon f648c000bd
build: Fixed some references to renamed test-versioning.sh 2022-09-28 09:37:21 -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
Ryan C. Gordon 8e14647759
build-scripts: Added update-version.sh
Fixes #6171.
2022-09-27 22:04:07 -04:00
Ryan C. Gordon 51be30f3cd
emscripten-buildbot.sh: force `-s USE_SDL=0`
This avoids using Emscripten-provided SDL headers from its own
sysroot instead of the headers in our own include directory!

Reference https://github.com/emscripten-core/emscripten/discussions/17647
2022-08-17 21:39:59 -04: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 f789bc7d5f Updated minimum OS targets on Apple platforms to match supported platforms using Xcode 13 2022-07-26 11:36:01 -07:00
Anonymous Maarten 2fdedd17be Revert 6fa7d62 and 856c99e5 2022-07-23 17:29:45 +02:00
Anonymous Maarten 856c99e583 android: target android-19 by default when building with build-scripts/androidbuildlibs.sh 2022-07-23 16:28:50 +02:00
Ryan C. Gordon bec721f08a audio: Fixed dst pointer on channel conversions that grow in-place. 2022-07-20 18:41:53 -04:00
Ryan C. Gordon 49ec8db5f8 audio: Generate the channel converter code from a program. 2022-07-20 18:41:53 -04:00