diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/glview.cc | 13 | ||||
-rw-r--r-- | src/version_check.h | 2 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/glview.cc b/src/glview.cc index 624b266..859bf82 100644 --- a/src/glview.cc +++ b/src/glview.cc @@ -69,6 +69,8 @@ GLView::GLView(const QGLFormat & format, QWidget *parent) : QGLWidget(format, pa init(); } +static bool running_under_wine = false; + void GLView::init() { this->viewer_distance = 500; @@ -100,6 +102,15 @@ void GLView::init() static int sId = 0; this->opencsg_id = sId++; #endif + +// see paintGL() + issue160 + wine FAQ +#ifdef _WIN32 +#include <windows.h> + HMODULE hntdll = GetModuleHandle(L"ntdll.dll"); + if (hntdll) + if ( (void *)GetProcAddress(hntdll, "wine_get_version") ) + running_under_wine = true; +#endif } void GLView::setRenderer(Renderer *r) @@ -528,6 +539,8 @@ 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) swapBuffers(); } void GLView::keyPressEvent(QKeyEvent *event) diff --git a/src/version_check.h b/src/version_check.h index 9b98c92..a9556e9 100644 --- a/src/version_check.h +++ b/src/version_check.h @@ -85,7 +85,7 @@ a time, to avoid confusion. #endif // ENABLE_OPENCSG #include <QtCore/qglobal.h> -#if QT_VERSION < 0x040603 +#if QT_VERSION < 0x040400 #error QT library missing or version too old. See README.md. To force compile, run qmake CONFIG=skip-version-check #endif // QT |