Bug 996 - add a tag to the sdl view on iphone

As Sam suggested, i’m posting here the solution to a feature request
when you use sdl over a custom objc interface
it may be useful/necessary to get the uiview that hosts the sdl
rendering eg. for rotating only on certain directions
i intially set it up using a tag inside the library but it wasn’t
really a clean procedure: in the end i resorted to

UIView *sdlView = nil;
for (UIView *oneView in [[[UIApplication sharedApplication] keyWindow]

subviews])
if ([oneView isMemberOfClass:[SDL_uikitopenglview class]]) {
sdlView = (UIView *)oneView;
break;
}

if anyone has a better solution please share :slight_smile:
Hope this helps
Vittorio---------- Forwarded message ----------
From: bugzilla-daemon@obelix.dreamhost.com (bugzilla-daemon at obelix.dreamhost.com)
Date: Thu, Apr 28, 2011 at 12:04 AM
Subject: [Bug 996] add a tag to the sdl view on iphone
To: vitto.giova at yahoo.it

http://bugzilla.libsdl.org/show_bug.cgi?id=996

— Comment #7 from Sam Lantinga 2011-04-27
15:04:49 PDT —
Great, I’m glad you found a better way to do this. :slight_smile:

It might be worth posting this trick on the mailing list if you haven’t
already.


Configure bugmail: http://bugzilla.libsdl.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You reported the bug.