Commit graph

11215 commits

Author SHA1 Message Date
Sam Lantinga
021f7dab32 Fixed Metal renderer memory leak 2017-12-08 13:20:20 -08:00
Ryan C. Gordon
122fb6329f metal: Don't check if Metal is available if targeting modern macOS versions.
--HG--
extra : rebase_source : f007831a3ff9aebb17ec3529e6fee4c3ad63d0b1
2017-12-08 14:03:36 -05:00
Sam Lantinga
f9a5278047 Minor cleanup 2017-12-08 12:02:23 -08:00
Sam Lantinga
d8cb066822 Fixed minor memory leak in the Metal renderer 2017-12-08 11:35:19 -08:00
Sam Lantinga
644fefb7ac Added check for failure of D3D_ActivateRenderer() 2017-12-08 11:34:32 -08:00
Sam Lantinga
507ab36373 Fixed compiler warning 2017-12-08 11:33:27 -08:00
Sam Lantinga
2abcf193b5 Fixed bug 1878 - Scaled texture draws with filtering produce wrapping artifacts.
Yuri K. Schlesner

When using texture filtering, there are filtering artifacts visible on the edges of scaled textures, where the texture filtering pulls in texels from the other side of the texture. Using clamping texture modes wouldn't completely fix this since source rectangles don't need to cover the whole texture. (See screenshot attached in next post.)

The opengl driver uses clamping on textures and so avoid this at least in the cases where the source rect is the whole texture. The direct3d driver does not and so has problems in every case. I'm not sure if it can actually completely be fixed, but at least enabling clamping for direct3d would be one step in the right direction.
2017-12-08 11:09:05 -08:00
Ryan C. Gordon
6e1c6946b9 configure: List Metal in video drivers.
--HG--
extra : rebase_source : f5a3e33689d899707204aafed145cdf4ba0c389e
2017-12-08 00:49:35 -05:00
Sam Lantinga
bb8d2413ee Defer getting the next drawable until we actually start rendering
This works better for games where there may be a bunch of simulation logic that needs to be run before the next rendering pass, and prevents blocking if the next drawable is busy.
2017-12-08 08:58:02 -08:00
Sam Lantinga
577d7d42ff Fixed runtime errors on iOS 2017-12-07 18:08:51 -08:00
Sam Lantinga
7e4560664b Fixed building for simulators or older iOS SDKs 2017-12-07 17:47:01 -08:00
Sam Lantinga
40be7cbc97 Fixed compiling Metal renderer on iOS 2017-12-07 17:12:03 -08:00
Sam Lantinga
6fc4a1cdb8 Added iOS and OSX versions of the Metal shaders 2017-12-07 16:08:47 -08:00
Sam Lantinga
9167983c42 Enable building the Metal renderer by default, and weak link the Metal framework so the SDL library is safe to use on older Macs
Also generate iOS versions of the Metal shaders
2017-12-07 16:08:09 -08:00
Ryan C. Gordon
e1fb05694a Initial shot at a renderer target for Apple's Metal API.
This isn't complete, but is enough to run testsprite2. It's currently
Mac-only; with a little work to figure out how to properly glue in a Metal
layer to a UIView, this will likely work on iOS, too.

This is only wired up to the configure script right now, and disabled by
default. CMake and Xcode still need their bits filled in as appropriate.
2016-04-21 03:16:44 -04:00
Sam Lantinga
fe18e7a263 The Metal view is a full SDL_uikitview to support multi-touch 2017-12-07 09:35:28 -08:00
Ryan C. Gordon
52fe36d1db cocoa: Added two missing files from hg changeset bc7ca7cfa6ca.
Fixes Bugzilla #3975.
2017-12-06 16:37:55 -05:00
Ryan C. Gordon
1745441419 audio: Port WASAPI to WinRT, remove XAudio2 backend.
XAudio2 doesn't have capture support, so WASAPI was to replace it; the holdout
was WinRT, which still needed it as its primary audio target until the WASAPI
code code be made to work.

The support matrix now looks like:

WinXP: directsound by default, winmm as a fallback for buggy drivers.
Vista+: WASAPI (directsound and winmm as fallbacks for debugging).
WinRT: WASAPI

--HG--
extra : amend_source : a28a9a9fbb09c4c25df05fa0a754fce0bee62335
extra : histedit_source : e5727ceb1a5db5806ce02534d8ffe4892eb6f5d9
2017-12-06 12:24:32 -05:00
Ryan C. Gordon
8b08b7b07b winrt: Patched to compile on Ryan's workstation. :)
I'm not sure why I needed this, but it appears to fix the build on VS2015 here.

