diff --git a/Cocoa/GBView.m b/Cocoa/GBView.m index b101634..2822430 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. */