Skip to content
Permalink
Browse files

- 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
  • Loading branch information
alexey-lysiuk committed Jan 7, 2020
1 parent 7e05001 commit 442f953d67ef39ff5c9df00f719c0f3cc44c2fe5
Showing with 9 additions and 2 deletions.
  1. +9 −2 src/posix/cocoa/i_video.mm
@@ -187,8 +187,15 @@ @implementation OpenGLCocoaView

- (void)drawRect:(NSRect)dirtyRect
{
[NSColor.blackColor setFill];
NSRectFill(dirtyRect);
if ([NSGraphicsContext currentContext])
{
[NSColor.blackColor setFill];
NSRectFill(dirtyRect);
}
else if (self.layer != nil)
{
self.layer.backgroundColor = CGColorGetConstantColor(kCGColorBlack);
}
}

- (void)resetCursorRects

0 comments on commit 442f953

Please sign in to comment.
You can’t perform that action at this time.