Fixed a bug where a Cocoa emulator window will appear frozen (or partially frozen) until resized

This commit is contained in:
Lior Halphon 2016-06-18 17:48:02 +03:00
parent 180f0e16b0
commit 32a1ad87b7

View File

@ -4,8 +4,6 @@
#import "GBButtons.h" #import "GBButtons.h"
#import "NSString+StringForKey.h" #import "NSString+StringForKey.h"
static GBShader *shader = nil;
@implementation GBView @implementation GBView
{ {
uint32_t *image_buffers[3]; uint32_t *image_buffers[3];
@ -93,7 +91,10 @@ static GBShader *shader = nil;
if (!self.shader) { if (!self.shader) {
self.shader = [[GBShader alloc] initWithName:[[NSUserDefaults standardUserDefaults] objectForKey:@"GBFilter"]]; self.shader = [[GBShader alloc] initWithName:[[NSUserDefaults standardUserDefaults] objectForKey:@"GBFilter"]];
} }
double scale = self.window.backingScaleFactor; double scale = self.window.backingScaleFactor;
glViewport(0, 0, self.bounds.size.width * scale, self.bounds.size.height * scale);
if (_shouldBlendFrameWithPrevious) { if (_shouldBlendFrameWithPrevious) {
[self.shader renderBitmap:image_buffers[current_buffer] [self.shader renderBitmap:image_buffers[current_buffer]
previous:image_buffers[(current_buffer + 2) % self.numberOfBuffers] 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 - (BOOL)becomeFirstResponder
{ {
/* Non-Roman keyboard layouts breaks user input. */ /* Non-Roman keyboard layouts breaks user input. */