Commit 132c4078 authored by Jan Möbius's avatar Jan Möbius

Merge branch 'unstable' into 'master'

pull changes from Unstable to master branch

Closes #3

See merge request !38
parents 118bb540 b31da1d8
......@@ -4,12 +4,12 @@
OpenFlipper is developed on top of the Qt framework. This framework provides
easy cross platform development. Therefore an installed version of QT with
at least version 4.8.6 is required. We use the cmake MakeFile generator to build
at least version 5.5.1 is required. We use the cmake MakeFile generator to build
OpenFlipper.
\section reqlibs Required libraries
<ul>
<li> 5.5 >= Qt >= 4.8.6 ( http://www.qt.io/download/ ) Use the OpenGL version for Qt >= 5.0</li>
<li> 5.9 >= Qt >= 5.5.1 ( http://www.qt.io/download/ ) Use the OpenGL version for Qt >= 5.0</li>
<li> GLUT ( http://www.opengl.org/resources/libraries/glut/ )</li>
<li> GLEW (>=1.6) ( http://glew.sourceforge.net )</li>
</ul>
......
......@@ -5,6 +5,7 @@
- <b>Breaking changes</b>
- Picking functions use size_t instead of unsigned int now (Required to get rid of a lot of warnings during compilation)
- <b>Core</b>
- Use QOpenGLDebuglogger
- Queued cross plugin interconnection feature
- Use QOpenGLWidget
- Switched to Qt command line parsing and removed SimpleOpt
......
......@@ -133,6 +133,9 @@ glViewer::glViewer( QGraphicsScene* _scene,
projectionUpdateLocked_(false),
glScene_(_scene),
glWidget_(_glWidget),
#if (QT_VERSION >= QT_VERSION_CHECK(5,1,0))
glDebugLogger_(0),
#endif
pickCache_(0),
updatePickCache_(true),
pickCacheSupported_(true),
......@@ -210,6 +213,8 @@ glViewer::glViewer( QGraphicsScene* _scene,
glViewer::~glViewer()
{
delete glstate_;
deleteGLDebugLogger();
}
......@@ -1026,6 +1031,10 @@ void glViewer::initializeGL()
sceneGraph ( sceneGraphRoot_, maxPases,bbmin,bbmax,true);
viewAll();
}
// qt opengl info
startGLDebugLogger();
}
......@@ -2200,7 +2209,8 @@ void glViewer::slotPropertiesUpdated() {
}
void glViewer::snapshot(QImage& _image, int _width, int _height, bool _alpha, bool _hideCoordsys, int samples) {
makeCurrent();
int w = 0, h = 0, bak_w = 0, bak_h = 0, left = 0, bottom = 0;
glstate_->push_modelview_matrix();
......@@ -2240,7 +2250,6 @@ void glViewer::snapshot(QImage& _image, int _width, int _height, bool _alpha, bo
// it will fall back to the maximal supported number of samples
format.setSamples(samples);
makeCurrent();
QFramebufferObject fb(w,h,format);
if ( fb.isValid() ){
......
......@@ -118,6 +118,10 @@ class QOpenGLFramebufferObject;
class QOpenGLFramebufferObjectFormat;
#endif
#if (QT_VERSION >= QT_VERSION_CHECK(5,1,0))
class QOpenGLDebugLogger;
class QOpenGLDebugMessage;
#endif
//== CLASS DEFINITION =========================================================
......@@ -533,6 +537,11 @@ protected slots:
virtual void cleanupEventFilter()
{ removeEventFilter( sender());}
#if (QT_VERSION >= QT_VERSION_CHECK(5,1,0))
/// process opengl debug messages
void processGLDebugMessage(const QOpenGLDebugMessage& msg);
#endif
//----------------------------------------------------------- private functions
private:
......@@ -554,6 +563,9 @@ private:
/// draw the cursor
void drawCursor();
// start QOpenGLDebugLogger
void startGLDebugLogger();
void deleteGLDebugLogger();
//-------------------------------------------------------------- protected data
......@@ -608,6 +620,12 @@ private:
// Used to calculate the time passed between redraws
QTime redrawTime_;
#if (QT_VERSION >= QT_VERSION_CHECK(5,1,0))
// Get additional debug info from OpenGL
QOpenGLDebugLogger* glDebugLogger_;
#endif
//===========================================================================
/** @name Wheels
* @{ */
......
......@@ -69,6 +69,9 @@
#include <QOpenGLContext>
#endif
#if (QT_VERSION >= QT_VERSION_CHECK(5,1,0))
#include <QOpenGLDebugLogger>
#endif
//== NAMESPACES ===============================================================
......@@ -89,7 +92,47 @@ void glViewer::swapBuffers() {
//-----------------------------------------------------------------------------
void glViewer::startGLDebugLogger()
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,1,0))
if (OpenFlipper::Options::debug())
{
delete glDebugLogger_;
glDebugLogger_ = new QOpenGLDebugLogger(this);
if (glDebugLogger_->initialize())
{
connect(glDebugLogger_, SIGNAL(messageLogged(QOpenGLDebugMessage)), this, SLOT(processGLDebugMessage(QOpenGLDebugMessage)));
glDebugLogger_->startLogging();
}
}
#endif
}
//-----------------------------------------------------------------------------
void glViewer::deleteGLDebugLogger()
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,1,0))
makeCurrent();
delete glDebugLogger_;
#endif
}
//-----------------------------------------------------------------------------
#if (QT_VERSION >= QT_VERSION_CHECK(5,1,0))
void glViewer::processGLDebugMessage(const QOpenGLDebugMessage& msg)
{
if (msg.severity() & QOpenGLDebugMessage::HighSeverity)
std::cerr << msg.message().toStdString() << std::endl;
// also catch deprecated function calls in core profile
else if (!glstate_->compatibilityProfile() && msg.type() == QOpenGLDebugMessage::DeprecatedBehaviorType)
std::cerr << msg.message().toStdString() << std::endl;
}
#endif
//=============================================================================
......
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