Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preparation for SDL3 support. #418

Merged
merged 2 commits into from
Jan 19, 2024
Merged

Preparation for SDL3 support. #418

merged 2 commits into from
Jan 19, 2024

Conversation

AliceLR
Copy link
Owner

@AliceLR AliceLR commented Jan 19, 2024

Changes due to how SDL3 includes its headers:

  • Most SDL.h includes have been replaced with SDLmzx.h, formerly known as compat_sdl.h. Other includes have been optimized out or also replaced. The exceptions are main.c and render_sdl.h, which both require special handling in SDL3.
  • CONFIG_SDL is now defined to be explicitly the major version number of SDL.

Changes due to the removal of SDL_syswm.h:

  • SDL_SysWMinfo_GetWND has been replaced with SDL_GetWindowProperty_HWND, which now performs all SDL_syswm.h functionality internally. In SDL3 this is done by instead calling SDL_GetProperty(SDL_GetWindowProperties(window), ...).
  • SDL_SysWMmsg_GetXEvent has been removed entirely. This functionality has been integrated into the X11 clipboard handler instead.
  • The X11 clipboard handler's SDL code has been separated from its X11 code. SDL3 support for listening to X11 events is handled completely differently.

* CONFIG_SDL is now defined to the SDL major version in config.h.
  This should NEVER be used unless it's impossible to use
  SDL_VERSION_ATLEAST instead. This exists mainly for SDL3's new
  method of including headers (SDL3/SDL.h instead of SDL.h).
* Replaced SDL_SysWMinfo_GetWND with SDL_GetWindowProperty_HWND to
  isolate the related SDL_SysWMinfo usage inside of compat_sdl.h.
* Removed SDL_SysWMmsg_GetXEvent as it was only used in the X11
  clipboard handler. The SDL_syswm.h functionality in the X11
  clipboard handler is difficult to generalize in non-SDL_syswm.h
  terms for compat_sdl.h, so it's been left in place.
* Separated all SDL code in the X11 clipboard handler from the X11
  code to make it easier to write the corresponding SDL3 functions.
@AliceLR AliceLR added this to the 2.93b milestone Jan 19, 2024
@AliceLR AliceLR force-pushed the sdl3-prep-2 branch 2 times, most recently from 3e07841 to 0c212e2 Compare January 19, 2024 10:59
@AliceLR AliceLR merged commit 7dad36e into master Jan 19, 2024
14 checks passed
@AliceLR AliceLR deleted the sdl3-prep-2 branch January 19, 2024 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant