summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoaglcontext.mm
diff options
context:
space:
mode:
authorMorten Sorvig <morten.sorvig@nokia.com>2011-08-30 10:41:54 +0200
committerSamuel Rødal <samuel.rodal@nokia.com>2011-08-30 12:12:45 +0200
commitd610fbc13e589b36ce8f1e1af7166d215f0ccc90 (patch)
treea80f8345f7c155a5d875ab008c5966c77df0cabe /src/plugins/platforms/cocoa/qcocoaglcontext.mm
parent42f2da5e6b543e698fc4f036c45ebb15078409c8 (diff)
Cocoa: Make the hellowindow opengl example work.
You're not supposed to use NSOpenGLView and NSOpenGLContext at the same time - it's one or the other. Qmlscene worked because it was hitting the raster path that doesn't have a NSOpenGLView. Remove the NSOpenGLView path and m_windowSurfaceView. Change-Id: I10358851a94cd1780a312af09bbb7cf5db8f984f Reviewed-on: http://codereview.qt.nokia.com/3862 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoaglcontext.mm')
-rw-r--r--src/plugins/platforms/cocoa/qcocoaglcontext.mm4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.mm b/src/plugins/platforms/cocoa/qcocoaglcontext.mm
index fabed4e207..8b07315378 100644
--- a/src/plugins/platforms/cocoa/qcocoaglcontext.mm
+++ b/src/plugins/platforms/cocoa/qcocoaglcontext.mm
@@ -39,6 +39,8 @@ void QCocoaGLContext::swapBuffers(QPlatformSurface *surface)
bool QCocoaGLContext::makeCurrent(QPlatformSurface *surface)
{
+ QCocoaAutoReleasePool pool;
+
QWindow *window = static_cast<QCocoaWindow *>(surface)->window();
setActiveWindow(window);
@@ -61,7 +63,7 @@ void QCocoaGLContext::setActiveWindow(QWindow *window)
QCocoaWindow *cocoaWindow = static_cast<QCocoaWindow *>(window->handle());
cocoaWindow->setCurrentContext(this);
- NSView *view = cocoaWindow->windowSurfaceView();
+ NSView *view = cocoaWindow->contentView();
[m_context setView:view];
}