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

[Patch] iOS: major improvements and bug fixes #1702

Closed
SDLBugzilla opened this issue Feb 10, 2021 · 0 comments
Closed

[Patch] iOS: major improvements and bug fixes #1702

SDLBugzilla opened this issue Feb 10, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

SDLBugzilla commented Feb 10, 2021

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 2.0
Reported for operating system, platform: iOS (All), iPhone/iPod touch

Comments on the original bug report:

On 2014-12-03 02:46:39 +0000, Alex Szpakowski wrote:

Created attachment 1951
Major improvements and bug fixes for iOS

The following changes have been made:

  • The SDL_WINDOW_ALLOW_HIGHDPI flag is now needed (along with SDL_GL_GetDrawableSize or SDL_GetRendererOutputSize) to use Retina / high-DPI resolutions, bringing SDL’s Retina-related behaviour on iOS in line with Mac OS X.
  • Added iOS-specific SDL_iPhoneGetViewRenderbuffer and SDL_iPhoneGetViewFramebuffer functions.
  • Added OpenGL ES debug labels for the Renderbuffer and Framebuffer Objects created with SDL_GL_CreateContext.
  • Added support for sRGB OpenGL ES contexts on iOS 7+.
  • Added support for SDL_HINT_ACCELEROMETER_AS_JOYSTICK.
  • Updated SDL windows to support native-resolution rendering (when SDL_WINDOW_ALLOW_HIGHDPI is enabled) on the iPhone 6 Plus, i.e. 1080x1920 rather than 1242x2208.
  • Updated the iOS-specific Objective-C code to use cleaner and more modern language features and APIs, including ARC instead of manual reference counting.
  • Updated SDL_HINT_ORIENTATIONS to allow disabling custom orientations if the hint is set with no valid orientation names.
  • Fixed several rotation and orientation bugs, especially on iOS 8+.
  • Fixed SDL_SetWindowFullscreen failing to update the status bar visibility on iOS 7+.
  • Fixed the orientation of the offset applied to the window’s view when the onscreen keyboard is shown in iOS 8+.
  • Fixed SDL_IsScreenKeyboardShown (patch by Phil Hassey.)
  • Fixed memory leaks caused by missing autorelease pool blocks in the iOS-specific Objective-C code.
  • Removed the custom iOS splash screen code, since it was causing several orientation-related issues and didn’t properly support newer iOS devices and versions.
  • Removed several dead code paths.
  • The iOS 7 SDK (Xcode 5) or newer is now required to build SDL for iOS. Apple also requires Xcode 5.1 or newer to be used when building apps for the App Store.

On 2015-01-16 04:14:26 +0000, Alex Szpakowski wrote:

Created attachment 1991
Major improvements and bug fixes for iOS

I have attached an updated patch which has several new changes and improvements - mostly reworking some internals of the window and view behavior in the UIKit backend, and also re-adding support for the custom extended launch screen, this time with code that has the proper fallbacks for pre-iOS 8 and doesn't mess up the window orientation.

The changelog in my original comment above is now obsolete, but the new patch contains a new complete changelog / commit message near the top (the patch is in the HG changeset patch format, so it lists my commit message.)

On 2015-01-26 05:33:17 +0000, Alex Szpakowski wrote:

Created attachment 2005
Major improvements and bug fixes for iOS (version 3)

I updated the patch again, to fix a minor visual glitch that would happen in rare circumstances with the old patch when the screen was rotated after the extended launch screen finished displaying.

On 2015-02-19 05:22:23 +0000, Ryan C. Gordon wrote:

Marking a large number of bugs with the "triage-2.0.4" keyword at once. Sorry if you got a lot of email from this. This is to help me sort through some bugs in regards to a 2.0.4 release. We may or may not fix this bug for 2.0.4, though!

On 2015-02-24 22:47:57 +0000, Alex Szpakowski wrote:

For reference, here are some bugzilla reports that are also fixed by this patch:

https://bugzilla.libsdl.org/show_bug.cgi?id=2212
https://bugzilla.libsdl.org/show_bug.cgi?id=2826
https://bugzilla.libsdl.org/show_bug.cgi?id=2661 (I believe)
https://bugzilla.libsdl.org/show_bug.cgi?id=1885
https://bugzilla.libsdl.org/show_bug.cgi?id=1578
https://bugzilla.libsdl.org/show_bug.cgi?id=2751

On 2015-04-07 04:57:58 +0000, Ryan C. Gordon wrote:

