src/video


Log

Author Commit Date CI Message
Sam Lantinga 35322ed8 2018-02-01T15:46:51 Fixed building on tvOS
Sam Lantinga 85c34e9a 2018-02-01T15:21:01 Added SDL_HINT_IOS_HIDE_HOME_INDICATOR to determine how the home indicator on the iPhone X is handled. This variable can be set to the following values: "0" - The indicator bar is not hidden (default for windowed applications) "1" - The indicator bar is hidden and is shown when the screen is touched (useful for movie playback applications) "2" - The indicator bar is dim and the first swipe makes it visible and the second swipe performs the "home" action (default for fullscreen applications)
Sam Lantinga 90e72bf4 2018-01-30T18:08:34 Fixed ISO C99 compatibility SDL now builds with gcc 7.2 with the following command line options: -Wall -pedantic-errors -Wno-deprecated-declarations -Wno-overlength-strings --std=c99
Sam Lantinga 2d7420f2 2018-01-25T11:12:20 Fixed bug 3985 - SDL_CreateWindow() has stopped changing screen mode when SDL_WINDOW_FULLSCREEN is used Anthony This worked in 2.0.5 as normal, but stopped working in 2.0.7. The monitor's resolution doesn't change, a window is created in full screen mode at the virtual desktop resolution instead.
Sam Lantinga 9338a619 2018-01-17T17:24:15 Added a hint SDL_HINT_APPLE_TV_REMOTE_SWIPES_AS_ARROW_KEYS to prevent turning Apple TV remote swipes into arrow key events
Guillermo A. Amaral 35554caf 2018-01-17T13:17:10 Make rpi video cross-compiler friendly. * Stops using fixed path to find GLES/EGL libs. * Tries pkg-config to locate bcm_host. Signed-off-by: Guillermo A. Amaral <g@maral.me>
Sam Lantinga 509db8af 2018-01-17T13:12:39 Fixed formatting, added actual count to SDL error message
Dawid Gan 61261e59 2018-01-16T21:29:32 EGL: Request sRGB framebuffer in correct place. The EGL_GL_COLORSPACE_KHR is an attribute for eglCreate*Surface. As written in EGL_KHR_gl_colorspace documentation: Accepted as an attribute name by eglCreateWindowSurface, eglCreatePbufferSurface and eglCreatePixmapSurface EGL_GL_COLORSPACE_KHR 0x309D (...)
Sam Lantinga 0cba6847 2018-01-15T10:29:53 Fixed bug 4043 - SDL_windowswindow.c incorrect icon height Needed to allocate space for the mask in the ICONIMAGE structure
John Bartholomew f9bdce61 2018-01-14T13:34:50 Vulkan: Allow SDL_Vulkan_GetInstanceExtensions to be called with a larger array than necessary.
Marius Gripsgard 7cd39b7d 2018-01-13T01:58:11 Mir: Handle close window events
Sam Lantinga a0c4eb2a 2018-01-10T18:00:51 Restored borderless window behavior where DOTA created a borderless window the size of the desktop and expected it to behave like a fullscreen desktop window. A future SDL release will change the borderless window to act more like a normal window that happens to have no chrome, to support windows that draw their own chrome. In the meantime, those applications should set the "SDL_BORDERLESS_WINDOWED_STYLE" hint.
Sam Lantinga 66baf736 2018-01-03T11:31:42 Fixed spacing in copyright headers
Sam Lantinga 7c60bec4 2018-01-03T10:58:58 Fixed bug 4018 - Implement SDL_GetWindowBordersSize() under Windows/Win32/WinAPI Ismael Ferreras Morezuelas (Swyter) As a new year gift I have implemented the Windows version of SDL_GetWindowBordersSize(). I needed it for auto-selecting a cozy window size for the game I'm currently working on and noticed that it only worked under X11, so I thought it could be a good excuse to contribute back more stuff. The Mercurial patch is attached as a .diff file. Let me know what you think. Happy 2018 to all the SDL2 devs and users! -- PS: Keep in mind that Windows 10 includes the 8px invisible grip borders as part of the frame. There's a way of detecting if Aero/DWM is being used and ask only for the visible rect, but I believe that GetWindowRect() is doing that for a reason and working as intended, so I haven't changed it. (See [2]) References: [1]: http://www.firststeps.ru/mfc/winapi/r.php?72 [2]: https://stackoverflow.com/a/34143777/674685 [3]: https://stackoverflow.com/a/431548/674685 [4]: https://wiki.libsdl.org/SDL_GetWindowBordersSize
Sam Lantinga 8111a632 2018-01-03T10:49:26 Fixed bug 4013 - Wayland: fix videoquit on multimonitor system Vladimir On multimonitor system Wayland_VideoQuit invalid deiniting. Tested in Centos7 + Weston
Sam Lantinga 1fa4bcca 2018-01-03T10:43:01 Fixed bug 4012 - Wayland: invalid direction on mouse wheel Vladimir Invalid direction on mouse wheel Patch tested in Centos 7 + Weston
Sam Lantinga 6bc38737 2018-01-03T10:07:27 Fixed bug 4011 - Wayland: fix free cursor Vladimir Sometimes SDL application crashes on cursor free. Patch tested under Centos 7 + weston
Sam Lantinga e3cc5b2c 2018-01-03T10:03:25 Updated copyright for 2018
Alex Szpakowski f9cd7650 2018-01-02T21:44:28 metal and moltenvk: fix highdpi.
Ryan C. Gordon 7c667a6f 2018-01-01T19:16:51 windows: Remove references to GetVersionExA (thanks, Andrew Pilley!). "GetVersionExA is deprecated in windows 8.1 and above's SDK, causing a warning when building against the win10 SDK. Attached patch cleans up the usage for a warning-free build. GetVersionExA was being used to test to see if SDL was running on win9x or winnt. A quick chat with Ryan on twitter suggested that SDL doesn't officially support win9x anymore, so the call to this can be outright removed. As an aside, replacing the call to GetVersionExA with VerifyVersionInfoA (the recommended path) would have been pointless, as VerifyVersionInfoA only supports VER_PLATFORM_WIN32_NT and doesn't officially support any other value for dwPlatformId currently. (And it's probable that win9x SDKs didn't have VerifyVersionInfo* in them anyway.)" Fixes Bugzilla #4019.
Alex Szpakowski 48fea0ce 2017-12-31T15:21:25 macOS: Fix MoltenVK Metal view resizing, and allow the metal view to be used without vulkan.
Alex Szpakowski 64ec4c33 2017-12-29T22:13:40 macOS: Make sure the desktop's display mode is always in SDL's list of display modes.
Sam Lantinga b7be5bce 2017-12-19T11:17:37 Fixed bug 4000 - SDL2 on raspberry: mouse displayed at 0,0 after SDL_ShowCursor Laurent Merckx I have a problem with the SDL_ShowCursor method on Raspberry. Depending on the context, my application hides or show the mouse cursor with SDL_ShowCursor. But when calling SDL_ShowCursor(true), the cursor is displayed at 0,0 (and not at last position). After debugging sources by myself, it seems that the problem is in SDL_rpimouse.c - RPI_ShowCursor: vc_dispmanx_rect_set( &dst_rect, 0, 0, curdata->w, curdata->h); should be vc_dispmanx_rect_set( &dst_rect, mouse->x, mouse->y, curdata->w, curdata->h); For me, it solves the problem.
Sam Lantinga b92e2f02 2017-12-19T10:57:21 Fixed bug 4004 - iOS: don't hide keyboard on RETURN Dominik Reichardt As discussed in 2012 the iOS onscreen keyboard hides when you hit RETURN (see https://discourse.libsdl.org/t/on-screen-keyboard-change/19216). IMO this is a bad idea to not be able to influence this behavior and just recently this was fixed for Android by adding the hint SDL_HINT_ANDROID_RETURN_HIDES_IME in changeset 11768 6ce3bb5e38a5.
Sam Lantinga 18577a70 2017-12-12T16:37:23 Fixed bug 3992 - SDL_GetColorKey doesn't set error message Luke A. Guest SDL_GetColorKey does not set an error message on failure. The current source just returns -1. The documentation https://wiki.libsdl.org/SDL_GetColorKey?highlight=%28%5CbCategoryAPI%5Cb%29%7C%28SDLFunctionTemplate%29 says to call SDL_GetError but that is useless in this case.
Sam Lantinga 1b16618b 2017-12-11T11:47:52 Fixed Windows gcc build
Sam Lantinga ab06f570 2017-12-10T09:17:33 Workaround for bug 3931 - spurious SDL_MOUSEMOTION events with SDL_HINT_MOUSE_RELATIVE_MODE_WARP 1 since Windows 10 Fall Creators update Elis?e Maurer The attached minimal program sets the SDL_HINT_MOUSE_RELATIVE_MODE_WARP to 1, enables relative mouse mode then logs all SDL_MOUSEMOTION xrel values as they happen. When moving the mouse exclusively to the right: * On a Windows 10 installation before Fall Creators update (for instance, Version 10.0.15063 Build 15063), only positive values are reported, as expected * On a Windows 10 installation after Fall Creators update (for instance, Version 10.0.16299 Update 16299), a mix of positive and negative values are reported. 3 different people have reproduced this bug and have confirmed it started to happen after the Fall Creators update was installed. It happens with SDL 2.0.7 as well as latest default branch as of today. It seems like some obscure (maybe unintended) Windows behavior change? Haven't been able to pin it down more yet. (To force-upgrade a Windows installation to the Fall Creators update, you can use the update assistant at https://www.microsoft.com/en-us/software-download/windows10) Eric Wasylishen Broken GetCursorPos / SetCursorPos based games on Win 10 fall creators are not limited to SDL.. I just tested winquake.exe (original 1997 exe) and it now has "jumps" in the mouse input if you try to look around in a circle. It uses GetCursorPos/SetCursorPos by default. Switching WinQuake to use directinput (-dinput flag) seems to get rid of the jumps. Daniel Gibson A friend tested on Win10 1607 (which is before the Fall Creators Update) and the the bug doesn't occur there, so the regression that SetCursorPos() doesn't reliably generate mouse events was indeed introduced with that update. I even reproduced it in a minimal WinAPI-only application (https://gist.github.com/DanielGibson/b5b033c67b9137f0280af9fc53352c68), the weird thing is that if you don't do anything each "frame" (i.e. the mainloop only polls the events and does nothing else), there are a lot of mouse events with the coordinates you passed to SetCursorPos(), but when sleeping for 10ms in each iteration of the mainloop, those events basically don't happen anymore. Which is bad, because in games the each iteration of the mainloop usually takes 16ms.. I have a patch now that I find acceptable. It checks for the windows version with RtlGetVersion() (https://msdn.microsoft.com/en-us/library/windows/hardware/ff561910.aspx) and only if it's >= Win10 build 16299, enables the workaround. All code is in video/windows/SDL_windowsevents.c and the workaround is, that for each WM_MOUSEMOVE event, "if(isWin10FCUorNewer && mouseID != SDL_TOUCH_MOUSEID && mouse->relative_mode_warp)", an addition mouse move event is generated with the coordinates of the center of the screen (SDL_SendMouseMotion(data->window, mouseID, 0, center_x, center_y);) - which is exactly what would happen if windows generated those reliably itself. This will cause SDL_PrivateSendMouseMotion() to set mouse->last_x = center_x; and mouse->last_y = center_y; so the next mouse relative mouse event will be calculated correctly. If Microsoft ever fixes this bug, the IsWin10FCUorNewer() function would have to be adjusted to also check for a maximum version, so the workaround is then disabled again.
Sam Lantinga 127841f3 2017-12-08T11:33:27 Fixed compiler warning
Sam Lantinga ba9c336e 2017-12-07T17:47:01 Fixed building for simulators or older iOS SDKs
Sam Lantinga 6deb1e75 2017-12-07T17:12:03 Fixed compiling Metal renderer on iOS
Sam Lantinga cadf3e44 2017-12-07T09:35:28 The Metal view is a full SDL_uikitview to support multi-touch
Ryan C. Gordon ef6e629d 2017-12-06T16:37:55 cocoa: Added two missing files from hg changeset da7ba330ec68. Fixes Bugzilla #3975.
Sam Lantinga 47506fe1 2017-12-04T20:37:01 Fixed bug 3974 - Fix SDL_WarpMouseInWindow on both KMSDRM and RaspberryPi drivers Manuel Alfayate Corchete This patch fixes SDL_WarpMouseInWindow() in both the KMSDRM and Raspberry Pi graphic backends.
Sam Lantinga 57ebc727 2017-12-04T20:35:01 Fixed bug 3975 - Add GLES2 support for macOS via ANGLE library Andrey Seems latest google angle library successfully built & tested under macOS'es. https://github.com/google/angle We need to use GLES2 to implement true cross-platform code.
Sam Lantinga 14452e95 2017-12-04T20:21:52 Fixed typos (thanks Martin!)
Sam Lantinga 67950e10 2017-12-03T20:27:08 Fixed name of eglCreatePbufferSurface function
Sam Lantinga e943d1ce 2017-12-03T20:25:55 Fixed bug 3945 - Add eglCreatePbufferSurface function tomwardio Proposed patch loads eglCreatePbufferSurface in same manner as other 1.1 functors. This allows custom video drivers to create pbuffer surfaces.
Sam Lantinga 25df5a5a 2017-11-28T18:31:18 Non-resizable windows need to have their window rect set to the client rect
Sam Lantinga 8758b7bf 2017-11-24T12:03:28 Fixed bug 3980 - Fix for KMSDRM driver where cursor would not be shown on some gfx hardware because of unsupported cursor size Manuel Alfayate Corchete This fixes a problem with KMSDRM on some graphics hardware where only bigger cursor sizes are supported, such as current Intel gfx. (The kernel-side driver is what limits this: had to look for failing IOCTLs...) That caused SDL_SetCursor() to fail silently, and we were left with a missing cursor without further explanation. With this patch, different "standard" sizes are tried and a bigger one is used (with an intermediate and clean buffer only used to write the new cursor to the BO where it will live after) if we get, let's say, 16x16 which is pretty common but our hardware does not support that.
Sam Lantinga f776997a 2017-11-21T21:58:27 Fixed some compiler warnings
Sam Lantinga 1c0c9032 2017-11-21T21:30:47 Fixed bug 3976 - SDL drivers may leak driverdata memory due to ignoring return value of SDL_AddDisplayMode C Snover SDL_AddDisplayMode returns an SDL_bool corresponding to whether or not the given display mode was added or not. It will return SDL_FALSE if a matching display mode already exists in the display's list of display modes, which causes ownership of the mode driverdata to remain with the caller. Some video drivers ignore the return value of SDL_AddDisplayMode, so leak the driverdata memory when SDL_AddDisplayMode returns SDL_FALSE.
Sam Lantinga 3ac8adba 2017-11-20T00:06:37 Fixed bug 3973 - Include of stdint is needed to build on linux, mingw and possibly android Stuart Axon https://discourse.libsdl.org/t/stdint-h-removed/23426 https://discourse.libsdl.org/t/debuild-fails-to-build-the-last-few-days/23429/4 Currently SDL2 is not building in Linux (x86 and ARM), Android and MingW because include stdint.h has been removed from yuv_rgb.h
Sam Lantinga 8fb3885c 2017-11-17T11:03:02 Fixed bug 3964 - YUV to RGB in video/SDL_yuv.c is broken for any output format of type ABGR8888 or BGR888 raist66676 Here is the bug in latest SDL 2.0.8 development repo. It is obvious and simple to fix by correcting typos on six lines of code. In src/video/SDL_yuv.c on lines 217, 249, 280, 321, 353, and 384 the wrong conversion functions are called for SDL_PIXELFORMAT_ABGR8888 and SDL_PIXELFORMAT_BGR888. Instead of ABGR functions, BGRA functions are called. These are typos.
Sam Lantinga cd89efb8 2017-11-17T10:55:58 Fixed building yuv_rgb.h when stdint.h isn't available (thanks Ozkan!)
Sam Lantinga a6a4e27a 2017-11-12T22:51:12 Updated SDL's YUV support, many thanks to Adrien Descamps New functions get and set the YUV colorspace conversion mode: SDL_SetYUVConversionMode() SDL_GetYUVConversionMode() SDL_GetYUVConversionModeForResolution() SDL_ConvertPixels() converts between all supported RGB and YUV formats, with SSE acceleration for converting from planar YUV formats (YV12, NV12, etc) to common RGB/RGBA formats. Added a new test program, testyuv, to verify correctness and speed of YUV conversion functionality.
Alex Szpakowski 5501bcc8 2017-11-09T22:24:09 macOS: Fix an OS-generated warning printed to stdout on launch in bundled apps.
Sam Lantinga fcb77f98 2017-11-08T14:17:23 Back out the following commits which are causing Dota 2 Exclusive Fullscreen to fail on AMD-based Macs. The details of why this is being reverted are at: https://bugzilla.libsdl.org/show_bug.cgi?id=3949 Alex Szpakowski <slime73@gmail.com> 2017-07-12 21:28 -0300 macOS: Expose more display modes on retina screens. Fixes an issue found in BZFlag. http://hg.libsdl.org/SDL/rev/cfb3ddf796c3 Alex Szpakowski <slime73@gmail.com> 2017-07-12 21:32 -0300 Fix a potential crash in macOS 10.7 and earlier. http://hg.libsdl.org/SDL/rev/4941c8867075
Brandon Schaefer 9f4e4be8 2017-11-07T09:10:32 Fixed bug 3943 - General SDL_HINT_VIDEO_DOUBLE_BUFFER hint support
Sam Lantinga c5429bd9 2017-11-04T22:06:40 Fixed bug 3939 - Remove static vm_error and vm_event from SDL_x11modes.c tomwardio Remove static int vm_error and vm_event, use local variables instead. This fixes unused variable errors when compiling with SDL_VIDEO_DRIVER_X11_XINERAMA undefined. src/video/x11/SDL_x11modes.c:505:22: error: unused variable 'vm_error' [-Werror,-Wunused-variable] src/video/x11/SDL_x11modes.c:505:12: error: unused variable 'vm_event' [-Werror,-Wunused-variable]
Sam Lantinga 7334a2a1 2017-11-04T09:07:33 Fixed bug 3940 - Add support for EGL_SURFACE_TYPE tomwardio Add support to be able to set EGL_SURFACE_TYPE bits when creating an EGL config. This is usefule when wanting to create pixel buffer surfaces in custom video drivers.
Conn O'Griofa bf3e363d 2017-11-04T09:04:19 Raspberry Pi: fix ES 1/PVR support & autodetect Mesa driver * The brcmGLESv2 vendor library also supports ES PVR/1 profiles * Fallback to standard Mesa libraries if the VC4 driver is loaded
Conn O'Griofa 547448df 2017-11-04T09:03:20 SDL_video: try to bootstrap KMSDRM before RPI video driver Allow better coexistence between RPI's vendor libraries and VC4 mesa driver.
Johannes Bader 17243133 2017-11-04T11:16:49 Emscripten: use cursor hotspot the cursor's hotspot simply wasn't translated to it's CSS equivalent, yet see https://developer.mozilla.org/en-US/docs/Web/CSS/cursor?v=example#Syntax. no explicit hotspot if (0|0) for compatibility with Edge and IE, which indeed don't support custom hot spots
Sam Lantinga 4478707b 2017-10-31T13:49:59 Add SDL_GetDisplayDPI implementation on Android. (thanks Rachel!)
Brandon Schaefer 2ac567b7 2017-10-26T16:37:20 Fixed bug 3902 - Add a specific KMSDRM hint for low latency video
Ryan C. Gordon 9bbf92e3 2017-10-25T18:02:11 cocoa: Don't change the NSWindow background color. Changing the background color causes the titlebar to blend against it on modern macOS releases, making all SDL windows look wrong by default. This was set to make the window not flash white before a GL context is ready, but we can accomplish this in our window's view's drawRect implementation, too.
Sven Hesse b89cac67 2017-10-22T20:24:58 Don't X error in SDL_CreateWindow with unsupported GL attributes
Sam Lantinga 10376eb9 2017-10-21T04:20:57 Fixed bug 3901 - Fix vsync-ed pageflips on the KMSDRM video driver Manuel I noticed that, at least on Intel GPU hardware, passing SDL_RENDERER_PRESENTVSYNC would result on a static console instead of the program graphics. That was due to the fact that calling drmModePageFlip() only works if we have previously set up CRTC to one of the GBM buffers with a drmModeSetCrtc() call, so now it's done and things work as expected. The KMSDRM_GLES_SetupCrtc() call is done only one time, only when needed (when egl_swapinterval is not 0: when it's 0, there's no need for it because we flip by calling drmModePageFlip() anyway). The place where KMSDRM_GLES_SetupCrtc() call is done may look strange, but it's right: it needs EGL completely ready because it needs to call eglSwapBuffers() internally to work (see more comments about it in the code).
Sam Lantinga e4ef1885 2017-10-16T14:57:42 Fixed bug 3890 - Incomplete fix for CVE-2017-2888 Felix Geyer http://hg.libsdl.org/SDL/rev/a31ee4d64ff6 tries to fix CVE-2017-2888. Unfortunately compilers may optimize the second condition "(size / surface->pitch) != surface->h" away. See https://bugzilla.redhat.com/show_bug.cgi?id=1500623#c2 I've verified that this is also the case on Debian unstable (gcc 7.2).
Sam Lantinga f4f9e39f 2017-10-12T08:41:11 Fixed bug 3874 - Compiler warnings SDL_Surface.c and SDL_cocoakeyboard.m
Sam Lantinga 5bed4ca9 2017-10-12T08:27:22 Fixed divide by zero with a 1x1 sized window
Sam Lantinga c0019b7f 2017-10-11T13:31:21 Fixed bug 3871 - Touch events are not normalised on X11 Trent Gamblin The documentation for SDL_TouchFingerEvent says that the x and y coordinates are normalised between 0-1. I've found that to be true on Windows, Android and iOS but on X11 they are in pixel coordinates. This patch fixes the issue. This was the cleanest way I could do it with what was available without changing things around a lot but you may know a better way.
Sam Lantinga d2a2b0c1 2017-10-07T15:26:55 Fixed bug 3857 - SDL_ConvertPixels misses YUV conversions Sylvain There are various YUV-RGB conversion coefficients, according to https://www.fourcc.org/fccyvrgb.php I choose the first (from Video Demystified, with integer multiplication), but the current SDL2 Dither functions use in fact the next one, which follows a specifications called CCIR 601. Here's a patch to use the second ones and with previous warning corrections. There are less multiplications involved because Chroma coefficient is 1. Also, doing float multiplication is as efficient with vectorization. In the end, the YUV decoding is faster: ~165 ms vs my previous 195 ms. Moreover, if SDL2 is compiled with -march=native, then YUV decoding time drops to ~130ms, while older ones remains around ~220 ms. For information, from jpeg-9 source code: jpeg-9/jccolor.c * YCbCr is defined per CCIR 601-1, except that Cb and Cr are * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5. * The conversion equations to be implemented are therefore * Y = 0.29900 * R + 0.58700 * G + 0.11400 * B * Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + CENTERJSAMPLE * Cr = 0.50000 * R - 0.41869 * G - 0.08131 * B + CENTERJSAMPLE jpeg-9/jdcolor.c * YCbCr is defined per CCIR 601-1, except that Cb and Cr are * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5. * The conversion equations to be implemented are therefore * * R = Y + 1.40200 * Cr * G = Y - 0.34414 * Cb - 0.71414 * Cr * B = Y + 1.77200 * Cb
Sam Lantinga 1bfe6d60 2017-10-06T21:43:59 Fixed restoring window size when coming out of fullscreen desktop mode. Use the style of the window as it will be, not as it currently is at the time of the AdjustWindowRect call.
Sam Lantinga e9652b19 2017-10-06T16:50:24 Fixed bug 3857 - SDL_ConvertPixels misses YUV conversions Sylvain Few issues with YUV on SDL2 when using odd dimensions, and missing conversions from/back to YUV formats. 1) The big part is that SDL_ConvertPixels() does not convert to/from YUV in most cases. This now works with any format and also with odd dimensions, by adding two internal functions SDL_ConvertPixels_YUV_to_ARGB8888 and SDL_ConvertPixels_ARGB8888_to_YUV (could it be XRGB888 ?). The target format is hard coded to ARGB888 (which is the default in the internal of the software renderer). In case of different YUV conversion, it will do an intermediate conversion to a ARGB8888 buffer. SDL_ConvertPixels_YUV_to_ARGB8888 is somehow redundant with all the "Color*Dither*Mod*". But it allows some completeness of SDL_ConvertPixels to handle all YUV format. It also works with odd dimensions. Moreover, I did some benchmark(SDL_ConvertPixel vs Color32DitherYV12Mod1X and Color32DitherYUY2Mod1X). gcc-6.3 and clang-4.0. gcc performs better than clang. And, with gcc, SDL_ConvertPixels() performs better (20%) than the two C function Color32Dither*(). For instance, to convert 10 times a 3888x2592 image, it takes ~195 ms with SDL_ConvertPixels and ~235 ms with Color32Dither*(). Especially because of gcc vectorize feature that optimises all conversion loops (-ftree-loop-vectorize). Nb: I put no image pitch for the YUV buffers. because it complexify a little bit the code and the API : There would be some ambiguity when setting the pitch exactly to image width: would it a be pitch of image width (for luma and chroma). or just contiguous data ? (could set pitch=0 for the later). 2) Small issues with odd dimensions: If width "w" is odd, luma plane width is still "w" whereas chroma planes will be "(w + 1)/2". Almost the same for odd h. Solution is to strategically substitute "w" by "(w+1)/2" at the good places ... - In the repository, SDL_ConvertPixels() handles YUV only if yuv source format is exactly the same as YUV destination format. It basically does a memcpy of pixels, but it's done incorrectly when width or height is odd (wrong size of chroma planes). This is fixed. - SDL Renderers don't support odd width/height for YUV textures. This is fixed for software, opengl, opengles2. (opengles 1 does not support it and fallback to software rendering). This is *not* fixed for D3D and D3D11 ... (and others, psp ?) Only *two* Dither function are fixed ... not sure if others are really used. - This is not possible to create a NV12/NV12 texture with the software renderer, whereas other renderers allow it. This is fixed, by using SDL_ConvertPixels underneath. - It was not possible to SDL_UpdateTexture() of format NV12/NV21 with the software renderer. this is fixed. Here's also two testcases: - that do all combination of conversion. - to test partial UpdateTexture
Sam Lantinga d9e1036e 2017-10-06T16:17:50 Fixed potential overflow in surface allocation (thanks Yves!)
Brandon Schaefer db20e71d 2017-10-02T10:50:33 Fixed bug 3855 - Memory leak in SDL_FreeSurface
Brandon Schaefer e564da78 2017-09-29T10:15:44 revert files I didnt mean to commit!
Brandon Schaefer e27f12e0 2017-09-29T10:07:37 wayland: Fix bug 3814 -Wmissing-field-initializers
Sam Lantinga aad58c62 2017-09-29T07:44:30 Fixed bug 3852 - SDL_FreeSurface deallocates surface->map even if the surface is not yet freed Evgeny Kapun Commit 490bb5b49f11 [1], which was a fix for bug #3790, introduced a new bug: now, calling SDL_FreeSurface(surface) deallocates surface->map even if there are other references to the surface. This is bad, because some functions (such as SDL_ConvertSurface) assume that surface->map is not NULL.
Sam Lantinga 54685787 2017-09-26T15:07:35 Fixed bug 3847 - Hit Test x coordinate wrong on secondary monitor Robert Turner SDL_windowsevents.c contains code to retrieve the x and y coordinate for a requested hit test. It does this as follows: POINT winpoint = { (int) LOWORD(lParam), (int) HIWORD(lParam) }; LOWORD(lParam) does not correctly mask off high bits that are set if the point is on a second (or third, etc.) monitor. This effectively offsets the x-coordinate by a large value. MSDN documentation suggests that LOWORD() and HIWORD() are the wrong macros for the task, instead suggesting we should be doing something like the following: POINT winpoint = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) }; Testing this change on my Windows 10 machine with 2 monitors gives the correct results.
Alex Szpakowski fb071a4c 2017-09-25T20:49:31 Mac: Fix the menu bar not always working for non-.app-bundled apps. Fixes bug #3051.
Sam Lantinga 58d1c54d 2017-09-22T17:32:05 Fixed spacing
Sam Lantinga ad86eff1 2017-09-22T08:30:37 Guarded EGL code with SDL_VIDEO_OPENGL_EGL
Sam Lantinga 499f928c 2017-09-22T07:15:41 borderless windows will have WM_NCCALCSIZE return 0 for the non-client area. When this happens, it looks like windows will send a resize message expanding the window client area to the previous window + chrome size, so shouldn't need to adjust the window size for the set styles.
Sam Lantinga 3176a7f5 2017-09-22T07:11:36 sdl - Fixing rendering borderless window. Need to force windows to send a WM_NCCALCSIZE then return 0 for non-client area size. - Adding WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX to borderless windows, for reasons noted in comments. - Fix SetupWindowData() setting SDL_WINDOW_BORDERLESS. This was being cleared at window creation, causing hanlding for the first WM_NCCALCSIZE message to fail
Mark Callow 59d17bde 2017-09-22T22:30:02 Avoid hitting ERR_MAX_STRLEN limit.
Brandon Schaefer 466ba57d 2017-09-21T18:38:07 [egl/mir] Need eglGetProc to find gl 4.5 core profile extensions
Alex Szpakowski e5cfb58f 2017-09-21T20:30:25 iOS MoltenVK code style cleanup.
Mark Callow 3c45e662 2017-09-21T14:01:12 macOS: remove unneeded #includes.
Sam Lantinga f0a324f8 2017-09-20T19:59:34 Reverted Alex's commit 131cba1768a5 - we're about to release 2.0.6, don't remove support for the iOS 7 SDK yet.
Alex Szpakowski d452b89f 2017-09-20T11:01:32 iOS: I don't think SDL compiles with the iOS 7 SDK anymore, so we might as well drop the #ifdefs trying to guard for that.
Alex Szpakowski 12fb004f 2017-09-20T10:53:41 iOS: remove an unused static variable
Sam Lantinga cfe72c76 2017-09-14T09:55:27 Fixed iOS keyboard positioning, based on the final position rather than the initial one
Ryan C. Gordon 76176486 2017-09-14T08:37:27 surface: Make sure SDL_ConvertSurface() deals with palettes (thanks, Sylvain!). Fixes Bugzilla #3826. Fixes Bugzilla #2979.
Sam Lantinga 5f48ce0b 2017-09-10T12:49:41 Fixed bug 3815 - implicit-fallthrough warning - DUFFS_LOOP4 and friends
Sam Lantinga 19114b03 2017-09-10T12:42:38 Fixed bug 3813 - gcc7 fallthrough warnings in SDL_iconv.c and SDL_pixels.c
Sam Lantinga 849c4c14 2017-09-10T12:40:45 Fixed tabs to spaces
Sam Lantinga b2ba8963 2017-09-09T11:00:25 Fixed bug 3809 - Restore after maximize leads to wrong size Andreas Falkenhahn My app opens a 640x480 window. When I click on the window's maximize button, the window correctly fills the entire screen and loses its borders. But clicking on the restore button now doesn't restore the window to its original 640x480 size. Instead, the window size is identical to the screen size now. The only difference to the previous state is that the window now has borders again but it isn't restored to 640x480.
Sam Lantinga 676c3a92 2017-09-09T10:31:44 Fixed bug 3719 - Cocoa - Incorrect window size when leaving fullscreen bastien.bouclet The window is now resized to its specified size, but it moves to the top left corner of the screen. That is unexpected because neither the user nor the program moved it there. Test program attached (the same one as before).
Sam Lantinga fcd9c190 2017-09-09T09:31:12 Fixed window size when leaving fullscreen mode (thanks Eric!)
Sam Lantinga 9a73909b 2017-09-09T08:20:56 Fixed bug 3808 - fix a typo in SDL_stretch.c Ozkan Sezer The following patch fixes a minor _MSC_VER typo in SDL_stretch.c, and also does a tiny tidy-up for assembly opcodes cpp checks.
Sam Lantinga 222d25ad 2017-09-08T22:21:01 Fixed bug 3805 - Why is there no --enable-video-rpi option in configure? Andreas Falkenhahn When compiling SDL for the Raspberry Pi, I have to use the --host parameter to enable compilation of the native Raspberry Pi video driver, like so: --host=arm-raspberry-linux-gnueabihf It took me a while to figure out that this was necessary in order to have the native Raspberry Pi video driver compiled in. I think it would be better if there was an option like --enable-video-rpi that could be passed to configure and that would also show up when saying configure --help. Currently, it?s rather difficult to figure out that you have to use the --host parameter with arm-raspberry-linux-gnueabihf in order to get Raspberry Pi video support. It?s also somewhat inconsistent because most other video drivers can in fact be enabled/disabled through specific configure parameters but there is no such parameter for the native Raspberry Pi video driver.
Sam Lantinga e8059221 2017-09-08T18:26:25 Fixed bug 3806 - Fixes for MSVC compiler warnings Simon Hug These are the remaining compiler warnings I see in the current tip cb049cae7c3c. - SDL_test_log.c defines _CRT_SECURE_NO_WARNINGS without checking if it was already set. - SDL_windowskeyboard.c converts integers to pointers without going over the (U)INT_PTR types. That bothers MSVC.
Ryan C. Gordon 0c892abc 2017-09-06T19:34:23 raspberrypi: The latest Raspbian moved its EGL and GLES2 libs elsewhere. Now we try the new (hardware-specific) pathnames first, and if those fail to load, we'll try the more generic names that earlier versions of Raspbian used. Fixes Bugzilla #3800.
Sam Lantinga fa0eeff7 2017-09-06T07:29:34 sdl: Cleans up AdjustWindowEx calls
Sam Lantinga 20c5bc91 2017-09-06T05:23:26 You can have a borderless resizable window
Sam Lantinga 4ca5d862 2017-09-06T04:32:30 Fixed bug 3780 - GCC 7 implicit fallthrough warnings Martin Gerhardy 2017-08-28 06:58:01 UTC SDL_blit.h, SDL_fillrect.c and SDL_stdinc.h produces a lot of the (new) gcc-7 implicit fallthrough warnings.
Sam Lantinga c8e3e0c4 2017-09-06T01:10:10 Fixed bug 3799 - SDL_CreateWindow fails with SDL_WINDOW_VULKAN (libvulkan.so.1 not found) Manuel Sabogal Android NDK defines Vulkan as libvulkan.so, not libvulkan.so.1. This is causing the program to not being able to create a window using SDL_WINDOW_VULKAN. To fix this issue just change the line http://hg.libsdl.org/SDL/file/bbaec41e93b5/src/video/android/SDL_androidvulkan.c#l53 from "libvulkan.so.1" to "libvulkan.so"
Ryan C. Gordon c9e73c3e 2017-09-05T16:15:54 x11: make sure SDL_GetGlobalMouseState notices mouse warping through SDL APIs.