Commit Graph

8972 Commits (dfbe1f7248649fdca86368bc51f3592931c8ebe5)

Author SHA1 Message Date
pionere 905e2e22ef cleanup of SDL_MixAudioFormat 2022-01-28 20:40:19 -05:00
pionere d7110b4490 fix compiler warnings in SDL_windows_gaming_input.c 2022-01-28 20:40:19 -05:00
pionere e11ba0f5d9 do not load/unload opengl library when SDL_WINDOW_METAL flag is changed 2022-01-28 20:40:19 -05:00
Sylvain f5911bdc59 GLES2: disable texcoord when not using it (see bug #5235)
similar to opengl backend code:
- glDisableVertexAttribArray doesn't need to depend on 'drawstate.texture' value
- move binding code to SetCopyState()
2022-01-28 19:25:40 +01:00
Sylvain 096fe37bb2 GLES2: revert 7bf8c5a388 2022-01-28 19:25:40 +01:00
Sylvain a988ce5544
Fixed bug #964 - SDL_RenderCopy stretch loses proportion on viewport boundaries 2022-01-28 17:24:59 +01:00
Sylvain 7bf8c5a388 GLES2: disable texcoord when not using it (see bug #5235) 2022-01-27 21:49:05 -05:00
Vitaliy Zhmurikov 5b74459255 Update SDL_joystick.c
Add Logitech Momo Racing Wheel VID & PID  to SDL_IsJoystickProductWheel function
2022-01-27 12:30:41 -08:00
Ryan C. Gordon 19ae71b2db
video: Don't add SDL_WINDOW_(METAL|OPENGL) to new windows if unsupported.
Fixes #4656.

(Better than the previous fix in 3044310518dbb2d4814b32c6521f332b8d69aae5.)
2022-01-27 11:49:15 -05:00
Ivan Epifanov d7e0c54dde PSVita: send initial SDL_JOYDEVICEADDED events 2022-01-27 08:47:53 -08:00
Cameron Gutman cc40f732f9 wayland: Round the refresh rate rather than truncating it
A 59999 mHz monitor should be reported as 60 Hz, not 59 Hz.
2022-01-26 21:27:13 -06:00
Ryan C. Gordon 3044310518 video: Don't add SDL_WINDOW_METAL to new windows if not using Cocoa or UIKit.
Fixes #4656.
2022-01-26 21:10:15 -05:00
Cameron Gutman 77a9ca6ba0 wayland: Fix SDL_SetWindowSize() being dropped right after exiting fullscreen
If we get a SDL_SetWindowSize() call right after SDL_SetWindowFullscreen() but
before we've gotten a new configure event from the compositor, the attempt to
set our window size will silently fail (when libdecor is enabled).

Fix this by remembering that we need to commit a new size, so we can do that
in decoration_frame_configure().
2022-01-26 19:48:16 -05:00
Cameron Gutman c6ec5a07f1 d3d11: Respect SDL_HINT_RENDER_DIRECT3D_THREADSAFE when creating device 2022-01-26 18:44:29 -06:00
Ryan C. Gordon f37e4a94d3
video: Don't check if we can use a "texture framebuffer" until needed.
This prevents SDL from making an OpenGL context and maybe throwing it away
immediately by default. It will now only do it when trying to request a
window framebuffer directly, or creating an SDL_Renderer with the "software"
backend, which makes that request itself.

The way SDL decides if it should use a "texture framebuffer" needs dramatic
updating, but this solves the immediate problem.

Reference Issue #4624.
2022-01-26 17:06:25 -05:00
Eric Wasylishen 71e06a536a cmake: fix Metal detection
Confirmed to work on:
macOS 10.15.7
XCode Version 12.4 (12D4e)
2022-01-26 12:33:16 -05:00
Ethan Lee 8ceba27d62 video: Prefer Wayland over X11 2022-01-26 12:32:45 -05:00
Ethan Lee 68a71f91c6 wayland: Try to avoid committing before the window is shown 2022-01-25 17:19:19 -05:00
Sam Lantinga 84320266f2 Fixed the queue filling up with sentinel events when the WaitEvent call is passed NULL for the event
The use case is an application that waits for events on the main thread and dispatches them on a separate thread.
2022-01-25 12:37:43 -08:00
Ethan Lee f0e768da43 wayland: Call SetFullscreen directly in ShowWindow.
This cuts out an extra flush when getting the first configure event.
2022-01-25 13:07:00 -05:00
Sylvain 8c660ccb6f
Fixed bug #5256: X11 Segmentation fault with multiple windows and renderers
First window is created and it triggers and 'EnterNotify' event
which calls SDL_SetMouseFocus() and X11_ShowCursor() while the second
windows hasn't finished to be created  (eg window->driverdata isn't set)
Just check for a valid 'driverdata'
2022-01-25 17:18:40 +01:00
Ethan Lee e2d74bcbe5 wayland: Detach hidden surfaces in HideWindow, not ShowWindow 2022-01-25 11:16:09 -05:00
Ryan C. Gordon ca22b30e46
testgles2: Use vertex buffer objects instead of client-side arrays.
GLES2 always has them, and they work without hacks on Emscripten, unlike
client-side arrays.

I cleaned it up slightly, but this patch was mostly written by @bing2008.

Fixes #5258.
2022-01-24 22:41:41 -05:00
ulatekh 57bc90403e Add hint to optionally forcibly raise the window under MS Windows. 2022-01-24 11:10:57 -08:00
ulatekh d7873e656b Disable tablet flicks under MS Windows. 2022-01-22 08:52:46 -08:00
Charlie Birks 15ebad6e7d emscripten: Implement SDL_OpenURL 2022-01-22 13:31:11 +00:00
Charlie Birks 99af3281ee timer: Fix Emscripten declaration-after-statement error 2022-01-22 12:27:54 +00:00
ulatekh 53df0e6619 Fix the erroneous generation of mouse-down events from touch-move events.
The issue is that MS Windows synthesizes a mouse-move event in response
to touch-move events, and those mouse-move events are NOT labeled as
coming from a touch (e.g. GetMouseMessageSource() will not return
SDL_MOUSE_EVENT_SOURCE_TOUCH for those synthesized mouse-move events).

In addition, there seems to be no way to prevent this from happening;
https://gist.github.com/vbfox/1339671 claims to demonstrate a technique
to prevent it, but in my experience, it doesn't work.

Because of this, the "fallthrough" case can't test that the synthesized
mouse-move came from a touch-move, and starts erroneously pressing down
the mouse-button, leading to massive confusion in the client
application.
2022-01-21 17:23:59 -08:00
ulatekh 8f8b14cbb6 Synthesize a missing touch-up event.
If a touch-down event is received for an existing touch-ID, that
probably means the operating system lost it, and that the missing
touch-up should be synthesized, to keep the client state coherent.
2022-01-21 17:23:11 -08:00
Ozkan Sezer d2456b6e4c os2, geniconv: default functions pointers to Uni*() API,
In case they get accessed before SDL_Init() was called.
2022-01-21 11:50:40 +03:00
Sam Lantinga 67cb548bef Fixed build error with C90 compilers 2022-01-20 19:31:54 -08:00
Carl Glave a23b3c767f Add support for correlating trigger input 2022-01-20 17:43:35 -08:00
Ethan Lee e1b4761c62 wayland: Avoid calling SetFullscreen in libdecor ShowWindow.
This caused some weird stuff to happen in the libdecor path, probably because
the window hasn't actually been mapped yet. It ends up calling stuff that
should not yet apply, and so fullscreen in particular would have a really
messed up titlebar.

The good news is, libdecor is good about tracking fullscreen state, so we can
let the callback do this for us. Keep this for xdg_shell because we actually
map the window ourselves, so we know this call is valid for that path.
2022-01-20 14:10:58 -05:00
Ethan Lee ed3442d7a5 wayland: Fix building with SDL_OPENGL=OFF 2022-01-19 15:47:52 -05:00
Ryan C. Gordon 426c1f4b85
opengles2: fix comment about client-side arrays. 2022-01-19 14:28:30 -05:00
Frank Praznik b3984df1c6 audio: pipewire: Use client config files instead of module names
Pipewire, as of 0.3.22, uses client config files to load modules instead of explicitly specifying them (PW_KEY_CONTEXT_PROFILE_MODULES is deprecated).  Use the new method to load the realtime module to boost the audio thread priority.
2022-01-19 14:20:19 -05:00
Ozkan Sezer 381520ad92 updates for watcom optimization flags 2022-01-18 14:32:24 +03:00
Sam Lantinga a0e3c884d4 Updated to version 2.0.21 for development 2022-01-17 15:32:27 -08:00
Ozkan Sezer 1bfefb5b4d regenerated configure script. 2022-01-17 20:56:50 +03:00
Ozkan Sezer a575e2cf5e Enable alloca on mingw/cygwin builds:
This effectively reverts commit 391d73e37b26614e2e343ca8e9d4334e07380896
Fixes https://github.com/libsdl-org/SDL/issues/5234
2022-01-17 20:56:24 +03:00
Ozkan Sezer 33dadbf137 'dnl' whitespace tidy-up in configure.ac 2022-01-17 20:56:20 +03:00
Cameron Gutman d3952a8a2c wayland: Avoid spurious resize events 2022-01-17 11:30:03 -06:00
Sam Lantinga b06866ef97 Entirely remove Xbox axis filtering, we don't want this at all. 2022-01-16 09:44:28 -08:00
Sam Lantinga 09aed1020b Don't send output reports to the Victrix Pro FS v2
It'll hang on reboot if it gets output reports, and it doesn't have functionality that requires them, so skip it.
2022-01-16 09:23:58 -08:00
Sam Lantinga 85961b61a1 Disable Xbox axis deadzone handling by default
Fixes https://github.com/libsdl-org/SDL/issues/5227
2022-01-16 09:01:56 -08:00
Mathieu Eyraud 2a0cde8fd5 Always send SDL_WINDOWEVENT_SIZE_CHANGED when window is resized
SDL_WINDOWEVENT_SIZE_CHANGED is now sent even if the resulting size of the window does not match the requested size.
2022-01-16 08:49:48 -08:00
Sam Lantinga 1a50334c46 Fixed Xbox One trigger axis zero point 2022-01-14 15:04:26 -08:00
Ozkan Sezer e9511f7136 hidapi, libusb: don't use iconv on OS/2, it lacks wchar_t functionality.
Taken from a patch by Silvan Scherrer at bitwiseworks' OS/2 fork.
2022-01-14 14:39:04 +03:00
Ethan Lee 9a2bbd8acb wayland: Convert URI to local path for DropFile 2022-01-12 13:01:05 -05:00
Ozkan Sezer 0abc0a6f32 SDL_string.c: tidy-up gcc2 va_copy defines after previous haiku commit. 2022-01-12 20:37:32 +03:00