--HG--
extra : histedit_source : e4022c72f88f23afe4ab15164ac46e1a71a22ebb
2017-12-06 13:48:51 -05:00
Sam Lantinga
acf393af0d Fixed bug 3974 - Fix SDL_WarpMouseInWindow on both KMSDRM and RaspberryPi drivers
Manuel Alfayate Corchete

This patch fixes SDL_WarpMouseInWindow() in both the KMSDRM and Raspberry Pi graphic backends.
2017-12-04 20:37:01 -08:00
Sam Lantinga
34553b8de0 Fixed bug 3975 - Add GLES2 support for macOS via ANGLE library
Andrey

Seems latest google angle library successfully built & tested under macOS'es.

https://github.com/google/angle

We need to use GLES2 to implement true cross-platform code.
2017-12-04 20:35:01 -08:00
Sam Lantinga
860acadf69 Removed spurious debug output 2017-12-04 20:26:09 -08:00
Olli Kallioinen
aea84272a5 Fixed SDL_Log not working on windows if the output is being redirected. 2017-12-04 19:28:03 +02:00
Sam Lantinga
a5b3e11d5c Fixed typos (thanks Martin!) 2017-12-04 20:21:52 -08:00
Sam Lantinga
de2314ec6b Fixed name of eglCreatePbufferSurface function 2017-12-03 20:27:08 -08:00
Sam Lantinga
cabb4b1035 Fixed bug 3945 - Add eglCreatePbufferSurface function
tomwardio

Proposed patch loads eglCreatePbufferSurface in same manner as other 1.1 functors. This allows custom video drivers to create pbuffer surfaces.
2017-12-03 20:25:55 -08:00
Sam Lantinga
abea243f22 Non-resizable windows need to have their window rect set to the client rect 2017-11-28 18:31:18 -08:00
Sam Lantinga
21571e1012 Use the included Khronos headers on Android so we can create Core OpenGL contexts when building with older SDK 2017-11-27 15:07:07 -08:00
Sam Lantinga
2f30c13333 Fixed bug 3980 - Fix for KMSDRM driver where cursor would not be shown on some gfx hardware because of unsupported cursor size
Manuel Alfayate Corchete

This fixes a problem with KMSDRM on some graphics hardware where only bigger cursor sizes are supported, such as current Intel gfx. (The kernel-side driver is what limits this: had to look for failing IOCTLs...)
That caused SDL_SetCursor() to fail silently, and we were left with a missing cursor without further explanation.
With this patch, different "standard" sizes are tried and a bigger one is used (with an intermediate and clean buffer only used to write the new cursor to the BO where it will live after) if we get, let's say, 16x16 which is pretty common but our hardware does not support that.
2017-11-24 12:03:28 -08:00
Sam Lantinga
bc8014e1db Fixed bug 3979 - Failed to link with "multiple definition of `scalbln'" error on both MinGW and MinGW-w64 by CMake
Vitaly Novichkov

Once I ran build of my codecs collection on AppVeyor where my CMake script downloads latest SDL2 from HG repo, failed to link because of math functions conflict:

https://ci.appveyor.com/project/Wohlstand/audiocodecs/build/1.0.44
The revision is b94292eebb5c

There are both vanilla MinGW and MinGW-w64 are failed to build.


```
[100%] Linking C shared library libSDL2.dll
c:/mingw/bin/../lib/gcc/mingw32/5.3.0/../../../libmingwex.a(scalbn.o):(.text+0x0): multiple definition of `scalbln'
CMakeFiles\SDL2.dir/objects.a(s_scalbn.c.obj):C:/projects/audiocodecs/build-MinGW-Release-Win32/external/SDL2/src/SDL2HG/src/libm/s_scalbn.c:30: first defined here
2017-11-24 03:01:07 -08:00
Sam Lantinga
91e062fe69 Fixed some compiler warnings 2017-11-21 21:58:27 -08:00
Sam Lantinga
015f8c9c6b Disabled spurious Visual Studio warnings in the uClibc math code 2017-11-21 21:51:33 -08:00
Sam Lantinga
f2913ce773 Fixed bug 3976 - SDL drivers may leak driverdata memory due to ignoring return value of SDL_AddDisplayMode
C Snover

SDL_AddDisplayMode returns an SDL_bool corresponding to whether or not the given display mode was added or not. It will return SDL_FALSE if a matching display mode already exists in the display's list of display modes, which causes ownership of the mode driverdata to remain with the caller. Some video drivers ignore the return value of SDL_AddDisplayMode, so leak the driverdata memory when SDL_AddDisplayMode returns SDL_FALSE.
2017-11-21 21:30:47 -08:00
Ethan Lee
17a6f8ce62 Steam Virtual GamePad config for macOS 2017-11-20 13:59:43 -05:00
Sam Lantinga
4aa163b5d1 Fixed bug 3973 - Include of stdint is needed to build on linux, mingw and possibly android
Stuart Axon

