Commit graph

41 commits

Author SHA1 Message Date
Sam Lantinga dc280c17a0 Moved SDL_intrin.h back into the public headers for application use 2023-01-10 15:50:35 -08:00
Sam Lantinga fde78d12f2 Updated copyright for 2023 2023-01-09 09:41:41 -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
Sylvain af5bda5ef3 Fix warnings 'macro argument should be enclosed in parentheses' 2022-12-05 09:06:44 -08:00
Cameron Cawley ee0e9e979c Move intrinsic includes into a private header 2022-12-04 09:34:10 -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
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 a635a485bc Re-added WinRT support until we're sure that it's no longer being used 2022-11-23 10:41:43 -08:00
Ozkan Sezer dc2a3e06e9 removed WinRT support. 2022-11-22 23:36:24 +03:00
Sam Lantinga 120c76c84b Updated copyright for 2022 2022-01-03 09:40:21 -08:00
Sylvain ab0cf42a4b
Software nearest scaling: start at the middle of pixel
so that it matches opengl GL_NEAREST mode most of the time
2021-03-04 14:33:56 +01:00
Sylvain Becker 9d70711342 Revert checks on destination scaling size (see bug #5510) 2021-02-10 10:22:18 -05:00
Sylvain Becker d6a6662fa1 Remove checks on destination scaling size (see bug #5510) 2021-02-10 10:22:18 -05:00
Sylvain Becker ebb814310a Add checks for maximun scaling size (see bug #5510) 2021-02-10 10:22:18 -05:00
Sylvain Becker dd6e02df63 SDL_stretch: remove un-used vars, same notation as blit functions 2021-02-10 10:22:17 -05:00
Ozkan Sezer 87f0900701 SDL_LowerSoftStretchLinear: assign result from scale_mat() to ret.
otherwise it would always return -1 when SSE and NEON instrinsics
are absent.
2021-02-10 10:22:17 -05:00
Sam Lantinga 24d6fda2c3 Fixed bug 3816 - asm code in video/SDL_stretch.c
Sylvain

I propose this new version for SDL_stretch.c that drops mprotect and asm

Code is similar to the StretchLinear, but the steps computation are kept similar to the nearest.
so that:
- it's pixel perfect with nearest
- as fast as asm I think
- no asm, nor mprotect
- benefit for all archicture
2021-02-10 10:22:17 -05:00
Sam Lantinga 06ad887f44 Fixed bug 3816 - asm code in video/SDL_stretch.c
Ozkan Sezer

- adds MSVC __declspec(align(x)) support,
- disables asm if PAGE_ALIGNED no macro is defined,
- still disables asm for gcc < 4.6, need more info,
- drops Watcom support.
2021-02-10 10:22:17 -05:00
Sylvain Becker 5e3cf0d1f4 SDL_SoftStretch: disable asm path if mprotect isn't available (see bug #3816) 2021-02-10 10:22:17 -05:00
Sylvain Becker ff827fc767 SDL_SoftStretch: re-enable USE_ASM_STRETCH path for gcc >= 4.6 2021-02-10 10:22:17 -05:00
Sylvain Becker fea49a3e2f SDL_stretch.c: compilation NEON on Windows 10 2021-01-03 15:24:47 +01:00
Sylvain Becker acccc71f27 Fixed bug 5436 - MSVC 2019 ARM64 build fails to compile SDL_stretch.c 2021-01-02 22:31:44 +01:00
Sam Lantinga 9130f7c377 Updated copyright for 2021 2021-01-02 10:25:38 -08:00
Sylvain Becker 2127ed2574 SDL_SoftStretch: add a check for input pixel format
and function re-naming
2021-01-02 09:28:16 +01:00
Sylvain Becker 80cf8a8b76 SDL_BlitScaled: also prevent crash if dest width or height is negative 2020-12-29 17:29:31 +01:00
Sylvain Becker f08b9a5b6b SDL_BlitScaled: prevent crash if dest width or height is 0 2020-12-29 16:02:52 +01:00
Sam Lantinga 9838611a8b Fixed compiler crash building for iOS with clang 11.0.3 2020-12-23 15:52:12 -08:00
Sylvain Becker 4aebad77bd SDL_SoftStretchLowerLinear: try to make xcode buildbot compile (Bug 5313) 2020-12-23 22:50:50 +01:00
Sylvain Becker 8e20376f1a SDL_SoftStretchLinear: use SDL_INLINE (bug 5313) 2020-12-23 22:09:01 +01:00
Sylvain Becker 7b8d5b7dc3 SDL_SoftStretchLinear: fix implicit conversion (bug 5313) 2020-12-23 22:02:28 +01:00
Sylvain Becker ae8a270f61 Add SDL_SoftStretchLowerLinear() (Bug 5313) 2020-12-23 21:37:40 +01:00
Sylvain Becker 050ee9a410 Split SDL_SoftStretch in Lower and Uppler functions (Bug 5313) 2020-12-23 21:32:01 +01:00
Sam Lantinga a8780c6a28 Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
Sam Lantinga 5e13087b0f Updated copyright for 2019 2019-01-04 22:01:14 -08:00
Sam Lantinga e3cc5b2c6b Updated copyright for 2018 2018-01-03 10:03:25 -08:00
Sam Lantinga 9a73909bbd Fixed bug 3808 - fix a typo in SDL_stretch.c
Ozkan Sezer

The following patch fixes a minor _MSC_VER typo in SDL_stretch.c,
and also does a tiny tidy-up for assembly opcodes cpp checks.
2017-09-09 08:20:56 -07:00
Philipp Wiesemann 266816b4aa Removed newlines from error messages. 2017-03-26 21:00:19 +02:00
Sam Lantinga 45b774e3f7 Updated copyright for 2017 2017-01-01 18:33:28 -08:00
Sam Lantinga 42065e785d Updated copyright to 2016 2016-01-02 10:10:34 -08:00
Philipp Wiesemann 0e45984fa0 Fixed crash if initialization of EGL failed but was tried again later.
The internal function SDL_EGL_LoadLibrary() did not delete and remove a mostly
uninitialized data structure if loading the library first failed. A later try to
use EGL then skipped initialization and assumed it was previously successful
because the data structure now already existed. This led to at least one crash
in the internal function SDL_EGL_ChooseConfig() because a NULL pointer was
dereferenced to make a call to eglBindAPI().
2015-06-21 17:33:46 +02:00