git.y1.nz

SameBoy

Accurate GB/GBC emulator
download: https://git.y1.nz/archives/sameboy.tar.gz
README | Files | Log | Refs | LICENSE

Cocoa/GBBorderView.m

      1 #import "GBBorderView.h"
      2 
      3 @implementation GBBorderView
      4 
      5 
      6 - (void)awakeFromNib
      7 {
      8     self.wantsLayer = true;
      9 }
     10 
     11 - (BOOL)wantsUpdateLayer
     12 {
     13     return true;
     14 }
     15 
     16 - (void)updateLayer
     17 {
     18     /* Wonderful, wonderful windowserver(?) bug. Using 0,0,0 here would cause it to render garbage
     19        on fullscreen windows on some High Sierra machines. Any other value, including the one used
     20        here (which is rendered exactly the same due to rounding) works around this bug. */
     21     self.layer.backgroundColor = [NSColor colorWithCalibratedRed:0
     22                                                            green:0
     23                                                             blue:1.0 / 1024.0
     24                                                            alpha:1.0].CGColor;
     25 }
     26 @end

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.