Log

Author Commit Date CI Message
Ryan C. Gordon d8fc70ea 2017-08-24T21:30:53 opengl: add support for GL_KHR_no_error. This is completely untested! Fixes Bugzilla #3721.
Ryan C. Gordon a3890ff6 2017-08-22T15:50:39 dynapi: fill in OS/2 loading code (thanks, Ozkan!). Partially fixes Bugzilla #3765.
Brandon Schaefer 17453d49 2017-08-21T23:44:46 x11: Move screen_w/h inside the only ifdef they are referenced in to avoid compiler warnings
Brandon Schaefer a6dc4ed5 2017-08-21T17:22:00 kmsdrm: Remove moved file
Brandon Schaefer 11717184 2017-08-21T17:20:50 kmsdrm: Cleanup unused headers, rename SDL_kmsdrmevents_c.h -> SDL_kmsdrmevents.h
Sam Lantinga fcf83e79 2017-08-21T16:30:24 Fixed bug 3768 - provide a quick copysign() solution for watcom Ozkan Sezer The following patch provides a quick copysign solution for Watcom/x86
Sam Lantinga 9b3ec6a5 2017-08-21T13:01:22 SDL_thread.h: add missing os/2 defines. (essentially replicates the windows case || SDL1.2 case.)
Sam Lantinga f6ad070b 2017-08-21T13:00:58 SDL_dynapi.h: disable dynapi for os/2.
Sam Lantinga b821ded9 2017-08-21T13:00:40 SDL_cpuinfo.c: add os/2 support to SDL_GetCPUCount() and SDL_GetSystemRAM().
Sam Lantinga f807655b 2017-08-21T11:25:04 Fixed bug 3761 - Windows non-MinGW cmake build defines HAVE_WCSLCPY and HAVE_WCSLCAT Tom Seddon https://github.com/SDL-mirror/SDL/commit/0f0ad62237fabb58d5811fe6fa59e5e5aa0e2fb5 (git head at the time of writing); Visual Studio 2015, toolset v140, Platform 10.0.14393.0, building for x64 Windows non-MinGW cmake build sets defines implying wcslcpy and wcslcat are available, but Windows doesn't have these functions. Ryan C. Gordon That's weird, these are the exact two functions that Emscripten incorrectly believed it had until we upgraded the buildbot's emsdk install. Not sure what's up with this, but it's possibly not a MingW-specific thing!
Sam Lantinga 834ab350 2017-08-21T11:19:38 Fixed bug 3644 - Wayland touch event support Moritz Bitsch Attached is a small patch which enables multitouch events on Wayland.
Sam Lantinga a78c20ae 2017-08-21T11:17:38 configury: check mmdeviceapi.h and audioclient.h before enabling wasapi.
Ryan C. Gordon f5a38f23 2017-08-21T00:42:06 x11: specify event mask for buttons when grabbing pointer (thanks, Stas!). This fixes a strange corner case (notes appended below), and should be safe to do anyhow. Fixes Bugzilla #3674. "I did more tests. It appears the bug only happens if there is another window on the screen that has "always on top" property. For me it is xawtv - it is always opened in a screen corner. Closing xawtv or removing "always on top" property from it makes the problem to go away. Plus, it doesn't appear like the buttons are not delivered at all. It appears that instead the button presses are delivered on some mouse positions, but not delivered when you move the mouse to other part of the window... So this is really weird and is likely somewhere deep in the Xorg. Maybe somehow it happens that the cursor is actually above the xawtv window, but, because my app uses grab, it is not visible there, and in that case the events are not delivered to my app? But with my patch the button events are always delivered flawlessly, it seems. Hmm, and that indeed seems to explain my problem: if the mask is set properly and my app uses grab, then, even if the mouse is above some other window, the events would still be delivered to the grabbing app, which is what actually wanted because my app uses relative mouse mode, so it doesn't know the pointer can cross some other window (my app draws the pointer itself). So my current theory is that my patch only enforces the mouse grab, which otherwise can be tricked by some other window preventing the button events delivery (but motion events are still delivered via xinput2, which makes it all look very obscure)."
Ryan C. Gordon 01e0d8fc 2017-08-19T15:02:03 opengl: Add support for [GLX|WGL]_ARB_create_context_robustness. This patch was originally written by Marc Di Luzio for glX and enhanced by Maximilian Malek for WGL, etc. Thanks to both of you! Fixes Bugzilla #3643. Fixes Bugzilla #3735.
Sam Lantinga 18a65385 2017-08-19T11:15:58 add missing os/2 apientry defs to SDL_opengl.h
Sam Lantinga 30d554e3 2017-08-19T03:07:44 Fixed building SDL applications with Visual Studio and the clang toolset Also fixed building 64-bit SDL with clang. 32-bit doesn't build because of the inline assembly for C runtime support.
Sam Lantinga 12d33b33 2017-08-19T02:23:50 Fixed building with Visual Studio 2017 and the Windows XP toolset if _USING_V110_SDK71_ accidentally gets undefined
Sam Lantinga 148ac5b3 2017-08-19T00:27:11 Added Matt Styles' tutorial on building SDL for Android with Visual Studio
Alex Szpakowski 3d0f521b 2017-08-18T23:23:30 iOS 10: Work around screen bounds orientation bug. Fixes bugs #3465 and #3505.
Sam Lantinga 2dc5d32f 2017-08-18T18:16:37 Updated version to 2.0.6
Sam Lantinga bcf0e071 2017-08-18T17:29:44 Added WASAPI audio target to autoconf build process
Ryan C. Gordon 5c4a45f1 2017-08-18T20:25:14 cmake: some iOS fixes (don't link to Cocoa or Carbon frameworks). Fixes Bugzilla #3625.
Ryan C. Gordon f4011bf0 2017-08-18T20:00:29 cmake: added a FIXME for later. Have to figure out what cmake version fixed this and bump the minimum to that.
Ryan C. Gordon 8816bb08 2017-08-18T19:53:40 configure: Apple platforms don't need to build with -fpascal-strings anymore.
Ryan C. Gordon 677b2e57 2017-08-18T19:52:58 configure: mac and iOS should compile core/unix/*.c macOS currently needs this if you build with X11 support. iOS doesn't (currently), but it doesn't hurt to compile it in case we do something Unixy on that platform later on.
Ryan C. Gordon f75caa2f 2017-08-18T18:52:25 cmake: Fix building for macOS with Xcode generator (thanks, dungaipara!). Fixes Bugzilla #3625.
Ryan C. Gordon e3e6b4fd 2017-08-18T16:52:19 audio: better docs on conversion APIs, error if not init'd (thanks, Simon!). Fixes Bugzilla #3662.
Ozkan Sezer 500378eb 2017-08-18T16:35:55 Add atomics for Watcom/x86 as inline asm Partially fixes Bugzilla #3758.
Ozkan Sezer c68d3ab7 2017-08-17T21:35:46 Watcom supports __FUNCTION__ identifier (and surely not __PRETTY_FUNCTION__) Partially fixes Bugzilla #3758.
Ozkan Sezer bdb7bfd7 2017-08-17T21:32:42 SDL_assert.h: add inline asm (int $3) as SDL_TriggerBreakpoint for Watcom/x86 (also disable SIGTRAP case to !watcom, because watcom doesn't have SIGTRAP.) Partially fixes Bugzilla #3758.
Ozkan Sezer fbda68ea 2017-08-17T21:32:00 SDL_endian.h: add SDL_Swap16 and SDL_Swap32 for Watcom/x86 as inline asm Partially fixes Bugzilla #3758.
Ozkan Sezer eccbe366 2017-08-17T21:30:29 SDL_bits.h: add __builtin_clz equivalent for Watcom/x86 as inline asm Partially fixes Bugzilla #3758.
Ryan C. Gordon 7a9b9e05 2017-08-17T20:47:16 SDL_mouse.c doesn't need default_cursor.h.
Ryan C. Gordon 47beda97 2017-08-17T15:44:47 cmake: add core/unix sources to the build. Fixes Bugzilla #3757.
Ryan C. Gordon 00905c98 2017-08-17T03:22:44 filesystem: Patched to compile on QNX.
Ryan C. Gordon e50d3cdf 2017-08-17T02:58:46 filesystem: QNX should use SDL_LoadFile() instead of rolling it from scratch.
Ryan C. Gordon c13c45c7 2017-08-17T01:25:48 qnx: Implemented SDL_GetBasePath().
Ryan C. Gordon adecda50 2017-08-16T21:31:03 cpuinfo: Add SDL_HasNEON() support for ARM-based QNX.
Alex Szpakowski efc43a1d 2017-08-15T23:00:54 More cleanup of the iOS keyboard demo.
Alex Szpakowski a0a09f64 2017-08-15T22:53:57 Improve iOS keyboard demo code a bit.
Alex Szpakowski 2e4248ed 2017-08-15T18:29:47 Address a compiler warning.
Ryan C. Gordon c7b4f2b9 2017-08-15T16:30:26 rwops: Fixed 64-bit file i/o on QNX.
Sam Lantinga e83764a5 2017-08-14T23:45:06 Fixed bug 2137 - SDL Message Boxes don't cope with fixed width fonts (in windows at least) Pegasus Epsilon With the system dialog font set to Arial or Tahoma or another variable-width font, everything works just as expected. When using a fixed-width font, like Courier or DejaVu Sans Mono, the text gets cut off. Example screenshots attached.
Sam Lantinga fb14cb74 2017-08-14T21:40:40 Fixed bug 2263 - Event timestamp members are undocumented Charles Huber The event timestamp members should be documented to indicate their meaning and units. Currently the timestamps are populated using SDL_GetTicks() in SDL_PushEvent() in SDL_events.c.
Sam Lantinga 1d0584d5 2017-08-14T21:35:16 Hopefully fixed Wayland build
Sam Lantinga a4cfa936 2017-08-14T21:28:04 Fixed bug 2293 - Precise scrolling events Martijn Courteaux I implemented precise scrolling events. I have been through all the folders in /src/video/[platform] to implement where possible. This works on OS X, but I can't speak for others. Build farm will figure that out, I guess. I think this patch should introduce precise scrolling on OS X, Wayland, Mir, Windows, Android, Nacl, Windows RT. The way I provide precise scrolling events is by adding two float fields to the SDL_MouseWheelScrollEvent datastructure, called "preciseX" and "preciseY". The old integer fields "x" and "y" are still present. The idea is that every platform specific code normalises the scroll amounts and forwards them to the SDL_SendMouseWheel function. It is this function that will now accumulate these (using a static variable, as I have seen how it was implemented in the Windows specific code) and once we hit a unit size, set the traditional integer "x" and "y" fields. I believe this is pretty solid way of doing it, although I'm not the expert here. There is also a fix in the patch for a typo recently introduced, that might need to be taken away by the time anybody merges this in. There is also a file in Nacl which I have stripped a horrible amount of trailing whitespaces. (Leave that part out if you want).
Sam Lantinga 72b195d2 2017-08-14T20:45:14 Fixed Android build warning
Sam Lantinga 04e76499 2017-08-14T20:37:07 Fixed build warning
Sam Lantinga e086a1c1 2017-08-14T20:25:53 Added missing files from the previous commit
Sam Lantinga fb835f9e 2017-08-14T20:22:19 Fixed bug 2330 - Debian bug report: SDL2 X11 driver buffer overflow with large X11 file descriptor manuel.montezelo Original bug report (note that it was against 2.0.0, it might have been fixed in between): http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=733015 -------------------------------------------------------- Package: libsdl2-2.0-0 Version: 2.0.0+dfsg1-3 Severity: normal Tags: patch I have occasional crashes here caused by the X11 backend of SDL2. It seems to be caused by the X11_Pending function trying to add a high number (> 1024) file descriptor to a fd_set before doing a select on it to avoid busy waiting on X11 events. This causes a buffer overflow because the file descriptor is larger (or equal) than the limit FD_SETSIZE. Attached is a possible workaround patch. Please also keep in mind that fd_set are also used in following files which may have similar problems. src/audio/bsd/SDL_bsdaudio.c src/audio/paudio/SDL_paudio.c src/audio/qsa/SDL_qsa_audio.c src/audio/sun/SDL_sunaudio.c src/joystick/linux/SDL_sysjoystick.c -------------------------------------------------------- On Tuesday 24 December 2013 00:43:13 Sven Eckelmann wrote: > I have occasional crashes here caused by the X11 backend of SDL2. It seems > to be caused by the X11_Pending function trying to add a high number (> > 1024) file descriptor to a fd_set before doing a select on it to avoid busy > waiting on X11 events. This causes a buffer overflow because the file > descriptor is larger (or equal) than the limit FD_SETSIZE. I personally experienced this problem while hacking on the python bindings package for SDL2 [1] (while doing make runtest). But it easier to reproduce in a smaller, synthetic testcase.
Sam Lantinga 9451cd81 2017-08-14T20:07:30 Fixed compiler warnings
Sam Lantinga aebe17d3 2017-08-14T16:34:54 Fixed bug 2344 - CHECK_WINDOW_MAGIC should include __FILE__ and __LINE__ Martin Gerhardy just for easier debugging issues in the own code... SDL_CreateRenderer should maybe also use this macro Ryan C. Gordon I'll go one better: it should have an SDL_assert().
Sam Lantinga 96e15fa7 2017-08-14T16:09:44 Fixed Windows build due to an implicit memcpy generated by the optimizer
Sam Lantinga e9d4e310 2017-08-14T14:14:45 Fixed bug 3753 - Android : load methodID during initialization Sylvain Small patch to load some java methodID at start-up (and avoid a potential crash at run-time).
Sam Lantinga 1da2c1bb 2017-08-14T14:10:48 Fixed bug 2360 - Wrong -rpath setting includes DESTDIR rather that only the libdir Marcus von Appen The LT_LDFLAGS in Makefile.in contain the $(DESTDIR) in -rpath, which instructs libtool to take a wrong path into account for linking. The issue arises, if DESTDIR is passed at build time and installation time. -rpath only should use $(libdir) for both SDL 1.2 and SDL 2.x.
Sam Lantinga 64dd829b 2017-08-14T13:48:13 Fixed bug 2418 - Structure SDL_gestureTouch leaking Leonardo Structure SDL_gestureTouch gets reallocated for every new added gesture but its never freed. Proposed patch add the function SDL_GestureQuit() that takes care of doing that and gets called when TouchQuit is called. Gabriel Jacobo Thanks for the patch. I think it needs a bit of extra work though, looking at the code in SDL_gesture.c , I see that SDL_numGestureTouches only goes up, I think the right fix here involves adding SDL_GestureDelTouch (hooked into SDL_DelTouch) as well as SDL_GestureQuit (as you posted in your patch).
Sam Lantinga f142a796 2017-08-14T13:37:14 Fixed bug 2441 - SDL_DuplicateSurface Rainer Deyke I've written a small patch that adds a small SDL_DuplicateSurface function to SDL. I've written the function as part of a larger (as yet unfinished) patch, but I think this function is useful enough that it merits inclusion in SDL on its own.
Sam Lantinga 362d5496 2017-08-14T10:28:47 Fixed bug 2500 - X11: SDL tries (and fails) to hide foreign windows Alvin I'm interested in this bug as well. I have experienced it when trying to embed an SDL_Window into a FLTK application. To do this, I create a FLTK window (window inside a window - think video player) and then use SDL_CreateWindowFrom() on the inner most window's Xlib Window*. After which, I create a renderer. In my situation I am using the FLTK GUI toolkit. What I have experienced is that the SDL_CreateRender() will recreate the window in order to properly setup OpenGL capability. As part of this process, the window is hidden and a call is executed that waits indefinitely for an acknowledgement that the window was indeed unmapped. This is where my program hangs. Please correct me if I am wrong, but should SDL2 not make Xlib calls that effect the Xlib Window in this situation (e.g. When SDL_CreateWindowFrom() is used)? The toolkit being used typically assumes responsibility and, I presume, tracks all Xlib Windows it creates. On line src/video/SDL_video.c:1372 the comment associated with setting SDL_WINDOW_FOREIGN reads: /* Can't destroy and re-create foreign windows, hrm */ Since I do not know the reason for hiding the window in the first place, the attached patch simply does not wait for a response when X11_XWithdrawWindow() and X11_XMapRaised() are issued by X11_HideWindow() and X11_ShowWindow(), respectively. I presume that the GUI toolkit (GTK, FLTK, etc.) has or will consume the acknowledging event as it is managing the Xlib Window (or it thinks it is). I have tested the patch against hg 5c645d037de2 and I have successfully tested: * Embedding the SDL_Window inside a FLTK application. * Calling SDL_SetWindowSize() when FLTK resizes the window (e.g. dragging cursor on the edge of the window). * Filling the renderer's default target blue and drawing a red fill square at the centre (exciting, I know!) * Calling SDL_Quit() when the application terminates I do not receive any Xlib erorr messages (BadWindow, etc.) in any of those situations.
Sam Lantinga c350d91a 2017-08-14T10:15:38 Fixed bug 3752 - minor os2 defines Ozkan Sezer Attached three patches, so these minor os/2 bits get registered mainstream: 1. SDL_syswm.h: add SDL_SYSWM_OS2 to SDL_SYSWM_TYPE enum 2. SDL_platform.h: recognize __EMX__ too as __OS2__ 3. begin_code.h: set SDLCALL as _System for OS/2.
Sam Lantinga 2bf7bf2c 2017-08-14T10:14:07 Fixed compiler warning with enum
Sam Lantinga 36ba9248 2017-08-14T10:04:59 Fixed setting the texture blend mode in the OpenGL ES2 renderer
Sam Lantinga de91b124 2017-08-14T06:28:21 Fixed bug 3745 - specify SDLCALL as the calling convention for API callbacks Patches contributed by Ozkan Sezer
Sam Lantinga d03409e1 2017-08-14T06:18:08 Fixed bug 3191 - haptic system on android? Sylvain - add vibrator service in the list of haptic devices. I use an hard-coded device_id for it ...
Sam Lantinga c59d9923 2017-08-14T05:51:44 Implemented more flexible blending modes for accelerated renderers This fixes bug 2594 - Propose new blend mode, SDL_BLENDMODE_BLEND_DSTA blendMode = SDL_ComposeCustomBlendMode(SDL_BLENDFACTOR_SRC_ALPHA, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD, SDL_BLENDFACTOR_ZERO, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_ADD); This fixes bug 2828 - Subtractive Blending blendMode = SDL_ComposeCustomBlendMode(SDL_BLENDFACTOR_SRC_ALPHA, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_SUBTRACT, SDL_BLENDFACTOR_ZERO, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_SUBTRACT); This goes partway to fixing bug 3684 - Add support for a pre-multiplied alpha blending mode blendMode = SDL_ComposeCustomBlendMode(SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD, SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD);
Sam Lantinga f8e1874d 2017-08-13T22:50:23 Fixed bug 2646 - Problems with software renderer when SDL_SetRenderLogicalSize set Fixed setting the software renderer clip rectangle when a viewport is set
Sam Lantinga f8de064c 2017-08-13T22:26:44 Added wchar.h to fix build on some platforms with new wcs* functions
Sam Lantinga 7af3786d 2017-08-13T21:55:42 Fixed bug 2755 - SDL2 fails to build on Solaris 10 u3 UX-admin I am compiling with the Sun Studio 12 u2 compiler. There are multiple issues with the build, but this particular issue appears to be that it is illegal to declare a union of a struct of floats and a float. While GCC 4.8.1 does not flag this as an error, Sun Studio is much more standards compliant and strict, halting further compilation with an error.
Sam Lantinga 72ab2588 2017-08-13T21:48:40 Fixed bug 2764 - Timer is not rescheduled with the returned interval afwlehmann Sorry for re-opening, but it turns out that the current interval is indeed not updated. I've just checked the source code of the 2.0.3 release again: 163 if (current->canceled) { 164 interval = 0; 165 } else { 166 interval = current->callback(current->interval, current->param); 167 } 168 169 if (interval > 0) { 170 /* Reschedule this timer */ 171 current->interval = interval; // <-- this line is missing 172 current->scheduled = tick + interval; 173 SDL_AddTimerInternal(data, current); 174 } else { According to the documentation: "The callback function is passed the current timer interval and the user supplied parameter from the SDL_AddTimer() call and returns the next timer interval. If the returned value from the callback is 0, the timer is canceled." If I understand the text correctly, then the current interval should in fact be updated according to the returned value. Otherwise there would be a discrepancy between the next time for which the timer is actually re-scheduled and the value that's passed to the callback once the timer fires again. This could be fixed by adding line #171.
Sam Lantinga 0112f618 2017-08-13T21:18:59 Fixed bug 3743 - make testautomation_sdltest.c to compile Ozkan Sezer The attached patch makes testautomation_sdltest.c more compatible wrt LLONG_{MIN|MAX} macros and makes it to compile on older systems (e.g. glibc-2.8) too, by replacing LLONG_{MIN|MAX} with INT64_{MIN|MAX}. c.f.: bug #3494, where the same issue was described for SDL_test_fuzzer.c
Sam Lantinga eb06aba8 2017-08-13T21:16:58 Fixed bug 3742 - minor warning fixes
Sam Lantinga 2da830a9 2017-08-13T21:15:44 Fixed bug 3741 - more compatible initializers for arrays Ozkan Sezer An array defined like int xPositions[] = {-1, 0, 1, w-1, w, w+1 }; errors with Open Watcom: it strictly wants constants. Small patch like below makes things more compatible.
Sam Lantinga 93a520b3 2017-08-13T21:12:14 Fixed bug 3605 - Software renderer no longer renders after Android screen orientation change Sylvain This still happens with the current trunk version. (software renderer of testdrawchessboard.c) When there is a rotation, the window size changed and the internal surface is marked as "surface_valid == SDL_FALSE". And all further call fails. SDL_video.c : 2478 void 2479 SDL_OnWindowResized(SDL_Window * window) 2480 { 2481 window->surface_valid = SDL_FALSE; 2482 SDL_SendWindowEvent(window, SDL_WINDOWEVENT_SIZE_CHANGED, window->w, window->h); 2483 } some error set to : 2233 return SDL_SetError("Window surface is invalid, please call SDL_GetWindowSurface() to get a new surface"); So, this seems to be the behavior of the API ... In the loop() function of testdrawchessboard.c, we can recreate the surface/renderer : 65 if (e.type == SDL_WINDOWEVENT) 66 { 67 if (e.window.event == SDL_WINDOWEVENT_SIZE_CHANGED) 68 { 69 surface = SDL_GetWindowSurface(window); 70 renderer = SDL_CreateSoftwareRenderer(surface); 71 } 72 /* Clear the rendering surface with the specified color */ 73 SDL_SetRenderDrawColor(renderer, 0xFF, 0xFF, 0xFF, 0xFF); 74 SDL_RenderClear(renderer); 75 } And it displays correctly.
Sam Lantinga 3cae0c38 2017-08-13T21:09:00 Fixed bug 3746 - remove SDLCALL attribute from SDL_BlitFunc() funcptr Ozkan Sezer The attached patch removes SDLCALL attribute from SDL_BlitFunc() funcptr. As far as I can see, *SDL_BlitFunc() is completely internal to SDL with no specific calling convention requirements. The actual functions assigned to SDL_BlitFunc seem to not have any calling conventions specified. So, easy solution is simply removing the strict calling convention from the type.
Sam Lantinga ca5c3048 2017-08-13T21:06:52 Fixed bug 3744 - missing SDLCALL in several functions Ozkan Sezer The attached patch adds missing SDLCALL to several functions, so that they properly match the headers as intended.
Sam Lantinga e54eede2 2017-08-13T21:05:15 Provide the correct state of the on-screen keyboard to the API (patch from Sylvain)
Sam Lantinga 6ee66139 2017-08-13T20:55:59 Fixed bug 3235 - Make the Android window creation similar to iOS' window creation Sylvain Here's a patch. It tries to get the hint first. Resizable will allow any orientation. Otherwise it uses width/height window. setOrientation method is splitted in static and non-static, so that it can be overloaded in a user subclass. Some artefact observed : surfaceChanged() can be called twice at the beginning. When the phone starts in portrait and run a landscape application.
Sam Lantinga 6ef1a25d 2017-08-13T20:51:08 Fixed bug 3751 - DirectFB linux_input disabled by default Clayton Craft linux_input module is disabled by default, despite the comments in source code that it is otherwise: src/video/directfb/SDL_DirectFB_video.c: devdata->use_linux_input = readBoolEnv(DFBENV_USE_LINUX_INPUT, 0); /* default: on */ src/video/directfb/SDL_DirectFB_video.h: #define DFBENV_USE_LINUX_INPUT "SDL_DIRECTFB_LINUX_INPUT" /* Default: on */ When using the directfb driver, the linux_input module is suppressed unless the SDL app is started with "SDL_DIRECTFB_LINUX_INPUT=1" set in the environment. I recall seeing at one point that the directfb folks recommended using linux_input over the other input drivers, but I am having trouble locating this recommendation. In any case, I believe that this should really be defaulted to 'on' since it's vastly superior to the other dfb input drivers!
Sam Lantinga ddeaa601 2017-08-13T20:42:41 Fixed bug 3299 - DirectInput: Incorrect joystick mapping when attaching new joysticks Jimb Esser Note: This is using DirectInput, I have to disable XInput as that causes all but the first 4 controllers to be completely ignored by SDL (I can find no way to reconcile XInput devices with DirectInput devices, otherwise I would make a patch that accepts the fifth and later controllers with DirectInput...). XInput does not seem to have the problem below, only DirectInput. I plug in 3 identical wireless Xbox 360 controllers, call them J1, J2, J3. Direct Input shows them as having GUIDs G1, G2, G3. I unplug J1, then J2 and J3 show up as having GUIDs G1 and G2! Not so "unique"... I start my SDL app when just J2 and J3 are plugged in, and open J2 and J3. Then I plug in a new controller, SDL sees that now G3 exists, assigns that a new SDL joystick instance ID, which I request to be opened, but G3 at this point is J3, which I already had opened! So I end up with two instances of J3 opened, and none of J1. "Re-"opening G1 would get the actual handle to the newly attached controller, but there's no current way to know this. This is clearly a bug or poor design in DirectInput or my wireless receiver drivers, but is a showstopping bug for my 8-20 player games (as soon as any one controller runs out of battery or goes to sleep and gets turned back on, suddenly things are busted requiring a restart (or, at least, a reinitialization of all controllers - the game can't go on)). The solution I found is to use HID paths instead of GUIDs to uniquely identify joysticks. GUIDs are still needed to open a controller, however I have added code to re-find the GUIDs for all joysticks whenever a new joystick is attached or removed. This does now require opening of all joysticks (instead of just enumerating them), though if your app, like mine, is opening all of them anyway so that any can press a button to join, that doesn't change much (although perhaps they joysticks should be kept open in this case, instead of closed and re-opened). If your app only ever opens one joystick, this will do more work at startup than it did previously.
Sam Lantinga ea9bc659 2017-08-13T20:39:00 Added check for XBOX in addition to Xbox and X-Box
Sam Lantinga 78865eff 2017-08-13T20:38:06 Fixed compiler warning
Sam Lantinga f1829d95 2017-08-13T20:37:49 Added SDL_wcscmp()
Sam Lantinga af9ec8f6 2017-08-13T20:13:11 Fixed copy-paste error, thanks Alen!
Sam Lantinga df2d2994 2017-08-13T18:12:06 Fixed bug 2812 - Make libSDL2main.a usable on Android via a dummy symbol Jonas Kulla This eliminates the need to manually compile in SDL_main_android.c. Instead, add "-lSDL2main -Wl,-u,SDL_main_dummy" when linking. I don't know how the nkd-build process works, but unless it was for some reason linking libSDL2main.a it should be unaffected.
Sam Lantinga e9772259 2017-08-13T17:59:59 Fixed bug 2839 - No way to create pre-built libraries for Android Mark Callow README-android says to copy or link the SDL source tree to the jni folder in your Android project. It is not desirable to have to compile SDL with every application; furthermore the Android NDK has support for prebuilt libraries. Attached is script (to be put in build-scripts) that builds the Android version of the libraries. The script builds both the existing SDL2 module and a new SDL2_main module. This is a static library containing the code from src/main/android/SDL_android_main.c. Also attached is a patch for Android.mk adding this module. Note that when building an application's native .so using this prebuilt libSDL2main, you must use a link option, such as --whole-archive, that forces inclusion of the code in the .so because the functions in SDL_android_main are called only from Java.
Sam Lantinga c87e1d52 2017-08-13T14:15:52 Fixed bug 2841 - Hint to set resource id for window icon Alexey Seems to be a missing functionality. I want to set an icon from RC file. I cant pass MAKEINTRESOURCE(X) string to SDL_RegisterApp() cause string returned by MAKEINTRESOURCE string is not actually a string and SDL_strlen will crash. Moreover LoadImage seems to be loading wrong icon size. LoadIcon seems to be fine.
Ryan C. Gordon 18cceb5c 2017-08-13T01:00:01 x11: Patched to compile.
Ryan C. Gordon 0a1b905b 2017-08-13T00:58:23 x11: Fix message box titles with Unicode chars on some window managers. Fixes Bugzilla #2971.
Sam Lantinga bfd5a134 2017-08-12T20:25:49 Fixed bug 2931 - Large relative mouse motion jumps when using touch input
Sam Lantinga b2e2bcc2 2017-08-12T20:21:34 Added test debug logs for additional event types
Alex Szpakowski 9be597a0 2017-08-12T22:16:04 iOS: Fix app orientation when creating a landscape fullscreen window with the device currently in portrait orientation.
Sam Lantinga 059d9e46 2017-08-12T17:41:59 Fixed bug 2950 - wrong axes values are set on joystick initialization Edward Rudd Device: Logitech Rumble Gamepad F510 in Xinput mode. Upon opening the joystick the values of the axes are queried via PollAllValues are not actually set on the device all the time. This can easily be seen in the testjoystick or testgamecontroller test programs,as the testjoystick shows all axes in the center until one 'tickles' the triggers., and the testgamecontroller will show the triggers as 'on' until on 'tickles' the triggers. Upon further research the culprit is the SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS hint. In the default value events are ignored until there is an active window, Thus in cases where the joystick system is initialized and controllers opened before the initial window is created & focuses, the initial values will be incorrect. Here is my current workaround in the game I'm working on porting.. SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1"); SDL_GameController* gamepad = SDL_GameControllerOpen(index); SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "0");
Sam Lantinga 7bab2913 2017-08-12T17:01:14 Fixed Windows build
Sam Lantinga 05facb3d 2017-08-12T16:59:00 Fixed bug 2979 - SDL_ConvertSurface does not convert color keys consistently Edmund Horner When a 16-bit "565 format" surface has a colour key set, it will blit with correct transparency. If, however, it has its colour key set then is converted to a 32-bit ARGB format surface, the colour key in the converted image will not necessarily be the same pixel value as the transparent pixels. It may not blit correctly, because the colour key does not match the right pixels. In my case, with an image using 0xB54A for transparency, the colour key was converted to 180,170,82; but the corresponding pixels (with the same original value) were converted to 180,169,82. Blitting the converted image did not use transparency where expected. I have attached a test case. The bug has been replicated on both x86_64 Linux (SDL 2.0.2), and 32-bit MS C++ 2010 on Windows (SDL 2.0.0).
Sam Lantinga d226594f 2017-08-12T16:48:46 Workaround for bug 3049 - SDL_Init(SDL_INIT_VIDEO) - XDM authorization key matches an existing client! malferit Hello, I began a little program with SDL2 on Linux in C, and when I call SDL_Init(SDL_INIT_VIDEO) I get an error and this is printed in the console: XDM authorization key matches an existing client! I searched through Internet, and found that some people suggest to run 'xhost +' or to specify this in /etc/X11/xdm/xdm-config: DisplayManager*authName: MIT-MAGIC-COOKIE-1 I don't think an end user needs to know that... But what bothered me is that first I started this little program in Pascal using the Freepascal compiler and it works. In freepascal you only use some thin header bindings in Pascal and then it links with the dynamic SDL library, so I don't understood why it worked with Freepascal and not in C. I run ldd to the two generated applications: Application in C: linux-gate.so.1 (0xffffe000) libSDL2-2.0.so.0 => /usr/lib/libSDL2-2.0.so.0 (0xb76ac000) libpthread.so.0 => /lib/libpthread.so.0 (0xb766e000) libc.so.6 => /lib/libc.so.6 (0xb74e2000) libm.so.6 => /lib/libm.so.6 (0xb74a0000) libdl.so.2 => /lib/libdl.so.2 (0xb749a000) librt.so.1 => /lib/librt.so.1 (0xb7491000) /lib/ld-linux.so.2 (0xb77b3000) Application compiled with Freepascal: linux-gate.so.1 (0xffffe000) libSDL2-2.0.so.0 => /usr/lib/libSDL2-2.0.so.0 (0xb762a000) libX11.so.6 => /usr/lib/libX11.so.6 (0xb74f3000) libc.so.6 => /lib/libc.so.6 (0xb7367000) libm.so.6 => /lib/libm.so.6 (0xb7325000) libdl.so.2 => /lib/libdl.so.2 (0xb731f000) libpthread.so.0 => /lib/libpthread.so.0 (0xb7305000) librt.so.1 => /lib/librt.so.1 (0xb72fc000) libxcb.so.1 => /usr/lib/libxcb.so.1 (0xb72dc000) libXau.so.6 => /usr/lib/libXau.so.6 (0xb72d9000) libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xb72d3000) /lib/ld-linux.so.2 (0xb7755000) It seems that Freepascal is linking with libX11, libxcb, libXau and libXdmcp . Linking my C application with libxcb solved the problem (linking with libXau and/or libXdmcp without libxcb didn't work). Linking with X11 links all the other libraries and works as well. So I fill this bug report mainly to let you know about this. I don't know if it is a problem that can be solved on the libSDL side or not, but at least I hope it will help. Hi, some tests: 1. Disabled XDM. Login in console and running 'startx'. The program works without having to link with X11. 2. Enabled XDM. Added 'DisplayManager*authName: MIT-MAGIC-COOKIE-1' to /etc/X11/xdm/xdm-config.The program works without having to link with X11. 3. Enabled XDM without 'DisplayManager*authName: MIT-MAGIC-COOKIE-1' in /etc/X11/xdm/xdm-config . I get the authentication error unless I link with X11.
Sam Lantinga 45cec28b 2017-08-12T16:44:00 Fixed bug 3058 - Slight mistake in GetWindowStyle in SDL_windowswindow.c Coriiander There's a slight mistake in the function "GetWindowStyle" found in file "SDL_windowswindow.c". When a window is marked to be resizable, the resizable style is being added regardless of whether the window has a border or not. While for some arcane, hidden semantics this can be ok, it's still inconsistent in this case.
Sam Lantinga e3f3a757 2017-08-12T16:02:33 Fixed bug 3158 - SDL display window scrambled over VNC Witek Jachimczyk I'm using SDL to develop a video viewer for MATLAB. The window is scrambled while using thightVNC with its default mode of RGB656. SDL does not correctly recognize the pixel mode. I found a solution for this problem. The solution involves modifying SDL/src/video/SDL_pixels.c Adding the following "if statement" under case 16: of SDL_MasksToPixelFormatEnum resolves the issue: if (Rmask == 0x003F && Gmask == 0x07C0 && Bmask == 0xF800 && Amask == 0x0000) { return SDL_PIXELFORMAT_RGB565; } I hope that this helps someone. I took me a while to figure it out.
Sam Lantinga 4a9c6f0a 2017-08-12T15:55:54 Fixed bug 3173 - SDL_GL_GetAttribute overwrites error code from SDL_GL_GetProcAddress Yann Dirson When SDL_GL_GetProcAddress returns in error, the cause of the error is overwritten in GL_GL_GetAttribute, reporting to the user "Failed getting OpenGL glGetString entry point", whereas the original "OpenGL library not loaded" never makes it to the user. Pushed a fix to: https://github.com/O-Computers/SDL/commit/f94cb13708ef4d236f8a2a330135b9b3a47db204 Note that the "OpenGL library not loaded" error looks like no root cause either, and I'm still puzzled by the code path used: I'm forcing opengles2 renderer on the x11 video driver on a rpi2, as in https://bugzilla.libsdl.org/3169, and although I now know that I must force the use of the RPI video driver instead of the x11 one, I suspect even more accurate info can be given to user.
Sam Lantinga b1ed855d 2017-08-12T15:45:46 Added a note about number key keycodes always being SDLK_0...SDLK_9 even on AZERTY layouts See bug 3188 for more discussion
Sam Lantinga 3b837a26 2017-08-12T15:41:03 Fixed bug 3188 - AZERTY keyboard support broken and inconsistent Daniel Gibson AZERTY keyboard layouts (which are the default layouts in France and Belgium) don't have the number keys (1, 2, ..., 9, 0) in the first row of keys, but ?, &, ?", ', (, -, ?_, ??), = (with small differences between the France and Belgian variants). Numbers are reached via shift. On Linux and OSX, SDL seems to use the corresponding ISO 8859-1 codes (231 for ?232 for ?tc) as SDL_Keycode (but no SDK_* constants exists for those values!), while on Windows SDL seems to map those keys to SDLK_1, SDLK_2 etc, like you'd get on QWERTY. I don't know how other platforms behave. So we have two problems: 1. At least on Linux and OSX invalid/undefined SDL_Keycodes are returned 2. Different platforms behave differently (Windows vs Linux/OSX) It's unclear what behavior is desired: Should SDL_* constants for those keys be introduced (and Windows behavior changed accordingly)? Or should all platforms behave like Windows here and use the existing SDLK_1, ..., SDLK_0 keycodes? This bug on the mailing list: https://forums.libsdl.org/viewtopic.php?t=11555 (my post about Linux/Windows) https://forums.libsdl.org/viewtopic.php?t=11573 (Tim Walters discovered the same problem on OSX about 1.5 weeks later).
Sam Lantinga 1a544145 2017-08-12T15:21:26 Fixed bug 3309 - SDL_ConvertSurface adds AlphaMod when input surface has ColorKey Sylvain Let's you have a SDL_Surface that has ColorKey, but no Alpha Modulation. When this surface is duplicated with SDL_ConvertSurface function, the result has ColorKey and Alpha Modulation (BLEND, and Opaque 255). I think SDL_ConvertSurface should strictly keeps the input format. example ======= SDL_Surface *input; // ... Set up a surface with ColorKey and no AlphaMod SDL_Surface *output = SDL_ConvertSurface(input, input->format, input->flags); // "output" surface has a ColorKey but *also* AlphaMod (BLEND, and Opaque 255).