X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fvideoglwidget.cpp;h=9595ef254da658d7c1ab6126f071619fd915f230;hb=20accf400934e26f5665eb4a50346fb0ea0914af;hp=cbe08e3838c19826384e6d1870fedbef15787535;hpb=1ca75f8e1d52cc86df11c66eb6092d41c5b3bd50;p=kdenlive diff --git a/src/videoglwidget.cpp b/src/videoglwidget.cpp index cbe08e38..9595ef25 100644 --- a/src/videoglwidget.cpp +++ b/src/videoglwidget.cpp @@ -1,6 +1,11 @@ #include #include +#ifdef Q_WS_MAC +#include +#else +#include +#endif #include "videoglwidget.h" #ifndef GL_TEXTURE_RECTANGLE_EXT @@ -48,8 +53,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 +84,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);