diff options
Diffstat (limited to 'src/opengl')
-rw-r--r-- | src/opengl/opengl.pro | 10 | ||||
-rw-r--r-- | src/opengl/qgl.cpp | 4 | ||||
-rw-r--r-- | src/opengl/qgl_mac.mm | 30 | ||||
-rw-r--r-- | src/opengl/qgl_p.h | 1 |
4 files changed, 17 insertions, 28 deletions
diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro index 48d7caf..78aaddb 100644 --- a/src/opengl/opengl.pro +++ b/src/opengl/opengl.pro @@ -25,18 +25,16 @@ HEADERS += qgl.h \ qglcolormap.h \ qglpixelbuffer.h \ qglframebufferobject.h \ - qglpixmapfilter_p.h SOURCES += qgl.cpp \ qglcolormap.cpp \ qglpixelbuffer.cpp \ qglframebufferobject.cpp \ qglextensions.cpp \ - qglpixmapfilter.cpp !contains(QT_CONFIG, opengles2) { - HEADERS += qpaintengine_opengl_p.h - SOURCES += qpaintengine_opengl.cpp + HEADERS += qpaintengine_opengl_p.h qglpixmapfilter_p.h + SOURCES += qpaintengine_opengl.cpp qglpixmapfilter.cpp } contains(QT_CONFIG, opengles2) { @@ -130,6 +128,10 @@ wince*: { contains(QT_CONFIG,opengles1cl) { QMAKE_LIBS += "libGLES_CL.lib" } + contains(QT_CONFIG,opengles2) { + QMAKE_LIBS += "libGLESv2.lib" + } + } else { QMAKE_LIBS += $$QMAKE_LIBS_OPENGL } diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 6d75d02..b4a0e5c 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -3234,6 +3234,10 @@ bool QGLWidget::event(QEvent *e) update(); } return true; +# if defined(QT_MAC_USE_COCOA) + } else if (e->type() == QEvent::MacGLClearDrawable) { + d->glcx->d_ptr->clearDrawable(); +# endif } #endif diff --git a/src/opengl/qgl_mac.mm b/src/opengl/qgl_mac.mm index 314c659..1319396 100644 --- a/src/opengl/qgl_mac.mm +++ b/src/opengl/qgl_mac.mm @@ -87,29 +87,6 @@ QT_FORWARD_DECLARE_CLASS(QWidget) QT_FORWARD_DECLARE_CLASS(QWidgetPrivate) QT_FORWARD_DECLARE_CLASS(QGLWidgetPrivate) -@interface QT_MANGLE_NAMESPACE(QCocoaOpenGLView) : QT_MANGLE_NAMESPACE(QCocoaView) -{ -} -- (id)initWithQWidget:(QWidget *)widget widgetPrivate:(QWidgetPrivate *)widgetprivate; -@end - -@implementation QT_MANGLE_NAMESPACE(QCocoaOpenGLView) -- (id)initWithQWidget:(QWidget *)widget widgetPrivate:(QWidgetPrivate *)widgetprivate -{ - self = [super initWithQWidget:widget widgetPrivate:widgetprivate]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(_surfaceNeedsUpdate:) - name:NSViewGlobalFrameDidChangeNotification - object:self]; - return self; -} - -- (void) _surfaceNeedsUpdate:(NSNotification*)notification -{ - Q_UNUSED(notification); - static_cast<QGLWidgetPrivate *>(qwidgetprivate)->glcx->updatePaintDevice(); -} -@end QT_BEGIN_NAMESPACE void *qt_current_nsopengl_context() @@ -435,6 +412,11 @@ void *QGLContextPrivate::tryFormat(const QGLFormat &format) #endif } +void QGLContextPrivate::clearDrawable() +{ + [static_cast<NSOpenGLContext *>(cx) clearDrawable]; +} + /*! \bold{Mac OS X only:} This virtual function tries to find a visual that matches the format, reducing the demands if the original request @@ -647,7 +629,7 @@ void QGLContext::updatePaintDevice() // ideally we would use QWidget::isVisible(), but we get "invalid drawable" errors if (![(NSWindow *)qt_mac_window_for(w) isVisible]) return; - if ([static_cast<NSOpenGLContext *>(d->cx) view] != view) + if ([static_cast<NSOpenGLContext *>(d->cx) view] != view && ![view isHidden]) [static_cast<NSOpenGLContext *>(d->cx) setView:view]; } else if (d->paintDevice->devType() == QInternal::Pixmap) { const QPixmap *pm = static_cast<const QPixmap *>(d->paintDevice); diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index b8bbeaf..16aaa96 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -234,6 +234,7 @@ public: #if defined(Q_WS_MAC) bool update; void *tryFormat(const QGLFormat &format); + void clearDrawable(); #endif QGLFormat glFormat; QGLFormat reqFormat; |