File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -747,16 +747,26 @@ - (void)windowWillStartLiveResize:(NSNotification *)aNotification
747
747
{
748
748
// We'll try to maintain 60 FPS during live resizing
749
749
const NSTimeInterval interval = 1.0 / 60.0 ;
750
+
751
+ const NSMethodSignature *invocationSig = [SDLWindow
752
+ instanceMethodSignatureForSelector: @selector (onLiveResizeTimerFire )];
753
+ NSInvocation *invocation = [NSInvocation
754
+ invocationWithMethodSignature: invocationSig];
755
+ [invocation setTarget: self ];
756
+ [invocation setSelector: @selector (onLiveResizeTimerFire )];
757
+
750
758
liveResizeTimer = [NSTimer scheduledTimerWithTimeInterval: interval
751
- repeats: TRUE
752
- block: ^(NSTimer *unusedTimer)
753
- {
754
- SDL_OnWindowLiveResizeUpdate (_data.window );
755
- }];
759
+ invocation: invocation
760
+ repeats: TRUE ];
756
761
757
762
[[NSRunLoop currentRunLoop ] addTimer: liveResizeTimer forMode: NSRunLoopCommonModes ];
758
763
}
759
764
765
+ - (void )onLiveResizeTimerFire
766
+ {
767
+ SDL_OnWindowLiveResizeUpdate (_data.window );
768
+ }
769
+
760
770
- (void )windowDidEndLiveResize : (NSNotification *)aNotification
761
771
{
762
772
[liveResizeTimer invalidate ];
You can’t perform that action at this time.
0 commit comments