summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/glview.cc18
-rw-r--r--src/mainwin.cc2
2 files changed, 18 insertions, 2 deletions
diff --git a/src/glview.cc b/src/glview.cc
index 624b266..b8c3015 100644
--- a/src/glview.cc
+++ b/src/glview.cc
@@ -374,6 +374,19 @@ void GLView::setupOrtho(double distance, bool offset)
gluLookAt(0.0, -viewer_distance, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0);
}
+static bool running_under_wine()
+{
+ bool result=false;
+#ifdef _WIN32
+#include <windows.h>
+ HMODULE hntdll = GetModuleHandle(L"ntdll.dll"); // see Wine FAQ
+ if (hntdll)
+ if ( (void *)GetProcAddress(hntdll, "wine_get_version") )
+ result=true;
+#endif
+ return result;
+}
+
void GLView::paintGL()
{
glEnable(GL_LIGHTING);
@@ -528,6 +541,11 @@ void GLView::paintGL()
fmodf(360 - object_rot_x + 90, 360), fmodf(360 - object_rot_y, 360), fmodf(360 - object_rot_z, 360), viewer_distance);
statusLabel->setText(msg);
}
+
+ if (running_under_wine()) {
+ // wine+qglwidget autobufferswap not reliable. issue 160.
+ swapBuffers();
+ }
}
void GLView::keyPressEvent(QKeyEvent *event)
diff --git a/src/mainwin.cc b/src/mainwin.cc
index 0d3c148..3fdee6b 100644
--- a/src/mainwin.cc
+++ b/src/mainwin.cc
@@ -1173,8 +1173,6 @@ void MainWindow::actionCompile()
#endif
}
- glview->updateGL(); // issue 160
-
if (viewActionAnimate->isChecked() && e_dump->isChecked()) {
QImage img = this->glview->grabFrameBuffer();
QString filename;
contact: Jan Huwald // Impressum