Commit graph

11627 commits

Author SHA1 Message Date
Ryan C. Gordon
4c72dd1b02 direct3d: Make sure streaming textures update before being used for drawing.
Fixes Bugzilla #4402.
2018-12-03 01:58:23 -05:00
Ryan C. Gordon
a9b658ab1c Patched to compile on C89 compilers. 2018-12-02 21:57:33 -05:00
Ryan C. Gordon
e7b0e3e1b5 direct3d: Release and NULL out vertex buffers on reset.
Otherwise they are irretrievably lost on window resize, etc, which makes
rendering freeze and other disasters.

Fixes Bugzilla #4358.
2018-12-02 20:55:57 -05:00
Ryan C. Gordon
f77aac8e09 cmake: Comment out some debug logging that can upset build environments.
Something about the dashes, colons, numbers makes some builders believe this
is an error message.
2018-12-02 02:43:32 -05:00
Ryan C. Gordon
4375771a80 directfb: Updated render backend to new internal API.
Totally untested, beyond it now compiles again. Probably needs some fixes.

Fixes Bugzilla #4405.

--HG--
extra : rebase_source : 9a6a8b964c6140e53d7e139a768356ca6e28906b
extra : histedit_source : 7b2e68b42f05e931d371dc20c5a052d0898a26c3
2018-12-02 02:33:06 -05:00
Sergey Zhuravlevich
2cbe6f9558 kmsdrm: Check for resources when validating KMSDRM device in check_modesetting.
Fixes Bugzilla #4403.
2018-12-01 16:31:56 -05:00
Sergey Zhuravlevich
081e95ab4e kmsdrm: uninitialized KMSDRM fixes
* Search for valid encoder in connector when it doesn't have an
   encoder ID set.

 * Search for valid CRTC in resources and encoder's possible CRTCs
   when encoder doesn't have one set.

 * Select default mode if CRTC doesn't have a valid one.

 * Pick current_mode's W/H/Refresh Rate basing on current and
   valid CRTC mode, not the saved one.
2018-12-01 13:09:00 -05:00
Ryan C. Gordon
063f4fb0ee android: use cpufeatures to support SDL_HasNEON() (thanks, Sylvain!).
Fixes Bugzilla #4406.
2018-12-01 12:19:11 -05:00
Ryan C. Gordon
938d5a5b22 Added some detail to a Doxygen comment (thanks, Sylvain!). 2018-12-01 12:17:34 -05:00
Ryan C. Gordon
0884284086 Patched to compile on Linux with threads enabled. (whoops!) 2018-12-01 11:14:20 -05:00
Ryan C. Gordon
4de1ab9129 Patched to compile on Linux with --disable-threads.
Fixes Bugzilla #4393.

--HG--
extra : rebase_source : 7dcab81ff39b3345fa19e616e90ca0949373bd2d
2018-12-01 10:36:26 -05:00
Sam Lantinga
1897ec629d Added support for the Razer Raiju Mobile 2018-11-27 15:10:26 -08:00
Sam Lantinga
6d2e4bde2a Fixed the hotspot for cursors on Raspberry Pi 2018-11-27 11:16:04 -08:00
Sam Lantinga
a5a5e2cbd3 Fixed bug changing cursors on Raspberry Pi 2018-11-27 10:20:29 -08:00
Ozkan Sezer
06b24e43f6 SDL_touch.h (SDL_TouchDeviceType): remove comma at end of enumerator list. 2018-11-26 19:55:01 +03:00
Alex Szpakowski
f8efb8361a metal: use a staging texture in SDL_UpdateTexture, to make sure it doesn't stomp texture data being drawn in a previous frame on the GPU. 2018-11-25 22:13:09 -04:00
Sam Lantinga
18580909f9 Added atomics support for armv8-a (Raspberry Pi 3) 2018-11-23 21:29:42 -08:00
Sam Lantinga
41f6fc69e0 Do a second pass to find libraries without a single version digit after the .so
This finds libsndio.so.6.1 on Raspberry Pi
2018-11-23 21:11:11 -08:00
Alex Szpakowski
eaa6a12822 metal: Fix an incorrect division. 2018-11-21 23:46:37 -04:00
Alex Szpakowski
52adb7e81e metal: SDL_RenderFillRects uses one draw call per 16k rectangles (within the given FillRects call), instead of one draw call per rectangle. Reduces CPU usage when drawing many rectangles.
--HG--
extra : amend_source : 1b39afd4eaa31c151f607e4685f079a46fa6238c
2018-11-21 23:37:23 -04:00
Sebastian Krzyszkowiak
15c44098d6 wayland: ask xdg-decoration protocol extension to use server-side decorations if possible. 2018-11-04 21:08:40 +01:00
Ozkan Sezer
eb37476b4d minor update to Makefile.os2, added a test/Makefile.os2. 2018-11-20 10:55:00 +03:00
Sam Lantinga
97f778f0f3 Fixed bug 4394 - Crash in SDL_PumpEvents() after SDL_DestroyWindow()
Cameron Gutman

