Browse Source

Fix graphical issues when closing UIs in Ableton Live

pull/6/head
falkTX 8 years ago
parent
commit
3775c92208
2 changed files with 11 additions and 7 deletions
  1. +2
    -0
      dgl/src/Image.cpp
  2. +9
    -7
      dgl/src/pugl/pugl_osx.m

+ 2
- 0
dgl/src/Image.cpp View File

@@ -68,7 +68,9 @@ Image::~Image()
{
if (fTextureId != 0)
{
#ifndef DISTRHO_OS_MAC // FIXME
glDeleteTextures(1, &fTextureId);
#endif
fTextureId = 0;
}
}


+ 9
- 7
dgl/src/pugl/pugl_osx.m View File

@@ -199,8 +199,6 @@ puglDisplay(PuglView* view)

- (void) reshape
{
[[self openGLContext] update];

if (!puglview) {
/* NOTE: Apparently reshape gets called when the GC gets around to
deleting the view (?), so we must have reset puglview to NULL when
@@ -209,6 +207,8 @@ puglDisplay(PuglView* view)
return;
}

[[self openGLContext] update];

NSRect bounds = [self bounds];
int width = bounds.size.width;
int height = bounds.size.height;
@@ -438,11 +438,13 @@ void
puglLeaveContext(PuglView* view, bool flush)
{
#ifdef PUGL_HAVE_GL
if (view->ctx_type == PUGL_GL && flush) {
if (view->impl->glview->doubleBuffered) {
[[view->impl->glview openGLContext] flushBuffer];
} else {
glFlush();
if (view->ctx_type == PUGL_GL) {
if (flush) {
if (view->impl->glview->doubleBuffered) {
[[view->impl->glview openGLContext] flushBuffer];
} else {
glFlush();
}
}
//[NSOpenGLContext clearCurrentContext];
}


Loading…
Cancel
Save