src/video


Log

Author Commit Date CI Message
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.
Ozkan Sezer 4198f0e5 2020-12-21T01:20:30 fix uninitialized warnings in KMSDRM_CreateCursor()
Manuel Alfayate Corchete a8dbcab1 2020-12-20T21:48:05 [Video/KMSDRM] Don't copy the cursor bitmap to the cursor GBM BO until we're showing it.
Manuel Alfayate Corchete 2756b0f3 2020-12-20T14:29:58 [Video/KMSDRM] Init and deinit mouse stuff at the same time that GBM stuff.
Manuel Alfayate Corchete cf71e017 2020-12-19T23:32:09 [Video/KMSDRM] Remove auxiliary AMDGPU compatibility workarounds not needed anymore.
Manuel Alfayate Corchete af1f91cb 2020-12-19T20:21:07 [Video/KMSDRM] Correct typo.
Manuel Alfayate Corchete cf489556 2020-12-19T20:15:50 [Video/KMSDRM] Honor the device index in Vulkan. Add notes about the display index.
Manuel Alfayate Corchete ab3a390e 2020-12-19T17:35:04 [Video/KMSDRM] Better ATOMIC caps testing: patch by Oskan Sezer.
Manuel Alfayate Corchete 436499f3 2020-12-19T02:08:59 [Video/KMSDRM] Comment out some debug info, adjust comments for future work.
Ozkan Sezer 6b81cac4 2020-12-19T01:25:50 remove duplicated SDL_SetError after calling check_atomic_modesetting()
Manuel Alfayate Corchete 8952a613 2020-12-18T23:17:42 [Video/KMSDRM] Re-arrange display members setup.
Manuel Alfayate Corchete f60f8d5d 2020-12-18T22:53:51 [Video/KMSDRM]: Add Vulkan support to the KMSDRM backend.
Ozkan Sezer 6ac0b23d 2020-12-18T21:37:20 SDL_DirectFB_video.c: DSPF_ABGR requires directfb >= 1.5.0 -- add guard.
Ozkan Sezer 6c4ab484 2020-12-18T17:50:02 SDL_kmsdrmvideo.c: check atomic modesetting in check_modesetting() .. so that KMSDRM_CreateDevice() can fail and SDL_VideoInit() would move on to next bootstrap member which is kmsdrm_legacy. hopefully fixes bug #5393.
Ozkan Sezer 10625f9d 2020-12-17T23:50:00 SDL_windowsmessagebox.c: go back to hg rev 14458 state. encountering a NULL caption in AddDialogString() is intended, i.e. AddDialogStaticIcon() sends it as NULL on purpose.
Ozkan Sezer 4d6eb305 2020-12-17T23:28:20 SDL_windowsmessagebox.c (AddDialogControl): add back NULL caption check. because AddDialogStaticIcon() sends a NULL caption -- fixes bug #5401.
Ozkan Sezer 90456670 2020-12-17T14:11:00 more "'for' loop initial declarations are only allowed in C99 mode" fixes
Ozkan Sezer ed4fcb2c 2020-12-16T03:24:10 kmsdrm_legacy build fixes: - add missing '_LEGACY' to symbol names - perform missing 2.0.14 portage - fix 'for' loop initial declarations are only allowed in C99 mode errors
Ozkan Sezer 9940e710 2020-12-16T00:10:30 Import two post-2.0.12 fixes to kmsdrm_legacy: Fix build breakage without EGL: https://hg.libsdl.org/SDL/rev/f2606fe53654e305ab9badb821d9d3afb7f92f49 Fix KMSDRM_CreateWindow segfault when starting L?VE2D engine (bug 5199) https://hg.libsdl.org/SDL/rev/d2e69a78939463d9ff9448a5f4efd1e208bb97b0
Sam Lantinga f8839289 2020-12-15T12:22:48 Potential fix for bug 5393 - KMSDRM: using atomic mode setting breaks GPU compatibility Substring I was trying the KMSDRM video backend with some very simple programs that were working ok on 2.0.12. The same code won?t work on the current dev branch and I get: DEBUG: check_modesetting: probing ?/dev/dri/card0? DEBUG: /dev/dri/card0 connector, encoder and CRTC counts are: 4 5 6 DEBUG: check_modesetting: probing ?/dev/dri/card0? DEBUG: /dev/dri/card0 connector, encoder and CRTC counts are: 4 5 6 DEBUG: KMSDRM_VideoInit() DEBUG: Opening device /dev/dri/card0 DEBUG: Opened DRM FD (3) DEBUG: no atomic modesetting support. DEBUG: Video subsystem has not been initialized INFO: Using SDL video driver: (null) DEBUG: Video subsystem has not been initialized After carefully checking, the radeon driver doesn?t support atomic modesetting. That?s not the only problem : the same happens with the amdgpu driver if we disable Display Core (kernel parameter amdgpu.dc=0, which is required to get analogue outputs working). This is a major regression in the KMSDRM driver. Using atomic mode setting is great, but having no fallback to the "standard KMS" is bad.
Sam Lantinga ee85a41a 2020-12-13T02:10:46 Fixed compile warning
Ozkan Sezer 5c212cb0 2020-12-10T12:24:24 remove a few stale NULL message/title checks after commit e2b729b1756a top-level guarantees non-NULL message / title passed in messageboxdata
Ozkan Sezer f1cab8ae 2020-12-10T11:20:56 fix bug #5253: handle NULL title or message fields in SDL_MessageBoxData - SDL_video.c (SDL_ShowMessageBox): replace messageboxdata, set title or message field to "" if either of them is NULL. - SDL_video.c (SDL_ShowSimpleMessageBox): set title or message to "" if either of them is NULL for EMSCRIPTEN builds. - SDL_bmessagebox.cc: add empty string check along with NULL check for title and message fields. - SDL_windowsmessagebox.c (AddDialogString): remove NULL string check - SDL_windowsmessagebox.c (AddDialogControl): add empty string check along with the NULL check. - SDL_x11messagebox.c: revert commit 677c4cd68069 - SDL_os2messagebox.c: revert commit 2c2a489d76e7 - test/testmessage.c: Add NULL title and NULL message tests.
Sam Lantinga d46dd103 2020-12-09T07:49:07 Fixed typo in Vulkan load logic
Sam Lantinga cb361896 2020-12-09T07:16:22 Fixed bug 5235 - All internal sources should include SDL_assert.h Ryan C. Gordon We should really stick this in SDL_internal.h or something so it's always available.
Sam Lantinga 50203d58 2020-12-08T22:00:06 Fixed bug 5329 - SDL_SetWindowGrab(SDL_FALSE) fails to unlock cursor if window is partially offscreen Ivan Mogilko With SDL 2.0.12 under MS Windows, if the window is partially offscreen calling SDL_SetWindowGrab(w, SDL_TRUE) works, but subsequent call to SDL_SetWindowGrab(w, SDL_FALSE) does not work. I tested this in both real program, and a small test app, where unlocking cursor worked perfectly while window is fully in desktop bounds, but did not work if it was at least few pixels outside. For the reference, following code is enough to reproduce the issue: #include <windows.h> #include <SDL.h> int WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) { SDL_Init(SDL_INIT_VIDEO); SDL_Window* w = SDL_CreateWindow("", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640, 400, 0); bool grabbed = false; bool want_quit = false; while (!want_quit) { SDL_Event event; while (SDL_PollEvent(&event)) { switch (event.type) { case SDL_QUIT: want_quit = true; break; case SDL_KEYDOWN: if (event.key.keysym.scancode == SDL_SCANCODE_SPACE) { SDL_SetWindowGrab(w, static_cast<SDL_bool>(!grabbed)); grabbed = !grabbed; } } } } SDL_DestroyWindow(w); SDL_Quit(); return 0; }
Sylvain Becker 035f8f23 2020-12-02T13:37:59 SDL_RecreateWindow: allow clearing VULKAN when recreating the window
Sylvain Becker 93fbab0f 2020-12-02T11:04:53 SDL_ReCreateWindow: allow to unload METAL window and switch back to OpenGL. On older mac, where METAL Renderer METAL fails to create, it allows to switch back to OpenGL SDL_Renderer by re-creating the window (METAL flags was previously persistent).
Sam Lantinga a0c5bfa3 2020-11-27T13:08:40 Moved raw input event processing from the main thread to the joystick thread This allows fast joystick event delivery regardless of what the main thread is doing.
Sylvain Becker 2c079a2f 2020-11-27T09:42:14 SDL_FillRects: prevent empty SDL_surface from raising an error message It's legitimate to have a surface with 0 width or height (null 'pixels' pointer). But calling SDL_FillRects would wrongly set the error "You must lock the surface".
Sam Lantinga 4121ab62 2020-11-23T21:25:07 Fixed bug 5354 - DirectFB: Add Vulkan support Nicolas Caramelli This patch adds Vulkan support for the DirectFB video driver. A screenshot with SDL tests running on DirectFB is available on the HiGFXback project: https://github.com/caramelli/higfxback/wiki/DirectFB#sdl
Ryan C. Gordon 0ff5d55a 2020-11-23T21:07:28 x11: Don't try to grab the pointer on an unmapped window (thanks, Lee!) Fixes Bugzilla #5352.
Ozkan Sezer 082558db 2020-11-20T12:20:02 SDL_os2messagebox.c (_makeDlg): fix crash if title and/or message is NULL. c.f.: bug #5253.
Ryan C. Gordon 335cfa10 2020-11-18T11:24:08 x11: Don't crash if a messagebox has a NULL title string. Fixes Bugzilla #5253.
Ozkan Sezer 53b16679 2020-11-11T12:33:55 SIZE_MAX need not be defined in limits.h it can be in limits.h (windows) or stdint.h.
Ryan C. Gordon 7b5a0a9f 2020-11-10T13:12:10 uikit: Don't implement main() twice for iOS static libs. I think this was a leftover from before the two Xcode projects were merged.
Sam Lantinga 1ef45c18 2020-11-08T23:40:17 Fixed bug 5339 - Minor memory leak in SDL_x11events.c wcodelyokoyt The atom name that X11_GetAtomName() returns never gets freed, which result in a minor memory leak (14 bytes?) every time the user drops a file on a window. You can see the line in question here: https://github.com/spurious/SDL-mirror/blob/6b6170caf69b4189c9a9d14fca96e97f09bbcc41/src/video/x11/SDL_x11events.c#L1350 Fix: call XFree on name after the while loop.
Sam Lantinga 723d76c8 2020-11-08T23:34:59 Fixed bug 5333 - Replace character of legacy code page with utf-8 one. Joel Linn This patch fixes a MSVC warning, which is dependent on the regional settings of the build system. Although the character is inside a comment and harmless, it is undesirable to disable the warning for this.
Ryan C. Gordon de6d0ac5 2020-11-08T18:11:42 uikit: Patched to compile on older iOS SDKs.
Ryan C. Gordon 010d5fba 2020-10-26T09:49:09 kmsdrm: Make this build with significantly older system libraries. This allows one to build Raspberry Pi versions on an ancient version of Raspbian and get both the KMSDRM and RPI video targets built into SDL, giving maximum binary compatibility from linking against an older glibc, etc, but also making one library that can access video on all RPi models and OS releases.
Ozkan Sezer f0c58417 2020-10-25T10:10:10 SDL_shape_internals.h: forward-declare struct SDL_ShapeTree.
Ozkan Sezer bfc80d83 2020-10-25T03:55:02 minor coding style cleanup
Sam Lantinga 5dc6c3c9 2020-10-24T10:46:18 Updated Vulkan headers to version 1.2.158 https://github.com/KhronosGroup/Vulkan-Headers
Manuel Alfayate Corchete 5682b066 2020-10-22T19:51:57 kmsdrm: Add comment about KMSDRM_VideoQuit() changes.
Manuel Alfayate Corchete 63b78277 2020-10-22T19:44:38 kmsdrm: properly exit with an error when ATOMIC interface is not yet available, instead of just segfaulting.
Manuel Alfayate Corchete a3262205 2020-10-22T17:55:45 kmsdrm: rearrange init function so we try ATOMIC compatibility first.
Manuel Alfayate Corchete b1ea0be8 2020-10-22T17:06:34 kmsdrm: Add missing checks after SDL_calloc() calls.
Manuel Alfayate Corchete ad9ec8b3 2020-10-22T16:15:34 kmsdrm: Small fix, missing bracket.
Manuel Alfayate Corchete 87a86675 2020-10-22T16:01:51 kmsdrm: Always use spaces for indentation. Always use SDL_calloc() for calloc.
Ozkan Sezer cfc13620 2020-10-21T23:28:02 os2 video: updates to my_gradd.h
Sam Lantinga f1b603ac 2020-10-20T11:51:23 Fixed bug 5323 - SDL_SetWindowMaximumSize fails if Width or Height is equal to minimum Height or Width batyastudios Basicly there is problem and somewhat a solution: https://discourse.libsdl.org/t/setwindowmaximumsize-bug/28267 If you SDL_SetWindowMaximumSize() after SDL_SetWindowMinimumSize() with one of axes have the same value, function will have no effect. This: (line 2144@SDL_video.c) if (max_w <= window->min_w || max_h <= window->min_h) { SDL_SetError("SDL_SetWindowMaximumSize(): Tried to set maximum size smaller than minimum size"); return; } May be changed to this: if (max_w < window->min_w || max_h < window->min_h) { SDL_SetError("SDL_SetWindowMaximumSize(): Tried to set maximum size smaller than minimum size"); return; }
Sam Lantinga f311e0a8 2020-10-19T17:29:16 Removed debug log message
Alberts Muktup?vels 73010da4 2020-10-19T17:26:33 x11events: ignore UnmapNotify events from XReparentWindow UnmapNotify event does not mean that window has been iconified. It just reports that window changed state from mapped to unmapped. XReparentWindow can unmap and remap window if it was mapped. This causes unnecessary events - HIDDEN, MINIMIZED, RESTORED and SHOW. These events are problematic with Metacity 3.36+ which started to remove window decorations from fullscreen windows. - SDL makes decorated window fullscreen - Metacity removes decorations - SDL gets UnmapNotify and exits from fullscreen - Metacity re-adds decorations As SDL will also get MapNotify event it will try to restore window state causing above steps to repeat. https://bugzilla.libsdl.org/show_bug.cgi?id=5314
Sylvain Becker ffb307e4 2020-10-18T09:52:56 Fixed bug 5304 - add SDL_HasSurfaceRLE() (Thanks Rene Dudfield and Dan Lawrence)
Sylvain Becker 19a65a46 2020-10-17T21:47:05 Fixed bug 5321 - crash in SDL_ConvertSurface with RLE surfaces keep RLE information in flags when converting the surface
Ozkan Sezer c70191d2 2020-10-17T07:37:00 SDL_os2video.c (OS2_CreateDevice): remove duplicated assignment.
Ozkan Sezer 77d0f043 2020-10-16T23:50:00 os2video.c: add missing FOURCC_R666 define, enable FOURCC_R666 case in _getSDLPixelFormatData().
Sam Lantinga 58976bda 2020-10-15T12:00:15 Allow more than one window on iOS as long as they're on different displays
Ozkan Sezer a90f0400 2020-10-15T21:37:30 os2: a _lot_ of coding style cleanup, sot that they match the SDL style. also renamed the 'debug' macro to debug_os2: the former was dangerously a common name. the binary (dll) output is precisely the same as before.