After updating to SDL 2.0.9, I got a user report that my app was crashing when closing a SDL_WINDOW_FULLSCREEN window to return to my Qt-based UI. It looks like the dead SDL window is getting a spurious updateLayer call which is causing SDL to dereference a null SDL_WindowData pointer.

For some reason, this only happens when using SDL_WINDOW_FULLSCREEN and not windowed or SDL_WINDOW_FULLSCREEN_DESKTOP. I was also unsuccessful in my attempt to get a simple reproducer for this crash. The Session.cpp code is available 688c4a90d9/app/streaming/session.cpp but I slightly modified it (adding a SDL_PumpEvents() call at 1179 to immediately trigger the issue, otherwise it happened when Qt next pumped the event loop).

The crashing line is:

    NSMutableArray *contexts = data->nscontexts;
2018-11-19 21:35:59 -08:00
Sam Lantinga
3a25554bb0 Fixed bug 4392 - SDL_cpuinfo.h breaks compilation with C bool type
Luke Dashjr

Bug 3993 was "fixed" by #undef'ing bool. But this breaks C99's stdbool.h bool too.

For example, mpv's build fails with:

../audio/out/ao_sdl.c:35:5: error: unknown type name ‘bool’

It seems ill-advised to be #undef'ing *anything* here - what if the code including SDL_cpuinfo.h actually wants to use altivec?
2018-11-19 21:28:52 -08:00
Sam Lantinga
70916714eb Fixed bug 4391 - hid_enumerate() sometimes causes game to freeze for a few seconds
Daniel Gibson

Even though my game (dhewm3) doesn't use SDL_INIT_JOYSTICK, SDL_PumpEvent() calls SDL_JoystickUpdate() which ends up calling hid_enumerate() every three seconds, and sometimes on my Win7 box hid_enumerate() takes about 5 seconds, which causes the whole game to freeze for that time.
2018-11-19 21:17:00 -08:00
Ozkan Sezer
c1da1f116b os/2 bits for SDL_malloc.c -- from libffi 2018-11-18 19:28:20 +03:00
Ozkan Sezer
c166586725 libm: Watcom defines huge=__huge: undefine it to fix build using Watcom. 2018-11-18 11:50:20 +03:00
Ozkan Sezer
56031584bb Makefile.os2: build libm as a static lib and add it to linkage.
in case it is needed some day.
2018-11-18 11:50:02 +03:00
Ryan C. Gordon
7ce155694c opengles: Fixed compiler warnings.
--HG--
extra : rebase_source : aef63cc80f39c9351ca39fe0c24e4f4e78bbf5d1
2018-11-17 16:24:52 -05:00
Sam Lantinga
e1d71b88e1 Back out change initializing renderer blend mode incorrectly. 2018-11-17 12:12:29 -08:00
Ryan C. Gordon
b13e7d9f99 direct3d11: Fixed missing rendering of solid primitives.
Fixes Bugzilla #4388.
2018-11-17 14:39:42 -05:00
Ryan C. Gordon
5186bd4a84 Fixed a few compiler warnings. 2018-11-17 14:37:51 -05:00
Sam Lantinga
f1b7d53e6c The default draw blendmode is SDL_BLENDMODE_NONE 2018-11-17 00:58:45 -08:00
Sylvain Beucler
5a3f2fc79e Emscripten: make CloseAudio actually close audio
cf. https://bugzilla.libsdl.org/show_bug.cgi?id=4176
2018-11-15 18:22:30 +00:00
Ozkan Sezer
6520a3dbe0 fix permissions 2018-11-15 07:20:02 +03:00
Ryan C. Gordon
8cac51aa90 software: fix blits with color mods that change during a command queue run.
--HG--
extra : rebase_source : f1b4087bb0bbf8955a9d418158b28b066ae79402
2018-11-14 22:38:58 -05:00
Sam Lantinga
2005ea6ca2 Fixed bug 3193 - Dualshock 3's motion sensors overwrite analog stick
maxxus

The Dualshock 3's motion sensors don't seem to be reported by the call to EVIOCGBIT but they still send EV_ABS events.  Because they're not reported by EVIOCGBIT they're not assigned a proper axis ids and the default of 0 is used, which is the valid id for the left analog sticks left/right axis.
2018-11-14 13:37:22 -08:00
Sam Lantinga
e53c04a3e6 Fixed bug 4377 - SDL_PIXELFORMAT enum is anonymous, which prevents its use in a templated function
zen3d