https://discourse.libsdl.org/t/stdint-h-removed/23426

https://discourse.libsdl.org/t/debuild-fails-to-build-the-last-few-days/23429/4

Currently SDL2 is not building in Linux (x86 and ARM), Android and MingW because include stdint.h has been removed from yuv_rgb.h
2017-11-20 00:06:37 -08:00
Sam Lantinga
2dd806061a Fixed bug 3959 - cmake build broken by commit 11702 (cf166abbde4a) due to typo
Mate Nagy
There is a typo in CMakeLists.txt that makes CMake exit with failure.

Change that causes the problem: (Notice the double ending brackets)
   ${SDL2_SOURCE_DIR}/src/video/*.c)
+  ${SDL2_SOURCE_DIR}/src/video/yuv2rgb/*.c)

Fix:
Just remove the first ending bracket resulting in:
   ${SDL2_SOURCE_DIR}/src/video/*.c
   ${SDL2_SOURCE_DIR}/src/video/yuv2rgb/*.c)
2017-11-20 00:03:23 -08:00
Sam Lantinga
e877c092e2 Added support for aarch64 memory barrier instruction 2017-11-19 23:36:54 -08:00
Sam Lantinga
56baad432a Fixed bug 3964 - YUV to RGB in video/SDL_yuv.c is broken for any output format of type ABGR8888 or BGR888
raist66676

Here is the bug in latest SDL 2.0.8 development repo. It is obvious and simple to fix by correcting typos on six lines of code.

In src/video/SDL_yuv.c on lines 217, 249, 280, 321, 353, and 384 the wrong conversion functions are called for SDL_PIXELFORMAT_ABGR8888 and SDL_PIXELFORMAT_BGR888. Instead of ABGR functions, BGRA functions are called. These are typos.
2017-11-17 11:03:02 -08:00
Sam Lantinga
efc870f380 Fixed building yuv_rgb.h when stdint.h isn't available (thanks Ozkan!) 2017-11-17 10:55:58 -08:00
Sam Lantinga
72dec56391 Fixed building YUV test programs (thanks Ozkan!) 2017-11-17 10:54:46 -08:00
Sam Lantinga
145d2469ae Updated SDL's YUV support, many thanks to Adrien Descamps
New functions get and set the YUV colorspace conversion mode:
	SDL_SetYUVConversionMode()
	SDL_GetYUVConversionMode()
	SDL_GetYUVConversionModeForResolution()

SDL_ConvertPixels() converts between all supported RGB and YUV formats, with SSE acceleration for converting from planar YUV formats (YV12, NV12, etc) to common RGB/RGBA formats.

Added a new test program, testyuv, to verify correctness and speed of YUV conversion functionality.
2017-11-12 22:51:12 -08:00
Sam Lantinga
e7cc03e0bd Fixed Android build error on older SDK 2017-11-12 10:59:05 -08:00
Sam Lantinga
852e3a33bf Fixed typo in comment 2017-11-11 17:21:47 -08:00
Sam Lantinga
5d91301861 Only include Intel intrinsics header on x86 and x64 2017-11-11 16:20:00 -08:00
Sam Lantinga
2f2d79f342 Replaced the intrinsics header with the single header that includes all intrinsics so we can use AVX, etc. 2017-11-10 14:22:21 -08:00
Alex Szpakowski
cf6ed4a80c macOS: Fix an OS-generated warning printed to stdout on launch in bundled apps. 2017-11-09 22:24:09 -04:00
Sam Lantinga
43dc92f4e5 Back out the following commits which are causing Dota 2 Exclusive Fullscreen to fail on AMD-based Macs. The details of why this is being reverted are at: https://bugzilla.libsdl.org/show_bug.cgi?id=3949
Alex Szpakowski <slime73@gmail.com> 2017-07-12 21:28 -0300
macOS: Expose more display modes on retina screens. Fixes an issue found in BZFlag.
http://hg.libsdl.org/SDL/rev/1e26564c7288

Alex Szpakowski <slime73@gmail.com> 2017-07-12 21:32 -0300
Fix a potential crash in macOS 10.7 and earlier.
http://hg.libsdl.org/SDL/rev/424607440631
2017-11-08 14:17:23 -08:00
Brandon Schaefer
782af21dfb Fixed bug 3943 - General SDL_HINT_VIDEO_DOUBLE_BUFFER hint support 2017-11-07 09:10:32 -08:00
Ryan C. Gordon
4541e18c18 mouse: remove assert for unimplemented platforms (thanks, tomwardio!).
Fixes Bugzilla #3946.
2017-11-06 15:29:24 -05:00
Sam Lantinga
7fe2341284 Updated version to 2.0.8 since SDL_image depends on it 2017-11-05 01:17:24 -07:00