]> git.sesse.net Git - kdenlive/blobdiff - src/videoglwidget.cpp
Complete rewrite of the video4linux capture to use MLT, in progress.
[kdenlive] / src / videoglwidget.cpp
index e3b0c7506ad071a9b72cd25cb5561dd394cad292..d010b2253520c1b3d091ce62eeb74cb57f48c7bf 100644 (file)
@@ -48,8 +48,13 @@ void VideoGLWidget::initializeGL()
     glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
 }
 
+void VideoGLWidget::resizeEvent(QResizeEvent* event)
+{
+    resizeGL(event->size().width(),event->size().height());
+}
 void VideoGLWidget::resizeGL(int width, int height)
 {
+
     double this_aspect = (double) width / height;
 
     // Special case optimisation to negate odd effect of sample aspect ratio
@@ -74,12 +79,15 @@ void VideoGLWidget::resizeGL(int width, int height)
     glLoadIdentity();
     gluOrtho2D(0, width, height, 0);
     glMatrixMode(GL_MODELVIEW);
-    glClear(GL_COLOR_BUFFER_BIT); // | GL_DEPTH_BUFFER_BIT // Depth is disabled, so shouldn'b be necessary to clear DEPTH_BUFFER
+    glClear(GL_COLOR_BUFFER_BIT);
 }
 
 void VideoGLWidget::paintGL()
 {
     if (m_texture) {
+#ifdef Q_WS_MAC
+               glClear(GL_COLOR_BUFFER_BIT);
+#endif
         glEnable(GL_TEXTURE_RECTANGLE_EXT);
         glBegin(GL_QUADS);
         glTexCoord2i(0, 0);
@@ -120,7 +128,11 @@ void VideoGLWidget::mouseDoubleClickEvent(QMouseEvent * event)
     Qt::WindowFlags flags = windowFlags();
     if (!isFullScreen()) {
         // Check if we ahave a multiple monitor setup
+#if QT_VERSION >= 0x040600
         int monitors = QApplication::desktop()->screenCount();
+#else
+        int monitors = QApplication::desktop()->numScreens();
+#endif
         if (monitors > 1) {
             QRect screenres;
             // Move monitor widget to the second screen (one screen for Kdenlive, the other one for the Monitor widget