Commit Graph

7967 Commits

Author SHA1 Message Date
DomGries
0d541e5a88 Revert "Fixed relative mode mouse events stopping if you click on the title bar"
This has been better fixed by b28ed02 or another related relative mouse mode change of @slouken in SDL 2.0.17 and as such can be reverted to reduce unneeded processing in WM_MOUSEMOVE
2021-10-05 15:46:12 -07:00
Sam Lantinga
c542de9213 React to WM_NCACTIVATE instead of WM_SETFOCUS or WM_ACTIVATE for focus changes
See https://github.com/libsdl-org/SDL/pull/4293 and https://github.com/libsdl-org/SDL/issues/4450 for details
2021-10-05 14:09:52 -07:00
Ryan C. Gordon
ab7910facf
cmake: Move the old, global add_definitions (etc) to an interface library.
Fixes #4150.
2021-10-05 12:34:29 -04:00
Ryan C. Gordon
f1793af404
cmake: removed an add_definitions call. 2021-10-05 11:19:30 -04:00
Ryan C. Gordon
25fdba39bb
cmake: fix indentation. 2021-10-05 11:19:14 -04:00
Ryan C. Gordon
f306662544
cmake: Correctly set IOS variable.
Fixes #4635.
2021-10-05 11:13:41 -04:00
Ryan C. Gordon
60d59aeb61
cmake: Calculate padding for dislaying options automatically. 2021-10-05 10:54:06 -04:00
Ryan C. Gordon
7850d0cf6f
cmake: Prefix all options with "SDL_"
This makes it clear which options came from SDL's CMake project when
building SDL as a subdirectory of a parent CMake project.

Fixes #4139.
2021-10-05 10:45:26 -04:00
Sylvain
172957387e
PSP: links for setting up, compiling and running on PSP 2021-10-04 22:12:08 +02:00
Sylvain
f080273acd
PSP: add implementation for RenderGeometry 2021-10-04 22:01:11 +02:00
Ozkan Sezer
e92a639b23 replaced many uses of libc calls with SDL_ counterparts in os2 sources.
TODO: core/os2 and geniconv sources _must_ be updated, as well..
2021-10-04 23:00:28 +03:00
Sylvain
dd9b2daf8d
PSP: fixed build 2021-10-04 21:56:42 +02:00
Ozkan Sezer
3ea35fe5bb fix SDL_atoi()
fixes https://github.com/libsdl-org/SDL/issues/4811
2021-10-04 21:32:00 +03:00
Ivan Epifanov
407867cf72 Alias SDL2::SDL2 to SDL2::SDL2-static on static-only builds 2021-10-04 11:17:30 -07:00
Ozkan Sezer
cd7ef24cba minor update to os2 makefile. 2021-10-04 00:32:56 +03:00
Sam Lantinga
c501d159a9 Fixed range for Steam Controller sensor values 2021-10-03 14:10:21 -07:00
Sam Lantinga
ea1a2b94f2 Use the correct update rate for Steam Controller sensors 2021-10-02 09:13:29 -07:00
David Gow
eadc8f9355 wayland: Cleanup some SDL_TryLockMutex() calls.
Check the result of these against 0 explicitly, so that it's obvious
we're bailing out on failure, not success.
2021-10-02 11:14:52 -04:00
David Gow
25f9e32b0e wayland: Don't let multiple threads dispatch wayland events at once
wl_display_dispatch() will block if there are no events available, and
while we try to avoid this by using SDL_IOReady() to verify there are
events before calling it, there is a race condition between
SDL_IOReady() and wl_display_dispatch() if multiple threads are
involved.

This is made more likely by the fact that SDL_GL_SwapWindow() calls
wl_display_dispatch() if vsync is enabled, in order to wait for frame
events. Therefore any program which pumps events on a different thread
from SDL_GL_SwapWindow() could end up blocking in one or other of them
until another event arrives.

This change fixes this by wrapping wl_display_dispatch() in a new mutex,
which ensures only one thread can compete for wayland events at a time,
and hence the SDL_IOReady() check should successfully prevent either
from blocking.
2021-10-02 11:03:20 -04:00
Sam Lantinga
8b74575267 Added support for the gyro and accelerometer on Steam Controllers
Fixes https://github.com/libsdl-org/SDL/issues/4577
2021-10-01 21:32:21 -07:00
Sam Lantinga
db18764e41 Use correct relative include path 2021-10-01 16:27:59 -07:00
Sam Lantinga
632aca2945 Window input focus is based on WM_SETFOCUS and WM_KILLFOCUS as WM_ACTIVATE doesn't necessarily imply focus.
Hopefully resolves https://github.com/libsdl-org/SDL/issues/4450 and https://github.com/libsdl-org/SDL/pull/4293
2021-10-01 16:17:38 -07:00
Sam Lantinga
9706feacae Update length after shortening string (thanks mayraud705!)
Closes https://github.com/libsdl-org/SDL/pull/4698
2021-10-01 15:11:25 -07:00
Sylvain
77acd44f28
DirectFB: fixed creation of palette textures 2021-10-01 22:30:51 +02:00
Sylvain
83d600904b
DirectFB: add partial support for RenderGeometry
allow to fill triangles with color or texture
but only uniform vertex color is handled (not per vertex color)
2021-09-30 23:47:37 +02:00
Ryan C. Gordon
7def81cf42
wikiheaders.pl: Don't treat chars in code blocks as markdown.
Otherwise a formula like `x = y * 2;` would treat that '*' as the start of
an italicized section when converting to MediaWiki format, and match any
other '*' in the content as the end marker.
2021-09-30 17:34:25 -04:00
Ryan C. Gordon
2f93fbbb75
include: Fix markdown in a doxygen comment. 2021-09-30 10:04:09 -04:00
Ryan C. Gordon
ab09f3dae5
cmake: Remove warning about CFLAGS environment variable.
CMake 3.11.0 respects this environment var.

