- fixed invalid context warnings with Cocoa backend

A bunch of 'CGContext<...>: invalid context 0x0' messages were printed to console during OpenGL view creation and resizing
This commit is contained in:
alexey.lysiuk 2020-01-07 14:37:25 +02:00
parent 7e050010aa
commit 442f953d67

View file

@ -186,10 +186,17 @@ namespace
@implementation OpenGLCocoaView
- (void)drawRect:(NSRect)dirtyRect
{
if ([NSGraphicsContext currentContext])
{
[NSColor.blackColor setFill];
NSRectFill(dirtyRect);
}
else if (self.layer != nil)
{
self.layer.backgroundColor = CGColorGetConstantColor(kCGColorBlack);
}
}
- (void)resetCursorRects
{