diff --git a/dgl/src/pugl/pugl_internal.h b/dgl/src/pugl/pugl_internal.h index 1f758307..45a3a2d9 100644 --- a/dgl/src/pugl/pugl_internal.h +++ b/dgl/src/pugl/pugl_internal.h @@ -80,6 +80,7 @@ puglInit(int* pargc, char** argv) PuglInternals* impl = puglInitInternals(); if (!impl) { + free(view); return NULL; } diff --git a/dgl/src/pugl/pugl_osx.m b/dgl/src/pugl/pugl_osx.m index d5fa6e2b..e98a9364 100644 --- a/dgl/src/pugl/pugl_osx.m +++ b/dgl/src/pugl/pugl_osx.m @@ -24,8 +24,6 @@ #include "pugl_internal.h" -#include - @interface PuglWindow : NSWindow { @public @@ -97,10 +95,11 @@ puglDisplay(PuglView* view) - (BOOL) acceptsFirstMouse:(NSEvent*)e; - (BOOL) isFlipped; +- (BOOL) isOpaque; - (BOOL) preservesContentInLiveResize; - (id) initWithFrame:(NSRect)frame; - (void) reshape; -- (void) drawRect:(NSRect)r; +- (void) drawRect:(NSRect)rect; - (void) cursorUpdate:(NSEvent*)e; - (void) updateTrackingAreas; - (void) viewWillMoveToWindow:(NSWindow*)newWindow; @@ -136,6 +135,11 @@ puglDisplay(PuglView* view) return YES; } +- (BOOL) isOpaque +{ + return YES; +} + - (BOOL) preservesContentInLiveResize { return NO; @@ -143,7 +147,7 @@ puglDisplay(PuglView* view) - (id) initWithFrame:(NSRect)frame { - puglview = nil; + puglview = nil; trackingArea = nil; NSOpenGLPixelFormatAttribute pixelAttribs[16] = { @@ -200,14 +204,13 @@ puglDisplay(PuglView* view) puglview->height = height; } -- (void) drawRect:(NSRect)r +- (void) drawRect:(NSRect)rect { puglDisplay(puglview); glFlush(); glSwapAPPLE(); - // unused - return; (void)r; + [super drawRect:rect]; } - (void) cursorUpdate:(NSEvent*)e @@ -494,6 +497,7 @@ puglDestroy(PuglView* view) PuglStatus puglProcessEvents(PuglView* view) { + [view->impl->glview setNeedsDisplay:YES]; view->redisplay = false; return PUGL_SUCCESS; }