While trying to build Pixie lisp (https://github.com/pixie-lang/pixie), which uses SDL for multimedia output, the mandelbrot example won't build. The problem is that internally pixie uses a templated function to dump a value, and gcc chokes because SDL_PIXELFORMAT_RGA8888 is an anonymous enum.

I solved the problem locally by changing from:
   enum {
      SDL_PIXELFORMAT_UNKNOWN,
      ... etc. ...
      SDL_PIXELFORMAT_YUYV = ... etc ...
   };
to:
   typedef enum {
      SDL_PIXELFORMAT_UNKNOWN,
      ... etc. ...
      SDL_PIXELFORMAT_YUYV = ... etc ...
   } SDL_PIXELFORMAT_ENUM;
The net result of this change is that the enum containing SDL_PIXELFORMAT_* is no longer an anonymous enum and can now be used by a templated function.

This local change fixes Pixie lisp for me.

I did notice that you use the idiom
   typedef enum {
      ... etc ...
   } SDL_FOO;
elsewhere in your code, so that change to SDL_PIXELFORMAT doesn't look like it would have a negative impact.
2018-11-12 19:23:49 -08:00
Sam Lantinga
6e92b4109f Fixed bug 4366 - Compile throws a warning on RPI (Raspbian Stretch)
midwan

When trying to compile on a Raspberry Pi 3, running Raspbian Stretch (fully updated), a warning appears:

/home/pi/projects/SDL/src/test/SDL_test_memory.c: In function ‘SDL_TrackAllocation’:
/home/pi/projects/SDL/src/test/SDL_test_memory.c:112:109: warning: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘unw_word_t {aka unsigned int}’ [-Wformat=]
                 snprintf(entry->stack_names[stack_index], sizeof(entry->stack_names[stack_index]), "%s+0x%llx", sym, offset);
2018-11-12 16:42:49 -08:00
Sam Lantinga
91cb5f655b Fixed bug 4367 - compatibility version decreased between 2.0.8 and 2.0.9
Joshua Root

The change resulting from Bug 4208 changed the compatibility_version of libSDL2 from 9.0.0 to 1.0.0. This is simply wrong.

This means that programs linked against 2.0.9 are considered by the dynamic linker to be compatible with all previous versions of libSDL2. This is not the case since new public symbols have been added.

The way compatibility_version and current_version are meant to work is:
 * current_version increases every time the library changes in any way.
 * compatibility_version is increased to match current_version whenever new public symbols are added.

Thus both versions should only ever increase. The solution to the Xcode project and autotools not having matching versions should have been to increase the version(s) in the Xcode project.

Reference: https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/VersionInformation.html
2018-11-12 16:34:58 -08:00
Alex Szpakowski
fb12641435 cocoa: fix building with the macOS 10.7 SDK (thanks Riccardo!)
Fixes bug #4368
2018-11-10 20:56:23 -04:00
Alex Szpakowski
8760526f85 Add SDL_TouchDeviceType enum and SDL_GetTouchDeviceType(SDL_TouchID id).
Touch device types include SDL_TOUCH_DEVICE_DIRECT (a touch screen with window-relative coordinates for touches), SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE (a trackpad-style device with absolute device coordinates), and SDL_TOUCH_DEVICE_INDIRECT_RELATIVE (a trackpad-style device with screen cursor-relative coordinates).

Phone screens are an example of a direct device type. Mac trackpads are the indirect-absolute touch device type. The Apple TV remote is an indirect-relative touch device type.
2018-11-10 16:15:48 -04:00
Sam Lantinga
51a10d7f68 Used confflags +=, so each option can be enabled individually, if desired 2018-11-07 07:52:39 -08:00
Sam Lantinga
54d22a6fe8 The Debian maintainers aren't using these rules, so enable dynamic loading of shared libraries by default for the Steam Linux Runtime 2018-11-07 07:38:11 -08:00
Sam Lantinga
1e59f48daf Added Vulkan headers version 1.1.91
Downloaded from https://github.com/KhronosGroup/Vulkan-Headers
2018-11-06 16:57:07 -08:00
Sebastian Krzyszkowiak
b204de6c4b wayland: fix resizing and fullscreen toggling
For starters, we need to correctly respond to 0,0 configure after unsetting
fullscreen. Also, turns out that there should be no drawing calls at all
in between eglSwapBuffers and wl_egl_window_resize, as otherwise EGL can
already allocate a wrongly sized buffer for a next frame, so handle those
together.
2018-11-07 01:08:35 +01:00
Ozkan Sezer
6dfc2e7fa0 close_code.h: #error if included without matching begin_code.h 2018-11-06 23:45:50 +03:00
Ozkan Sezer
cc035dcc4f fix bug #4362 - SDL_syswm.h with SDL_PROTOTYPES_ONLY broken in C++ mode 2018-11-06 20:50:24 +03:00
Ryan C. Gordon
1c98dea86b os2: Do a distclean instead of removing files manually in buildbot script. 2018-11-04 21:11:07 -05:00
Ryan C. Gordon
09ca1f4018 os2: Added a script for the buildbot. 2018-11-04 20:47:17 -05:00