This is a proposed update to SDL2 along with a patch that enables
GameController API and a proposal for adjusting SDL_GetPlatform
temporarily to "Linux" for testing purposes in the context of ongoing
work to enable FNA-based games on OpenBSD (see background info below).

The three changes (each small) here in detail:

1) 2.0.7 adds audio stream conversion functions, changes to memory
allocation functions, and some work on thread-safety. The GameController
mapping only allows for syntax to invert axes since 2.0.6.

2) Besides the Joystick API, SDL2 also provides GameController API which
is commonly used in XInput/Steam etc, but also on cross-platform games
like FNA games. This has so far not been functional, failing with the
error: "SDL not built with haptic (force feedback) support." With the
patch, my gamepad and flightstick are detected and work with the FNA
games. SDL2 games that have worked with gamepads prior to this likely
use the Joystick API of SDL2.

3) The idea of changing the SDL_GetPlatform string to Linux should
probably be debated and tested. My rationale is that it would facilitate
additional testing and contributions to the work on FNA games, while the
change is minor and I have not noticed issues with this on my platform.
This would likely only be temporary until some of the FNA games have
been shipped or updated with BSD platform support.

This upgrade generally keeps the configuration and patches of the port.
portcheck runs clean. make port-lib-depends-check complains about extra
GL.17 X11.16 Xau.10 Xdmcp.11 Xext.13 Xrandr.7 Xrender.6 xcb.4. I left
them because of comment in makefile from before that
GL/X11/Xext/Xrender/Xrandr are dlopen'd by SDL.

I've tested this with the FNA games that I'm working on and noticed no
regression on brief testing. The GameController API works and buttons
and axes are mapped correctly on normal gamepad/joystick.

I would be okay with taking Maintainer on this one since my work on the
FNA games (and others) will make regular use of SDL2.

-------------------------

Background:

FNA is a framework that has been used for several dozen high-quality
indie games of the last 5 years (FEZ, Owlboy, Rogue Legacy, Axiom Verge
etc). It exchanges dependencies of games made with Microsoft's XNA
framework to deps on free, portable libraries (except FMOD in a few
games). It is currently used to port such games to Linux and MacOS with
bundled mono and libraries.                   

The building blocks for running FNA games on OpenBSD are: - mono port
(currently marked broken, but can build on my amd64 and is actively     
  worked on)                                              
- pointing the game/framework to the libraries like SDL, primarily via
  the .config files in the game's folder (I'm working on a script to      
  automate this)                                                     
- FNA game recognizing the OS via SDL_GetPlatform. Currently this 
  requires patching SDL2 to return "Linux"; however upstream is interested
  and has already added OpenBSD to the platform check with the 18.01
  update which will be included in future releases and is also planned for a
  patch (along with other, bigger updates) to existing FNA games that
  per the FNA dev can be expected maybe end of 2018.                    
                                                                        
FNA webpage: https://fna-xna.github.io/ Screen recordings, discussion, 
and documentation can be found on the OpenBSD Gaming subreddit.     
                                                  
----------------------
Updates in SDL2 2.0.7 from the announcement:
                                                                       
Thanks to all the people who contributed code and feedback, SDL 2.0.7 is
now available!  http://www.libsdl.org/download-2.0.php               
                                                    
In addition to audio resampling improvements and fixed D-BUS support,
here are the major changes in this release:
                                                                      
Added audio stream conversion functions: SDL_NewAudioStream          
SDL_AudioStreamPut SDL_AudioStreamGet SDL_AudioStreamAvailable
SDL_AudioStreamFlush SDL_AudioStreamClear SDL_FreeAudioStream Added
functions to query and set the SDL memory allocation functions:        
SDL_GetMemoryFunctions() SDL_SetMemoryFunctions()    
SDL_GetNumAllocations() Added locking functions for multi-threaded
access to the joystick and game controller APIs: SDL_LockJoysticks()
SDL_UnlockJoysticks() The following functions are now thread-safe:
SDL_SetEventFilter() SDL_GetEventFilter() SDL_AddEventWatch()
SDL_DelEventWatch()
                                                                    
Enjoy!                         

Attachment: sdl2.tgz
Description: Binary data

Reply via email to