From 32a1ad87b773d896e071dc0280039fc6a4d69954 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Sat, 18 Jun 2016 17:48:02 +0300 Subject: [PATCH] Fixed a bug where a Cocoa emulator window will appear frozen (or partially frozen) until resized --- Cocoa/GBView.m | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Cocoa/GBView.m b/Cocoa/GBView.m index b101634b..28224301 100644 --- a/Cocoa/GBView.m +++ b/Cocoa/GBView.m @@ -4,8 +4,6 @@ #import "GBButtons.h" #import "NSString+StringForKey.h" -static GBShader *shader = nil; - @implementation GBView { uint32_t *image_buffers[3]; @@ -93,7 +91,10 @@ static GBShader *shader = nil; if (!self.shader) { self.shader = [[GBShader alloc] initWithName:[[NSUserDefaults standardUserDefaults] objectForKey:@"GBFilter"]]; } + double scale = self.window.backingScaleFactor; + glViewport(0, 0, self.bounds.size.width * scale, self.bounds.size.height * scale); + if (_shouldBlendFrameWithPrevious) { [self.shader renderBitmap:image_buffers[current_buffer] previous:image_buffers[(current_buffer + 2) % self.numberOfBuffers] @@ -171,12 +172,6 @@ static GBShader *shader = nil; } } --(void)reshape -{ - double scale = self.window.backingScaleFactor; - glViewport(0, 0, self.bounds.size.width * scale, self.bounds.size.height * scale); -} - - (BOOL)becomeFirstResponder { /* Non-Roman keyboard layouts breaks user input. */