diff --git a/src/Gui/CommandDoc.cpp b/src/Gui/CommandDoc.cpp index ae1be98eb..c7ea796cb 100644 --- a/src/Gui/CommandDoc.cpp +++ b/src/Gui/CommandDoc.cpp @@ -26,6 +26,8 @@ # include # include # include +# include +# include # include # include # include diff --git a/src/Gui/View3DInventor.cpp b/src/Gui/View3DInventor.cpp index 8d354c937..e1f035a4a 100644 --- a/src/Gui/View3DInventor.cpp +++ b/src/Gui/View3DInventor.cpp @@ -32,6 +32,8 @@ # include # include # include +# include +# include # include # include # include @@ -299,6 +301,29 @@ void View3DInventor::OnChange(ParameterGrp::SubjectType &rCaller,ParameterGrp::M else if (strcmp(Reason,"UseAntialiasing") == 0) { _viewer->getGLRenderAction()->setSmoothing(rGrp.GetBool("UseAntialiasing",false)); } + else if (strcmp(Reason,"SampleBuffers") == 0) { +#if SOQT_MAJOR_VERSION > 1 || (SOQT_MAJOR_VERSION == 1 && SOQT_MINOR_VERSION >= 5) + _viewer->setSampleBuffers(rGrp.GetInt("SampleBuffers",4)); +#else + // http://stackoverflow.com/questions/4207506/where-is-gl-multisample-defined + //int sb = rGrp.GetInt("SampleBuffers",4); + //QGLWidget* gl = static_cast(_viewer->getGLWidget()); + //QGLFormat fmt = gl->format(); + //if (sb > 0) { + // fmt.setSampleBuffers(true); + // fmt.setSamples(sb); + // gl->setFormat(fmt); + // gl->makeCurrent(); + // //glEnable(GL_MULTISAMPLE); + //} + //else { + // fmt.setSampleBuffers(false); + // gl->setFormat(fmt); + // gl->makeCurrent(); + // //glDisable(GL_MULTISAMPLE); + //} +#endif + } else if (strcmp(Reason,"ShowFPS") == 0) { _viewer->setEnabledFPSCounter(rGrp.GetBool("ShowFPS",false)); }