Add SDL_net support
Summary
Adds SDL_net support to nxdk as an SDL2 companion library, backed by nxdk’s existing lwIP network stack.
This adds SDL_net as a submodule, builds it into libSDL2_net.lib when NXDK_SDL = y, exposes a pkg-config file, and includes a small smoke-test sample that resolves localhost and opens a UDP socket.
Changes
- Add
lib/sdl/SDL_netsubmodule - Add nxdk/lwIP compatibility patch in the SDL_net fork
- Build
libSDL2_net.libfrom SDL_net sources - Add
lib/pkgconfig/SDL2_net.pc - Add
samples/sdl_net - Update README SDL library summary
Verification
Built successfully on Windows/MSYS2 with:
make -C samples/sdl_net
This produced:
- lib/libSDL2_net.lib
- samples/sdl_net/bin/default.xbe
- samples/sdl_net/nxdk sample - SDL2_net.iso
Notes
The SDL_net submodule points at PaulMDemers/SDL_net, branch nxdk-sdl-net, which is based on SDL_net 2.0.1 with minimal nxdk compatibility changes for lwIP sockets.
I don't think this should be merged. See reasons in https://github.com/XboxDev/nxdk/pull/601
I had a port of enet at some point, and there was work towards a dummy winsock (based on lwip) which was enough for enet (I believe). @thrimbor also had a winsock impl. It should probably be extended to support the upstream SDL_net without changes, too.
Such a winsock impl would be a much better fit for core nxdk.