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

Frame-pacing issues #12

Open
ckosmic opened this issue Oct 28, 2021 · 1 comment
Open

Frame-pacing issues #12

ckosmic opened this issue Oct 28, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@ckosmic
Copy link
Owner

ckosmic commented Oct 28, 2021

On iOS, SDL_GL_SetSwapInterval is not supported, so the app defaults to timer-based frame-pacing rather than vsync. This ultimately leads to the game sometimes appearing at a lower framerate. This is very noticeable without the 60 fps patch, but is virtually a non-issue with the 60 fps patch applied.

@ckosmic ckosmic added the bug Something isn't working label Oct 28, 2021
@ckosmic
Copy link
Owner Author

ckosmic commented Nov 5, 2021

Vsync has been partially fixed in 812669b by rendering frames using CADisplayLink. This syncs SDL rendering with the screen's refresh rate, but is sometimes inconsistent, visually dropping frames, which eventually catch up. Sadly this is a limitation of CADisplayLink, however, it is a lot better than the previous timer-based frame pacing.

This is not needed for the 60fps patch as frame pacing seems to be a non-issue there, so the patch has been updated to revert to timer-based rendering.

A bonus side effect of this change allows the touch joystick to be updated frame-independent from the game, updating it at a smooth 60fps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant