Skip to content

Add SDL_net support#771

Draft
PaulMDemers wants to merge 1 commit into
XboxDev:masterfrom
PaulMDemers:feature/sdl-net
Draft

Add SDL_net support#771
PaulMDemers wants to merge 1 commit into
XboxDev:masterfrom
PaulMDemers:feature/sdl-net

Conversation

@PaulMDemers

Copy link
Copy Markdown

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_net submodule
  • Add nxdk/lwIP compatibility patch in the SDL_net fork
  • Build libSDL2_net.lib from 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.

@JayFoxRox

Copy link
Copy Markdown
Member

I don't think this should be merged. See reasons in #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.

@PaulMDemers PaulMDemers marked this pull request as draft June 17, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants