src/video


Log

Author Commit Date CI Message
Sylvain Becker ebb81431 2021-01-29T12:04:48 Add checks for maximun scaling size (see bug #5510)
Sylvain Becker dd6e02df 2021-01-28T11:03:45 SDL_stretch: remove un-used vars, same notation as blit functions
Sam Lantinga 06ad887f 2021-01-27T11:39:03 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.
Sylvain Becker 5e3cf0d1 2021-01-27T09:34:23 SDL_SoftStretch: disable asm path if mprotect isn't available (see bug #3816)
Sylvain Becker d59f8daf 2021-01-28T15:34:33 Fixed bug 5510 - simplify the scaling functions blit auto (generated file)
Cameron Gutman 6b057c67 2021-01-26T19:16:17 Expose separate keyboard and mouse grab support This adds SDL_SetWindowKeyboardGrab(), SDL_GetWindowKeyboardGrab(), SDL_SetWindowMouseGrab(), SDL_GetWindowMouseGrab(), and new SDL_WINDOW_KEYBOARD_GRABBED flag. It also updates the test harness to exercise this functionality and makes a minor fix to X11 that I missed in https://hg.libsdl.org/SDL/rev/02a2d609369b To fit in with this new support, SDL_WINDOW_INPUT_CAPTURE has been renamed to SDL_WINDOW_MOUSE_CAPTURE with the old name remaining as an alias for backwards compatibility with older code.
Sylvain Becker ff827fc7 2021-01-26T21:15:15 SDL_SoftStretch: re-enable USE_ASM_STRETCH path for gcc >= 4.6
Cameron Gutman 808249a5 2021-01-27T19:40:55 X11: Ungrab the keyboard when the mouse leaves the window GNOME Mutter requires keyboard grab for certain important functionality like window resizing, interaction with the application context menu, and opening the Activites view. To allow Mutter to grab the keyboard as needed, we'll ungrab when the mouse leaves our window. To be safe, we'll do this for all WMs since forks of Mutter and Matacity (and possibly others) may have the same behavior, and we don't want to have to keep track of those.
Sylvain Becker 0b338bff 2021-01-28T15:33:47 Fixed bug 5510 - simplify the scaling functions
Ozkan Sezer 87f09007 2021-01-28T00:11:24 SDL_LowerSoftStretchLinear: assign result from scale_mat() to ret. otherwise it would always return -1 when SSE and NEON instrinsics are absent.
Sam Lantinga 24d6fda2 2021-01-27T12:50:09 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
Cameron Gutman d133a5f6 2021-01-24T17:19:48 wayland: cancel key repeat when keyboard focus is lost SDL_SetKeyboardFocus(NULL) will lift any keys still pressed when keyboard focus leaves the window, but then key repeat comes behind our backs and presses the key down again. This results in an infinite stream of SDL_KEYDOWN events when focus leaves the window with a key down (particularly noticeable with Alt+Tab).
Cameron Gutman 2793c9cf 2021-01-25T18:40:26 Fix grabbing Alt+Tab and Alt+Esc on Windows 7
Cameron Gutman e1f73e64 2021-01-23T16:22:44 Refactor keyboard grab to be managed by the video core This gives us flexibility to add others hints to control keyboard grab behavior without having to touch all of the backends. It also allows us to possibly expose keyboard grab separately from mouse grab for applications that want to manage those independently.
Brandon DeRosier 141f4416 2021-01-24T03:55:04 fix build failure due to -Werror=declaration-after-statement (bug #5500)
Cameron Gutman a1d288be 2021-01-26T00:05:01 DirectFB: Split input grab handling into keyboard and mouse parts The grabbed_window field is superfluous now since SDL added the SDL_GetGrabbedWindow() function, so it can be removed. DirectFB_SetWindowMouseGrab() is also simplified because SDL handles ungrabbing any previously grabbed window prior to calling SetWindowMouseGrab() now. Compile-tested only.
Sam Lantinga f23022ef 2021-01-25T20:03:21 Removed non-functional window grab implementations
Cameron Gutman a0d3c6c6 2021-01-25T21:42:14 Rename SetWindowGrab() to SetWindowMouseGrab()
Manuel Alfayate Corchete 8e1005f8 2021-01-23T22:47:06 [KMS/DRM] Bugfix for #5489: Non-FULLSCREEN windows incorrecty use videomode changing to look fullscreen.
Ethan Lee e787282b 2021-01-23T15:40:22 Implement Wayland_SetWindowResizable
Simon McVittie c16cfc0e 2021-01-23T11:22:35 waylandtouch: Don't export interface structs These are explicitly written in C code rather than generated at build time, so they weren't affected by changing how we invoke wayland-scanner. Signed-off-by: Simon McVittie <smcv@collabora.com>
Cameron Gutman 19236b46 2021-01-21T21:49:13 Implement support for minimizing windows on Wayland This required a bit of extra code to deal with the transition from minimized back to fullscreen
Cameron Gutman cf84ec44 2021-01-20T23:19:24 Improve reliability of cursor hiding on GNOME Wayland Hiding the cursor doesn't appear to work reliably on GNOME when another window steals mouse focus right as we call SDL_ShowCursor(SDL_DISABLE). This can happen when the keyboard shortcut inhibition permission prompt appears in response to a call to SDL_SetRelativeMouseMode() with SDL_HINT_GRAB_KEYBOARD=1. The result is that the default cursor is stuck locked in position and visible on screen indefinitely. By redrawing the cursor on pointer focus enter, the cursor now disappears upon the first mouse motion event. It's not perfect but it's way better than the current behavior.
Cameron Gutman bd553ea8 2021-01-20T21:17:20 Implement support for inhibiting the screensaver on Wayland We support both the org.freedesktop.ScreenSaver D-Bus API (same as the X11 backend) and the Wayland idle_inhibit_unstable_v1 protocol. Some Wayland compositors only support one or the other, so we need both to for broad compatibility.
Cameron Gutman 7ff3832e 2021-01-22T19:22:17 Fix continuous scrolling speed on Wayland Wayland compositors seem to have standardized on 10 units per "wheel tick" for continuous scroll events, so we need to convert these axis values to ticks by dividing by 10 before reporting them in SDL_MOUSEWHEEL events.
Cameron Gutman 8c921d82 2021-01-22T19:40:26 Implement keyboard grab support for Windows This is implemented via a low-level keyboard hook. Unfortunately, this is rather invasive, but it's how Microsoft recommends that it be done [0]. We want to do as little as possible in the hook, so we only intercept a few crucial modifier keys there, while leaving other keys to the normal event processing flow. We will only install this hook if SDL_HINT_GRAB_KEYBOARD=1, which is not the default. This will reduce any compatibility concerns to just the SDL applications that explicitly ask for this behavior. We also remove the hook when the grab is terminated to ensure that we're not unnecessarily staying involved in key event processing when it's not required anymore. [0]: https://docs.microsoft.com/en-us/windows/win32/dxtecharts/disabling-shortcut-keys-in-games
Ozkan Sezer b6ae9a7c 2021-01-21T21:20:10 renamed my_gradd.h to SDL_gradd.h
Cameron Gutman d789ba83 2021-01-19T18:20:07 Implement keyboard grab support for Wayland Use zwp_keyboard_shortcuts_inhibit_manager_v1 to allow SDL applications to capture system keyboard shortcuts like Alt+Tab when keyboard grab is enabled via SDL_HINT_GRAB_KEYBOARD.
Manuel Alfayate Corchete ee93f0ed 2021-01-19T15:35:43 [KMS/DRM] Revert unaproved fix for bug #5465.
Manuel Alfayate Corchete e1d932f8 2021-01-17T21:33:51 [KMS/DRM] Fix for bug #5468: corruption on dynamic cursor changing caused by wrong buffer size.
Manuel Alfayate Corchete 99facb1d 2021-01-17T21:17:01 [KMS/DRM] Fix for bug #5470: ratio correction for fullscreen windows with no matching resolution. Correct bracket position in else statements so they follow the coding style.
Manuel Alfayate Corchete 03665004 2021-01-15T15:00:17 [KMS/DRM] Small fix to KMSDRM_Waitpageflip(). More comments on how it works.
Sam Lantinga 6a342954 2021-01-14T14:42:53 Fixed bug 5451 - Can't create EGLSurface in Wayland from SDLWindow (no EGLNativeWindow pointer) sashikknox In some cases, need create EGLWindow with SDLWindow. In X11 i can get pointer to NativeWindow from **struct SDL_SysWMinfo wmInfo** ```C++ struct SDL_SysWMinfo wmInfo; SDL_GetWindowWMInfo(ptSDLWindow, &wmInfo) #if defined(__unix__) && defined(SDL_VIDEO_DRIVER_X11) nativeWindow=(EGLNativeWindowType)wmInfo.info.x11.window; nativeDisplay=(EGLNativeDisplayType)wmInfo.info.x11.display; #endif ``` than i can create EGLSurface ``` eglCreateWindowSurface(nativeDisplay, EGL_CONFIG, nativeWindow, SURFACE_ATTRIBUTES); ``` in Wayland i can do it with same way, just need pointer to **EGLWindow**, we already have pointer to **wl_display** from **SDL_sysWMInfo**, need add to **wl** struct in SDL_SysWMInfo another pointer to **struct wl_egl_window *egl_window;**. And in wayland backend, in function **Wayland_GetWindowWMInfo** return pointer to **egl_window** from **SDL_WindowData** Now i use patched statically built SDL2 in port of Quake 2 GLES2 for SailfishOS (it use QtWayland): link to SDL2 commit and changed string for patch: - https://github.com/savegame/lp-public/commit/6858a618cd179b766fe3cab36055f07cb03ad0ea - https://github.com/savegame/lp-public/blob/b1e29e87b9d15780e47f04918b329ac15554fc69/SDL2/src/video/wayland/SDL_waylandwindow.c#L463 link to use in Quake2 port: 1. here i get pointer to EGLNativeWindowType: https://github.com/savegame/lp-public/blob/6d94fedb1b720da24999ae6286a1809cd3d55ff5/Engine/Sources/Compatibility/OpenGLES/EGLWrapper.c#L319 2. then use it for create EGLSurface: https://github.com/savegame/lp-public/blob/6d94fedb1b720da24999ae6286a1809cd3d55ff5/Engine/Sources/Compatibility/OpenGLES/EGLWrapper.c#L391
Sam Lantinga 82aafa9a 2021-01-14T14:32:11 Fixed bug 5461 - Add rewritten WSCONS driver for OpenBSD wahil1976 This patch adds a written-from-scratch WSCONS driver for OpenBSD. It does not have hardcoded keymaps, and it features mouse support when wsmux is available. For this to work, it needs access to the /dev/wskbd* devices which are not available to non-root users by default. Access to those can be granted by changing /etc/fbtab to give the logging user the ownership of those devices.
Manuel Alfayate Corchete 1adadc77 2021-01-14T10:18:40 [KMS/DRM] Adjust come return values. Improve comments.
Manuel Alfayate Corchete 57661e42 2021-01-13T20:17:50 [KMS/DRM] Remove unused header.
Manuel Alfayate Corchete ead3c406 2021-01-13T20:11:01 [KMS/DRM] Refactor, improve and re-comment async pageflips code.
Manuel Alfayate Corchete aac74db6 2021-01-13T15:54:26 [KMS/DRM] Enable async pageflips.
Manuel Alfayate Corchete 9384e595 2021-01-12T20:15:37 [KMS/DRM] Add warning comentary to avoid future experiments with scaling.
Manuel Alfayate Corchete 84427549 2021-01-12T00:22:58 [KMS/DRM] Refactor KMSDR_CreateSurface to group all non-Vulkan stuff in a block.
Manuel Alfayate Corchete 87eb734c 2021-01-11T23:59:40 [KMS/DRM] Don't ask SDL to scale image when in Vulkan mode.
Manuel Alfayate Corchete 85e8adf7 2021-01-11T22:28:27 [KMS/DRM] Unused code cleaning.
Manuel Alfayate Corchete 5105ecf8 2021-01-11T21:02:07 [KMS/DRM] Move surface size info to window driverdata, for coherency.
Manuel Alfayate Corchete 2067a7db 2021-01-11T20:29:09 [KMS/DRM] Fix fullscreen to windowed transition. Fix aspect ratio correction without using planes.
Manuel Alfayate Corchete 850d9c8c 2021-01-09T02:25:13 [KMS/DRM] Cleanup remainings from plane/scaling usage.
Manuel Alfayate Corchete 2aeb3177 2021-01-08T22:00:28 [KMS/DRM] Fix vkQuake3 in OpenGL mode.
Sam Lantinga 8746788f 2021-01-08T11:08:23 KMSDRM_LEGACY is no longer legacy
Manuel Alfayate Corchete b2449473 2021-01-08T18:57:12 [KMS/DRM] Go back to the LEGACY interface only because using planes breaks compatibility with HW, so no advantage on using ATOMIC.
Manuel Alfayate Corchete 940e1b8d 2021-01-08T16:33:50 [KMS/DRM] Small readability changes.
Manuel Alfayate Corchete e5bf1850 2021-01-08T15:39:05 [KMS/DRM] Fix cpmpilation warnings. Thanks to Ozkan Sezer for pointing this out!
Manuel Alfayate Corchete cef1bd06 2021-01-08T13:14:42 [KMS/DRM] Prevent creating another default cursor everytime a window is created. Other fixes and cleanups.
Sam Lantinga e778881a 2021-01-07T11:49:28 Fixed bug 5449 - SDL_DROPFILE update mouse location of drop in Cocoa Dominik Reichardt Exult (http://exult.info) has an editor app that uses GTK+2. Up to now we were using X's drag'n'drop to allow dropping of assets from the editor onto Exult. There is now an experimental branch that makes use of SDL_DROPFILE. That works under X, dropping in Exult's SDL2 window puts the asset right at the spot you dropped at. On macOS with native Exult and Quartz GTK+2 this doesn't work, the location of the drop is where the mouse was last tracked before you left the window (usually one of the edges, unless you tabbed out). All we tried out pointed to the fact that the location update needs to be done by the dropfile event in SDL2, not by our own (which always only worked after the Exult window getting focus). This patch adds this to SDL_cocoawindow.m and it works perfectly, passing the correct coordinates to our code (SDL_GetMouseState()).
Manuel Alfayate Corchete d079130c 2021-01-07T18:44:34 [KMS/DRM] Don't use primary plane for scaling because that's unsupported on most LEGACY-only HW.
Manuel Alfayate Corchete e168d113 2021-01-07T14:40:24 [KMS/DRM] Correct drmModeSetCursor() dimensions.
Manuel Alfayate Corchete 335d78ff 2021-01-07T11:30:33 [KMS/DRM] Add the missing files for Vulkan support to the KMSDRM_LEGACY backend, had forgotted to do -hg add-.
Manuel Alfayate Corchete 661bacfe 2021-01-07T00:47:21 [KMS/DRM] Add Vulkan suport to the KMSDRM_LEGACY backend.Minor text spacing tweaks for better readability. Comment out unused function.
Ozkan Sezer dfb0afe3 2021-01-07T00:41:32 fix build after commit 5730b2005da1
Manuel Alfayate Corchete 67e0b1dd 2021-01-06T22:15:26 [KMS/DRM] Rewrite KMSDRM_LEGACY backend to accomodate Vulkan compatibility. Fix several bugs on that backend.
Ozkan Sezer 76295cec 2021-01-05T15:50:10 video/windows: ANSI/UNICODE updates (cf. bug 5435): - explicitly use UNICODE versions of DrawText, EnumDisplaySettings, EnumDisplayDevices, and CreateDC: the underlying structures have WCHAR strings. - change WIN_UpdateDisplayMode and WIN_GetDisplayMode() to accept LPCWSTR instead of LPCTSTR for the same reason. - change WIN_StringToUTF8 and WIN_UTF8ToString to the explicit 'W' versions where appropriate.
Ozkan Sezer 31751bdc 2021-01-05T15:15:37 wmmsg.h: constified wmtab
Ozkan Sezer 390fd14f 2021-01-04T01:23:50 SDL_windowswindow.c (SDL_HelperWindowCreate): adjust for ANSI/UNICODE: change SDL_HelperWindowClassName and SDL_HelperWindowName from WCHAR * to be const TCHAR* cf. bug #5435.
Ozkan Sezer 01a2f276 2021-01-04T01:23:50 consistently use TEXT() macro with LoadLibrary() and GetModuleHandle() cf. bug #5435.
Sam Lantinga 393c8c1f 2021-01-03T10:32:55 Fixed bug 5440 - MacCatalyst build failures C.W. Betts I tested building commit http://hg.libsdl.org/SDL/rev/7adf3fdc19f3 on Mac Catalyst and found some issues: * MTLFeatureSet_iOS_* enums aren't available under Mac Catalyst. * OpenGL ES is unavailable under Mac Catalyst. * Some Metal features are available under Catalyst but not iOS, such as displaySyncEnabled. * Set Metal as the default renderer on Mac Catalyst Attaching a patch that will make SDL2 build for Mac Catalyst.
Sylvain Becker fea49a3e 2021-01-03T15:24:47 SDL_stretch.c: compilation NEON on Windows 10
Sylvain Becker acccc71f 2021-01-02T22:31:44 Fixed bug 5436 - MSVC 2019 ARM64 build fails to compile SDL_stretch.c
Cameron Gutman 6cbd4417 2021-01-02T14:45:15 Add a hint for D3D9Ex to avoid having to choose at compile-time
Sam Lantinga 9130f7c3 2021-01-02T10:25:38 Updated copyright for 2021
Sam Lantinga 963c9495 2021-01-02T10:11:08 Fixed bug 5431 - SDL_Metal_GetDrawableSize is inaccurate for high dpi displays if a Metal view has not already been created Caleb Cornett For a window created with SDL_WINDOW_ALLOW_HIGHDPI, SDL_GL_GetDrawableSize will return the high-dpi drawable size even before any GL context creation happens. But SDL_Metal_GetDrawableSize will return the size of the window if the Metal view has not been created. This is confusing and inconsistent behavior. An easy way to test this is to build testgl2 and testvulkan on macOS with the SDL_WINDOW_ALLOW_HIGHDPI flag enabled during window creation. The GL2 program will report a drawable size of 2x window width and 2x window height, while the Vulkan program will report the window size. This patch addresses the issue by falling back to using the content view dimensions if no Metal view exists in the window. (The code for this was taken directly from Cocoa_GL_GetDrawableSize.) With this change, the testvulkan behavior matches that of testgl2. Note that I haven't tested for this issue on UIKit. It's possible a similar change will need to be made there too.
Sylvain Becker c005267f 2021-01-02T09:38:19 SDL_BlitScaled: better and safer fix clipping bug #2687 And re-use SDL_round(), since it's been re-added (remove in https://hg.libsdl.org/SDL/rev/34043108b7e4 )
Sylvain Becker 2127ed25 2021-01-02T09:28:16 SDL_SoftStretch: add a check for input pixel format and function re-naming
Manuel Alfayate Corchete 21003b7d 2020-12-31T14:31:29 [KMS/DRM] Small refactoring on the SwapWindow function.
Manuel Alfayate Corchete e1fb969b 2020-12-31T01:40:15 [KMS/DRM] Correct comments about last bugfix.
Manuel Alfayate Corchete e34caa97 2020-12-31T01:31:57 [KMS/DRM] Correct EGL/GL library loading on window creation, thus saving window re-creation.
Sylvain Becker d81fe923 2020-12-30T22:03:32 SDL_BlitScaled: remove un needed -1 +1 offset in calculation
Sylvain Becker 80cf8a8b 2020-12-29T17:29:31 SDL_BlitScaled: also prevent crash if dest width or height is negative
Sylvain Becker f08b9a5b 2020-12-29T16:02:52 SDL_BlitScaled: prevent crash if dest width or height is 0
Manuel Alfayate Corchete 427c96ec 2020-12-29T14:24:38 [KMS/DRM] Rework some functions.
Sam Lantinga 3cb0e840 2020-12-28T11:47:53 Fixed bug 5422 - KMSDRM_LEGACY: Add OpenBSD support wahil1976 This patch adds support for OpenBSD to KMSDRM_LEGACY. Note that the patch won't be ported to the atomic KMSDRM backend because OpenBSD does not support atomic KMS properly yet.
Manuel Alfayate Corchete 7539ac80 2020-12-28T18:22:07 [KMS/DRM] Restore hacky code to point to TTY buffer on surface destruction b/c I lack alternatives.
Manuel Alfayate Corchete 86b81abe 2020-12-28T16:19:19 [KMS/DRM_LEGACY] Prevent mouse cursor from staying onscreen after window destruction. Patch by Ozkan Sezer.
Manuel Alfayate Corchete 0feaf7d1 2020-12-28T14:37:58 [KMS/DRM][Vulkan] Correct non-existing property. Remove hacky surface destruction code (TTY buffer isn't there after a Vulkan window is created).
Sylvain Becker 7186584b 2020-12-28T10:41:37 fix indentation (bug 5313)
Sylvain Becker c2735c0b 2020-12-27T23:53:28 Better scaling fallbacks for the SW renderer (bug 5313)
Ozkan Sezer a6beb2d2 2020-12-28T01:10:02 SDL_PrivateLowerBlitScaled: remove unused local var 'a'
Sylvain Becker 30df2e4e 2020-12-27T23:00:11 Scaling fallbacks for the SW renderer (bug 5313)
Sylvain Becker f9b5f6cc 2020-12-27T20:28:24 Forward scale mode to SW renderer (Bug 5313)
Manuel Alfayate Corchete 46d31d57 2020-12-27T00:43:06 [KMS/DRM][Vulkan] Fix segfault when changing fullscren mode and permanent cursor when changing between Vulkan and GL renderers in vkQuake3. Tidy up window destruction code.
Sam Lantinga 9838611a 2020-12-23T15:52:12 Fixed compiler crash building for iOS with clang 11.0.3
Sylvain Becker 4aebad77 2020-12-23T22:50:50 SDL_SoftStretchLowerLinear: try to make xcode buildbot compile (Bug 5313)
Sam Lantinga 93ccdee8 2020-12-23T13:47:49 Fixed bug 5404 - stdlib: Added SDL_round, SDL_roundf, SDL_lround and SDL_lroundf Cameron Cawley stdlib: Added SDL_round, SDL_roundf, SDL_lround and SDL_lroundf The default implementation is based on the one used in the Windows RT video driver.
Sylvain Becker 8e20376f 2020-12-23T22:09:01 SDL_SoftStretchLinear: use SDL_INLINE (bug 5313)
Sylvain Becker 7b8d5b7d 2020-12-23T22:02:28 SDL_SoftStretchLinear: fix implicit conversion (bug 5313)
Sylvain Becker ae8a270f 2020-12-23T21:37:40 Add SDL_SoftStretchLowerLinear() (Bug 5313)
Sylvain Becker 050ee9a4 2020-12-23T21:32:01 Split SDL_SoftStretch in Lower and Uppler functions (Bug 5313)
Manuel Alfayate Corchete 09fcc9ed 2020-12-23T16:45:23 [KMS/DRM][Vulkan] Fix small warning, thanks to Ozkan Sezer for spotting it.
Manuel Alfayate Corchete a6dc838d 2020-12-23T16:22:46 [KMS/DRM][Vulkan] Only try to create a display mode when no suitable mode is found.
Manuel Alfayate Corchete 2fc987c2 2020-12-22T14:15:33 [Buildsystem] Add guards for not building with KMSDRM support if EGL is not available.
Sam Lantinga 4cd98160 2020-12-21T09:44:25 Fixed whitespace
Manuel Alfayate Corchete 8766d604 2020-12-21T17:29:24 [Video/KMSDRM] Fix potetial access to freed structure and complete errorchecks.
Manuel Alfayate Corchete b06ef3a1 2020-12-21T01:53:11 [Video/KMSDRM] Manually re-show the cursor on window creation, if needed.