Fixes #4681.
2021-09-30 10:02:54 -04:00
Ryan C. Gordon
cd6f96dede
cmake: bump minimum CMake allowed to 3.11.0.
This cmake is 3 years old, but it removes confusion about the CFLAGS
environment variable (as of CMake 3.10.0, reference PR #4681) and also
consolidates resolves the need to have a separate requirement for Windows
Store apps (which requires CMake 3.11.0).
2021-09-30 10:02:53 -04:00
Daniel Inkpen
344f018dfd Xcode-iOS Demos: Add CFBundleShortVersionString to Info.plist
Xcode 13.0 requires this key to be present in the Info.plist to be able to run the compiled code.
2021-09-29 16:39:31 -07:00
Cameron Cawley
c270949b5e Add a fast path for ARGB888->(A)BGR888 blending with pixel alpha 2021-09-28 11:27:56 -07:00
SDL Wiki Bot
8b23029d23 Sync wiki -> header 2021-09-28 17:03:06 +00:00
Ryan C. Gordon
f79ac6a8de
cmake: Don't use the CFLAGS environment variable.
CMake has standard means of setting compiler flags, such as the
-DCMAKE_C_FLAGS command line for general-purpose flags, and
-DCMAKE_BUILD_TYPE for letting it choose reasonable release/debug/etc
defaults. Trying to emulate the configure script is incorrect and confusing
here.

Fixes #1819.
2021-09-27 23:31:23 -04:00
Ryan C. Gordon
114d1d46ac
direct3d: Remove unnecessary render target support check.
Direct3D 9 dictates that caps.NumSimultaneousRTs must always be at least 1,
which is to say that Direct3D 9 level hardware must always support render
targets.

(caps.NumSimultaneousRTs is meant to show if you can draw to multiple render
targets in a single draw call.)

We had already hardcoded SDL_RENDERER_TARGETTEXTURE as available earlier in
the function anyhow.

Fixes #4781.
2021-09-27 23:18:25 -04:00
Ethan Lee
0fc43504a0 wayland: Add support for XCURSOR_THEME/SIZE 2021-09-27 16:41:43 -04:00
Martin Mauersics
7c050aa60a egl: Don't fail to create a context if KHR_create_context_no_error is unsupported 2021-09-27 13:53:16 -04:00
David Gow
35d045584d video: wayland: Support displays with a 0 refresh rate
Some wayland compositors report the refresh rate as 0. Since we want to
force a minimum refresh rate of 10 frames worth, we were dividing by the
reported refresh rate, causing a divide-by-zero.

If the refresh rate is 0, instead force a frame every second if no frame
callbacks are received.

This fixes bug #4785
2021-09-27 09:26:40 -04:00
Ozkan Sezer
ba87876ef7 fix syntax error in SDL.vcxproj.filters
Noticed by Markvy.
Fixes https://github.com/libsdl-org/SDL/issues/4787
2021-09-27 14:10:02 +03:00
Sam Lantinga
9672d58119 Need to check structure version before setting xdg_toplevel to NULL 2021-09-26 14:22:11 -07:00
Northfear
14f225198d Use SDL_calloc for allocation of gxm_texture 2021-09-26 14:16:35 -07:00
Cacodemon345
b592e78f93 wayland: Expose xdg_toplevel to SysWM 2021-09-26 05:53:21 -04:00
SDL Wiki Bot
7a1690eb63 Sync wiki -> header 2021-09-26 02:32:05 +00:00
SDL Wiki Bot
7becc41495 Sync wiki -> header 2021-09-25 17:36:04 +00:00
Sam Lantinga
d854ba99c2 Removed X11 code from Apple Xcode project 2021-09-24 10:59:35 -07:00
Sam Lantinga
477fcf52e9 Fixed whitespace 2021-09-24 10:49:46 -07:00
Sam Lantinga
db68af8032 Reduce the likelyhood that the mouse will hover over the taskbar or toast notification while in relative mode, which causes a mouse leave event.
This will still happen occasionally as the mouse is whipped around, if there is a window overlapping the game window, but it should happen less often now. This could even happen with the original code that warped the mouse every frame, so this should be a good compromise where we don't warp the mouse continously and we still keep the mouse in the safe area of the game window.

Note that notifications can be any size, so the safe area may need to be adjusted or even dynamically defined via a hint.
2021-09-24 10:49:44 -07:00
Ozkan Sezer
ce66051b0a regenerated configure 2021-09-24 04:03:24 +03:00
Ethan Lee
ef8c4d27d7 wayland: Require xkbcommon 0.5.0 or newer (2014-10-18)
Fixes #4645
2021-09-23 17:45:38 -04:00
Sylvain
decd1b4d74
testdraw2: display FPS similarly to testsprit2. fix helper syntax 2021-09-23 22:28:45 +02:00
Ethan Lee
7ed415d2ed wayland: Reuse KeySymToUcs4 to replicate X11 keymap behavior 2021-09-23 11:50:47 -07:00