You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reported in version: HG 2.0 Reported for operating system, platform: iOS (All), Other
Comments on the original bug report:
On 2010-05-01 05:52:00 +0000, Vittorio Giovara wrote:
it would be nice to have a way to get the pointer of the sdl generated view for various reasons, such as applying objc functions on it, modify its size at run time and so on.
the way i currently do this is by adding a tag to the sdl view and then use the viewWithTag method on the uiwindow.
my 'patch' consists of two lines of code added
adding a symbol in SDL_config_iphoneos.h like
#define c 12345
add a tag in SDL_uikitopengles.m in UIKit_GL_CreateContext()
view.tag = SDL_VIEW_TAG;
in this way we could call just
[[SDLUIKitDelegate sharedAppDelegate].uiwindow viewWithTag:SDL_VIEW_TAG]
to get the pointer to view and apply some nice objc api to it
would it be possible to include this feature in mainstream?
On 2010-07-16 19:31:13 +0000, Vittorio Giovara wrote:
Created attachment 519
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
I'd actually rather expose the uiwindow through the "standard" cross-platform APIs in SDL_syswm.h
On 2011-01-20 01:03:07 +0000, Vittorio Giovara wrote:
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.
On 2011-01-20 09:47:30 +0000, Sam Lantinga wrote:
Can't you just grab the first view from that window?
On 2011-01-21 03:24:19 +0000, Vittorio Giovara wrote:
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.
On 2011-04-27 02:22:56 +0000, Vittorio Giovara wrote:
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
On 2011-04-27 15:04:49 +0000, Sam Lantinga wrote:
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.
The text was updated successfully, but these errors were encountered:
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), Other
Comments on the original bug report:
On 2010-05-01 05:52:00 +0000, Vittorio Giovara wrote:
On 2010-07-16 19:31:13 +0000, Vittorio Giovara wrote:
On 2011-01-20 00:01:55 +0000, Sam Lantinga wrote:
On 2011-01-20 01:03:07 +0000, Vittorio Giovara wrote:
On 2011-01-20 09:47:30 +0000, Sam Lantinga wrote:
On 2011-01-21 03:24:19 +0000, Vittorio Giovara wrote:
On 2011-04-27 02:22:56 +0000, Vittorio Giovara wrote:
On 2011-04-27 15:04:49 +0000, Sam Lantinga wrote:
The text was updated successfully, but these errors were encountered: