Commit fdfe04b5 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[ADD] - added GLFormat for qtglwidget.

parent 50c9c6d1
......@@ -47,7 +47,7 @@ typedef osgViewer::GraphicsWindowWin32::WindowData WindowData;
WQtGLWidgetAll::WQtGLWidgetAll( std::string nameOfViewer, QWidget* parent, WGECamera::ProjectionMode projectionMode, const QGLWidget * shareWidget )
: QGLWidget( parent, shareWidget ),
: QGLWidget( getDefaultFormat(), parent, shareWidget ),
m_nameOfViewer( nameOfViewer ),
m_recommendedSize()
{
......@@ -243,3 +243,11 @@ void WQtGLWidgetAll::reset()
{
m_Viewer->reset();
}
const QGLFormat WQtGLWidgetAll::getDefaultFormat()
{
QGLFormat format;
format.setSwapInterval( 1 ); // according to Qt Doc, this should enable VSync. But it doesn't.
return format;
}
......@@ -30,6 +30,7 @@
#include <QtCore/QTimer>
#include <QtGui/QWidget>
#include <QtOpenGL/QGLWidget>
#include <QtOpenGL/QGLFormat>
#include <boost/shared_ptr.hpp>
#include <boost/signals2/signal.hpp>
......@@ -115,6 +116,13 @@ public:
*/
boost::shared_ptr< WGEViewer > getViewer() const;
/**
* Creates and returns a default OpenGL format description with vertical sync enabled.
*
* \return the format descriptor
*/
static const QGLFormat getDefaultFormat();
public slots:
/**
* Resets the contained view using the installed manipulator.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment