| Summary: | add a tag to the sdl view on iphone | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Vittorio Giovara <vitto.giova> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED INVALID | QA Contact: | Sam Lantinga <slouken> |
| Severity: | enhancement | ||
| Priority: | P2 | ||
| Version: | HG 2.0 | ||
| Hardware: | Other | ||
| OS: | iOS (All) | ||
| Attachments: | patch that implements this feature | ||
|
Description
Vittorio Giovara
2010-05-01 05:52:00 UTC
Created attachment 519 [details]
patch that implements this feature
i'm submitting a patch that implements this feature;
note that even if the uiwindow cannot be retrieved from the appdelegate, it would be still possible to apply this method by calling
[[[UIApplication sharedApplication] keyWindow] viewWithTag:SDL_VIEW_TAG]
I'd actually rather expose the uiwindow through the "standard" cross-platform APIs in SDL_syswm.h well the uiwindow can always be fetched by [[UIApplication sharedApplication] keyWindow] which returns the topmost window of the application. My feature request would be a method to fetch the uiview that contains the sdl context. Can't you just grab the first view from that window? Not really, as the user might add/remove views from the uikit window and in that case the order is not predictable. I reckon that adding a tag is not a very elegant solution and that this is not a 'standard use' by any means but it'd be nice to have more hooks to tinker with the library as much as possible. i found a way to avoid adding a tag to the sdl view just by doing
UIView *sdlView = nil;
for (UIView *oneView in [[[UIApplication sharedApplication] keyWindow] subviews])
if ([oneView isMemberOfClass:[SDL_uikitopenglview class]]) {
sdlView = (UIView *)oneView;
break;
}
so i would say that the bug can be marked as invalid as adding a tag is not a clean procedure at all, expecially for a library
Great, I'm glad you found a better way to do this. :) It might be worth posting this trick on the mailing list if you haven't already. |