-
Notifications
You must be signed in to change notification settings - Fork 22
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
Initial SDL3 support. #434
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ers, SDL ignores it...).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Latest tested SDL3 build: 3.1.6.
#error
in render_sdl.c.Resolve text input enablement (platform_sdl.c) and active check (event_sdl.c) issues.Fixed via Enable SDL text events at window creation time. #502.ResolveShould be resolved thanks to Split set_video_mode into create_window and resize_window. #494 and Merge/cleanup renderer viewport calculation code. #496, needs testing.SDL_EVENT_WINDOW_RESIZED
hack.ResolveSwitched to SDL3-styleSDL_CreateWindow
hacks.SDL_CreateWindow
completely since MZX creates centered windows anyway.Resolve DSO hack TODO?No longer usingSDL_FUNCTION_POINTER_IS_VOID_POINTER
, Move SDL_LoadObject et al. to platform_sdl.c to fix warnings. #500.Resolve system mouse TODO?Done as part of Split set_video_mode into create_window and resize_window. #494.Cleanup: something better thanSwitched to justSDL_RenderTexture_mzx
?SDL_RenderTexture
.Cleanup: SDL_VERSION et al. handling probably not ideal.Made X11 clipboard handler SDL1/2 only; defined new functions to get the compiled and linked version in SDL3 format instead of trying to rename the SDL1/2 macros/functions.Cleanup: unnecessary comments in some places.Cleanup: is it possible to handle some of the 0/-1 to true/false return value changes without#if
/#else
on branches?Not plausible to do better than current.SDL_Init
Rewrote wrapper to take advantage of the changed return value.SDL_GL_LoadLibrary
Non-necessary call, removed completely.SDL_GL_MakeCurrent
Not plausible to do better.SDL_GetClipboardText
Cleanup: final pass checking for any missed 0/-1 to true/false return value changes. Most of these never bothered checking the return value in the first place and should be safe by that technicality.SDL_WINDOW_FULLSCREEN_DESKTOP
should remain in the GL allowed flags for SDL2.ShouldSDL_free
the return value ofSDL_GetClipboardText
.Changelog (prior to merge).Testing:
Not clear if this was an upstream bug or fixed in MZX.software
doesn't work (no window).Not clear what fixed this.software
doesn't work in fullscreen (previous frame displays, no updates).Fixed all of these issues in Misc. fullscreen tweaks/fixes. #499.software
crashes in Linux. Cascading failure:resolution_width
/resolution_height
are unsigned, so -1 ->UINT_MAX
, sosoftware
's minimum clamps on them fail, so MZX automatically selects the smallest resolution greater than or equal to 320x240, which happens to be 320x240.sdl_create_window_soft
doesn't enable blitting for inadequate window surface sizes, sosoftware
writes out of bounds to the surface.Caused bysoftscale
doesn't work (black screen) (Linux only?).sdl_render_rect()
normalizing coordinates.Caused bysdlaccel
doesn't work (black screen).sdl_render_rect()
normalizing coordinates.OpenGL doesn't initialize.SDL3 changed more 0/-1 return values to true/false.SDL's ALSA, Pulseaudio, PipeWire, and JACK audio drivers all ignoreactually no it just works now???SDL_HINT_AUDIO_DEVICE_SAMPLE_FRAMES
.