(sorry if you get a lot of copies of this email, I'm marking several bugs at once)

Marking bugs for the (mostly) final 2.0.4 TODO list. This means we're hoping to resolve this bug before 2.0.4 ships if possible. In a perfect world, the open bug count with the target-2.0.4 keyword is zero when we ship.

(Note that closing a bug report as WONTFIX, INVALID or WORKSFORME might still happen.)

--ryan.

On 2015-04-08 19:37:01 +0000, Alex Szpakowski wrote:

Created attachment 2114
Major improvements and bug fixes for iOS (version 4)

The patch has been updated to apply without merge conflicts to the latest SDL source code. The patch's changes are listed at the top of the diff file in its commit message, as usual.

I also have a public repository with the changes here: https://bitbucket.org/slime73/sdl-experiments/branch/iOS-improvements (in the iOS-improvements branch of that repository.)

On 2015-04-09 21:46:32 +0000, Ryan C. Gordon wrote:

(In reply to Alex Szpakowski from comment # 6)

Created attachment 2114 [details]
Major improvements and bug fixes for iOS (version 4)

The patch has been updated to apply without merge conflicts to the latest
SDL source code. The patch's changes are listed at the top of the diff file
in its commit message, as usual.

I also have a public repository with the changes here:
https://bitbucket.org/slime73/sdl-experiments/branch/iOS-improvements (in
the iOS-improvements branch of that repository.)

I would rather have this split up into multiple commits, to avoid having a single changeset with a commit message of "here's a million things that suck less"; is there any reason to not just pull from your repo instead of working from the patch posted here?

One initial note, though:

SDL_iOSGetViewFramebuffer and SDL_iOSGetViewRenderbuffer: can we just put these into the SysWM structure? Sometimes iOS-specific APIs were unavoidable, but I'd rather not add new ones if we don't have to, and syswm is basically designed for this.

(Eventually, we might offer a generic "give me the window system's FBO" since it's zero on some platforms and an FBO that SDL generated on others, but that's for later.)

--ryan.

On 2015-04-09 21:55:36 +0000, Alex Szpakowski wrote:

(In reply to Ryan C. Gordon from comment # 7)

I would rather have this split up into multiple commits, to avoid having a
single changeset with a commit message of "here's a million things that suck
less"; is there any reason to not just pull from your repo instead of
working from the patch posted here?

I was just worried that "here's a million commits at once" might not be desirable, but if you're fine with that then the repo should be fine. :)

One initial note, though:

SDL_iOSGetViewFramebuffer and SDL_iOSGetViewRenderbuffer: can we just put
these into the SysWM structure? Sometimes iOS-specific APIs were
unavoidable, but I'd rather not add new ones if we don't have to, and syswm
is basically designed for this.

Ah, I didn't think of that – there should be no problem with that, I'll do it now.

If you do prefer the repository instead of the giant patch then I'll just push to there without attaching a new patch here every time.

On 2015-04-09 22:11:34 +0000, Alex Szpakowski wrote:

(In reply to Alex Szpakowski from comment # 8)

SDL_iOSGetViewFramebuffer and SDL_iOSGetViewRenderbuffer: can we just put
these into the SysWM structure? Sometimes iOS-specific APIs were
unavoidable, but I'd rather not add new ones if we don't have to, and syswm
is basically designed for this.

Ah, I didn't think of that – there should be no problem with that, I'll do
it now.

One potential issue is that if code uses 2.0.3's SDL_syswm.h header but 2.0.4's UIKit_GetWindowWMInfo, then things might crash (SDL would try to modify memory outside of what the code using SDL considers the size of the SDL_SysWMinfo struct to be.)

Since SDL for iOS is only set up to be a static library though (for now), that isn't such a big deal, right?

On 2015-04-09 22:30:16 +0000, Alex Szpakowski wrote:

Nevermind, I implemented a check using the version members of the SDL_SysWMinfo struct. Sorry for the noise!

The repository has been updated with the change: https://bitbucket.org/slime73/sdl-experiments/branch/iOS-improvements

On 2015-04-10 02:42:21 +0000, Ryan C. Gordon wrote:

(In reply to Alex Szpakowski from comment # 10)

Nevermind, I implemented a check using the version members of the
SDL_SysWMinfo struct. Sorry for the noise!

The repository has been updated with the change:
https://bitbucket.org/slime73/sdl-experiments/branch/iOS-improvements

Ok, this is in our repo now, and the named branch is marked as closed.

Nothing quite like landing thousands of lines of changes before finalizing a release! :)

Resolving this bug (and several others).

--ryan.

On 2015-04-12 01:36:02 +0000, Ryan C. Gordon wrote:

Hey, Alex, Bug # 2660 is fixed by this too, right?

--ryan.

On 2015-04-12 05:08:25 +0000, Alex Szpakowski wrote:

It should be I think, yeah: https://hg.libsdl.org/SDL/rev/bff6f1fecc5d

I also just pushed a couple orientation fixes to my SDL fork ( https://bitbucket.org/slime73/sdl-experiments/commits/all ), if you don't mind pushing them to the main SDL repository.

On 2015-04-13 00:29:48 +0000, Ryan C. Gordon wrote:

(In reply to Alex Szpakowski from comment # 13)

It should be I think, yeah: https://hg.libsdl.org/SDL/rev/bff6f1fecc5d

Thanks!

I also just pushed a couple orientation fixes to my SDL fork (
https://bitbucket.org/slime73/sdl-experiments/commits/all ), if you don't
mind pushing them to the main SDL repository.

Merged and pushed.

--ryan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant