The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Alex's iOS improvements...
Ryan C. Gordon
Guest

...have just landed in revision control. If you have an iOS project,
PLEASE update your copy of SDL if at all possible and let us know if
anything has totally blown up, as this is slated to ship soon in 2.0.4.

A quick list of improvements and fixes Alex made are noted here:

https://hg.libsdl.org/SDL/rev/cf8fab52e33b

If you don't want to screw around with Mercurial, this link will give
you a zipfile of the complete source code to the latest revision, just
download (about 7 megabytes), unzip, and point XCode at it:

https://hg.libsdl.org/SDL/archive/default.zip

A big thank you to Alex for an enormous amount of work on this!

--ryan.

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Alex's iOS improvements...
Alex Szpakowski
Guest

Also, keep in mind that retina-resolution handling for iOS was changed (it’s now consistent with SDL’s high-dpi APIs, and with how SDL works in OS X, as mentioned in the list of changes.)

Existing code using SDL for iOS that expected to have retina-resolution output but didn’t use SDL_WINDOW_ALLOW_HIGHDPI and SDL_GL_GetDrawableSize or SDL_GetRendererOutputSize will need to be updated.

Quote:
On Apr 9, 2015, at 11:58 PM, Ryan C. Gordon wrote:

If you have an iOS project, PLEASE update your copy of SDL if at all possible and let us know if anything has totally blown up, as this is slated to ship soon in 2.0.4.

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Alex's iOS improvements...
Michael Labbé
Guest

This is a large enough change that I feel justified in confirming that everything worked for me. ~150 kloc iOS codebase. Tested on the XCode 6.3 that shipped recently, no less. Tested on simulator and an iPad Air 2.
Thanks to Alex and Ryan for working on this! Michael Labbé@frogtoss


Quote:
On Apr 9, 2015, at 7:58 PM, Ryan C. Gordon wrote:
...have just landed in revision control. If you have an iOS project, PLEASE update your copy of SDL if at all possible and let us know if anything has totally blown up, as this is slated to ship soon in 2.0.4.A quick list of improvements and fixes Alex made are noted here:://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Alex's iOS improvements...
slvn


Joined: 06 Oct 2012
Posts: 88
Tested also on latest XCode 6.3 / iPhoneOS8.3.sdk and almost all
worked fine, I only notice :


1/ Indeed, we need to add the SDL_WINDOW_ALLOW_HIGHDPI flag when
creating the window + getting the renderer size by calling
SDL_GetRendererOutputSize.
Just wondering if it wouldn't be easier if SDL_GetDisplayMode could
give the high dpi mode ?


2/ When testing Landscape mode on a real IPod Touch 4 (ios 6.1.6), I notice :

- The device is in Portait. the Application draws in Portrait
orientation with a Landscape Shape (a letterbox mode, with black on
top and bottom). Bad.
(and also with wrong touch coordinates)

- When I rotate the device to landscape, it autorates to Landscape and
lock in landscape. Ok.

I was expecting, as before, that it would automatically rotates to
landscape and lock to landscape.


To be in landscape, my Info.plist contains :
"UIInterfaceOrientation" and "UISupportedOrientation" both set to
"UIInterfaceOrientationLandscapeRight"
The hint "SDL_HINT_ORIENTATIONS" is set to "LandscapeLeft
LandscapeRight" (only "LandscapeLeft" or "LandscapeRight" is not
enough to have landscape )


3/ Probably ok. "SDL_uikview:setSDLWindow()" is always called twice.
(I have a splash screen).

Thanks to Alex and Ryan for this works!

On Fri, Apr 10, 2015 at 10:18 AM, Michael Labbé wrote:
Quote:
This is a large enough change that I feel justified in confirming that
everything worked for me. ~150 kloc iOS codebase. Tested on the XCode 6.3
that shipped recently, no less. Tested on simulator and an iPad Air 2.

Thanks to Alex and Ryan for working on this!

Michael Labbé
@frogtoss


On Apr 9, 2015, at 7:58 PM, Ryan C. Gordon wrote:


...have just landed in revision control. If you have an iOS project, PLEASE
update your copy of SDL if at all possible and let us know if anything has
totally blown up, as this is slated to ship soon in 2.0.4.

A quick list of improvements and fixes Alex made are noted here:

https://hg.libsdl.org/SDL/rev/cf8fab52e33b

If you don't want to screw around with Mercurial, this link will give you a
zipfile of the complete source code to the latest revision, just download
(about 7 megabytes), unzip, and point XCode at it:

https://hg.libsdl.org/SDL/archive/default.zip

A big thank you to Alex for an enormous amount of work on this!

--ryan.

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org



_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org




--
Sylvain Becker
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Alex's iOS improvements...
Alex Szpakowski
Guest

Thanks for testing!

The display modes are in points rather than pixels in the OS X version of SDL as well. It’s probably better this way just because the coordinate systems of display modes / display positions and window sizes / window positions are the same right now.

It would be nice to have functions to get the actual pixel dimensions of a display mode though – it’s something I’ve wanted but never got around to making a bugzilla report for.

I pushed a couple orientation-related fixes to my fork of SDL ( https://bitbucket.org/slime73/sdl-experiments/commits/all ), it’d be great if you could test that and see if those issues are resolved.
Quote:
On Apr 10, 2015, at 6:31 AM, Sylvain Becker wrote:
Tested also on latest XCode 6.3 / iPhoneOS8.3.sdk and almost allworked fine, I only notice :1/ Indeed, we need to add the SDL_WINDOW_ALLOW_HIGHDPI flag whencreating the window + getting the renderer size by callingSDL_GetRendererOutputSize.Just wondering if it wouldn't be easier if SDL_GetDisplayMode couldgive the high dpi mode ?2/ When testing Landscape mode on a real IPod Touch 4 (ios 6.1.6), I notice :- The device is in Portait. the Application draws in Portraitorientation with a Landscape Shape (a letterbox mode, with black ontop and bottom). Bad.(and also with wrong touch coordinates)- When I rotate the device to landscape, it autorates to Landscape andlock in landscape. Ok.I was expecting, as before, that it would automatically rotates tolandscape and lock to landscape.To be in landscape, my Info.plist contains :"UIInterfaceOrientation" and "UISupportedOrientation" both set to"UIInterfaceOrientationLandscapeRight"The hint "SDL_HINT_ORIENTATIONS" is set to "LandscapeLeftLandscapeRight" (only "LandscapeLeft" or "LandscapeRight" is notenough to have landscape )-- Sylvain Becker_______________________________________________SDL mailing://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Alex's iOS improvements...
slvn


Joined: 06 Oct 2012
Posts: 88
Great, it seems to be fixed:

The first commit solves the "letterbox / landscape" issue:
https://bitbucket.org/slime73/sdl-experiments/commits/950a1a7b4c3cb095a6b8f1e68148ae34dfb42efd

Though, I see no difference by adding the second one:
https://bitbucket.org/slime73/sdl-experiments/commits/201f813c650ba40b3a51ec3f1710010650c5ec98

Moreover, I observed that setting the hint SDL_HINT_ORIENTATIONS to
"LandscapeLeft LandscapeRight" is not need anymore (only the
pInfo.list is used, like before).

Thanks,

Sylvain

On Sun, Apr 12, 2015 at 6:59 AM, Alex Szpakowski wrote:
Quote:
Thanks for testing!

The display modes are in points rather than pixels in the OS X version of
SDL as well. It’s probably better this way just because the coordinate
systems of display modes / display positions and window sizes / window
positions are the same right now.

It would be nice to have functions to get the actual pixel dimensions of a
display mode though – it’s something I’ve wanted but never got around to
making a bugzilla report for.

I pushed a couple orientation-related fixes to my fork of SDL (
https://bitbucket.org/slime73/sdl-experiments/commits/all ), it’d be great
if you could test that and see if those issues are resolved.

On Apr 10, 2015, at 6:31 AM, Sylvain Becker
wrote:

Tested also on latest XCode 6.3 / iPhoneOS8.3.sdk and almost all
worked fine, I only notice :


1/ Indeed, we need to add the SDL_WINDOW_ALLOW_HIGHDPI flag when
creating the window + getting the renderer size by calling
SDL_GetRendererOutputSize.
Just wondering if it wouldn't be easier if SDL_GetDisplayMode could
give the high dpi mode ?


2/ When testing Landscape mode on a real IPod Touch 4 (ios 6.1.6), I notice
:

- The device is in Portait. the Application draws in Portrait
orientation with a Landscape Shape (a letterbox mode, with black on
top and bottom). Bad.
(and also with wrong touch coordinates)

- When I rotate the device to landscape, it autorates to Landscape and
lock in landscape. Ok.

I was expecting, as before, that it would automatically rotates to
landscape and lock to landscape.


To be in landscape, my Info.plist contains :
"UIInterfaceOrientation" and "UISupportedOrientation" both set to
"UIInterfaceOrientationLandscapeRight"
The hint "SDL_HINT_ORIENTATIONS" is set to "LandscapeLeft
LandscapeRight" (only "LandscapeLeft" or "LandscapeRight" is not
enough to have landscape )

--
Sylvain Becker
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org



_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Alex's iOS improvements...
Ryan C. Gordon
Guest

Quote:
Thanks to Alex and Ryan for working on this!

(this was almost all Alex: literally months of work on his part, fwiw.)

--ryan.



_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Alex's iOS improvements...
Eric Wing
Guest

On 4/9/15, Ryan C. Gordon wrote:
Quote:

...have just landed in revision control. If you have an iOS project,
PLEASE update your copy of SDL if at all possible and let us know if
anything has totally blown up, as this is slated to ship soon in 2.0.4.


I pulled on Friday and did some testing over the weekend. So far, I
haven't seen any serious problems or regressions.

I also tested my entire gamut (iOS, OS X, Linux, Windows, Android),
and things look equally good. (The SDLActivitiy.java changes are
always a gotcha for me...I'm not advocating stabilizing it yet, but I
hope we eventually get to a place where it does become stable.)

Anyway, great work Alex and thank you!


Thanks,
Eric
--
Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Alex's iOS improvements...
Martin Gerhardy
Guest

Am 21.04.2015 um 11:13 schrieb Eric Wing:
Quote:
On 4/9/15, Ryan C. Gordon wrote:
Quote:
...have just landed in revision control. If you have an iOS project,
PLEASE update your copy of SDL if at all possible and let us know if
anything has totally blown up, as this is slated to ship soon in 2.0.4.

I pulled on Friday and did some testing over the weekend. So far, I
haven't seen any serious problems or regressions.

I also tested my entire gamut (iOS, OS X, Linux, Windows, Android),
and things look equally good. (The SDLActivitiy.java changes are
always a gotcha for me...I'm not advocating stabilizing it yet, but I
hope we eventually get to a place where it does become stable.)

Extending the SDLActivity class helps here btw. (Now that the libs that
are loaded can be defined in the derived class).

See here:
https://github.com/mgerhardy/caveexpress/blob/master/android-project/src/org/base/BaseActivity.java
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Alex's iOS improvements...
Eric Wing
Guest

On 4/21/15, Martin Gerhardy wrote:
Quote:
Am 21.04.2015 um 11:13 schrieb Eric Wing:
Quote:
On 4/9/15, Ryan C. Gordon wrote:
Quote:
...have just landed in revision control. If you have an iOS project,
PLEASE update your copy of SDL if at all possible and let us know if
anything has totally blown up, as this is slated to ship soon in 2.0.4.

I pulled on Friday and did some testing over the weekend. So far, I
haven't seen any serious problems or regressions.

I also tested my entire gamut (iOS, OS X, Linux, Windows, Android),
and things look equally good. (The SDLActivitiy.java changes are
always a gotcha for me...I'm not advocating stabilizing it yet, but I
hope we eventually get to a place where it does become stable.)

Extending the SDLActivity class helps here btw. (Now that the libs that
are loaded can be defined in the derived class).

See here:
https://github.com/mgerhardy/caveexpress/blob/master/android-project/src/org/base/BaseActivity.java
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL crashes on launch when I try to use a subclass of SDLActivity. I'm
going to move this to a new thread, but looking at the SDLActivity
code, I don't think it is safe to subclass.

Thanks,
Eric
--
Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
cedega


Joined: 10 Apr 2015
Posts: 2
I just updated my iOS code to the newest SDL-2.0.4-9574, and forcing landscape orientations using Info.plist seems to crash the application on launch.

It writes this to the console on my iPhone 4 (iOS 7.1):

<Error>: *** Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and shouldAutorotate is returning YES'

Which is odd, because I just went into the source code and found that shouldAutorotate was being set to NO...

Either way, enabling all orientations fixes the issue, but my app is definitely only playable in landscape mode Razz

Also this is probably intended, but setting the orientation hints using SDL does nothing now.
cedega


Joined: 10 Apr 2015
Posts: 2
I've fixed the issue by replacing the supportedInterfaceOrientations function in SDL_uikitviewcontroller.m with:

- (NSUInteger)supportedInterfaceOrientations
{
// return UIKit_GetSupportedOrientations(window);
return UIInterfaceOrientationMaskLandscape;
}