Commit 3a0ae6e5 authored by WINTZ Julien's avatar WINTZ Julien

Merging #8.

parent 505b20c4
......@@ -73,7 +73,6 @@ dtkVisualizationCanvasPrivate::dtkVisualizationCanvasPrivate(QWidget *parent) :
this->hud = new dtkWidgetsHUD(parent);
this->overlay = new dtkWidgetsOverlayPane(parent);
// this->overlay->setToggleToolTip("Settings");
this->overlay->setBound(300);
this->overlay->toggle();
......
......@@ -125,7 +125,6 @@ dtkVisualizationPlot2DPrivate::dtkVisualizationPlot2DPrivate(QWidget *parent) :
this->hud = new dtkWidgetsHUD(parent);
this->overlay = new dtkWidgetsOverlayPane(parent);
// this->overlay->setToggleToolTip("Plot settings");
this->fields_table = vtkSmartPointer<vtkTable>::New();
......
......@@ -194,6 +194,7 @@ void dtkVisualizationViewVideo::setImage(const QImage& image)
d->render_image = image;
d->recalculatePosition();
d->updateScene();
}
......
......@@ -22,7 +22,6 @@ out vec4 color;
void main()
{
// color = vec4( abs(coord.x), abs(coord.y), 0.0, 1);
color = vec4(texture(tex, coord));
}
......
......@@ -106,10 +106,12 @@ void dtkVisualizationViewVideoGLPrivate::setVersion(int major, int minor, bool d
this->context->setFormat(format);
this->context->create();
qDebug() << Q_FUNC_INFO << this->context << this->context->shareContext() << QOpenGLContext::globalShareContext();
qDebug() << Q_FUNC_INFO << this->context->format();
qDebug() << Q_FUNC_INFO << this->context->surface();
qDebug() << "--------------------------------------------";
if (QOpenGLWidget::context()->hasExtension(QByteArrayLiteral("GL_KHR_debug"))) {
qDebug() << Q_FUNC_INFO << this->context << this->context->shareContext() << QOpenGLContext::globalShareContext();
qDebug() << Q_FUNC_INFO << this->context->format();
qDebug() << Q_FUNC_INFO << this->context->surface();
qDebug() << "--------------------------------------------";
}
}
void dtkVisualizationViewVideoGLPrivate::createShaderProgram(void)
......@@ -197,10 +199,12 @@ void dtkVisualizationViewVideoGLPrivate::createTexture(void)
void dtkVisualizationViewVideoGLPrivate::initializeGL(void)
{
qDebug() << Q_FUNC_INFO << 1 << this->context << this->context->shareContext() << QOpenGLContext::globalShareContext();
qDebug() << Q_FUNC_INFO << 1 << this->context->format();
qDebug() << "--------------------------------------------";
if (QOpenGLWidget::context()->hasExtension(QByteArrayLiteral("GL_KHR_debug"))) {
qDebug() << Q_FUNC_INFO << 1 << this->context << this->context->shareContext() << QOpenGLContext::globalShareContext();
qDebug() << Q_FUNC_INFO << 1 << this->context->format();
qDebug() << "--------------------------------------------";
}
QOpenGLFunctions::initializeOpenGLFunctions();
createShaderProgram();
......@@ -209,10 +213,16 @@ void dtkVisualizationViewVideoGLPrivate::initializeGL(void)
view_matrix.setToIdentity();
// glEnable(GL_DEPTH_TEST);
// glEnable(GL_TEXTURE_2D);
// /////////////////////////////////////////////////////////////////////////////
// TODO: Make sure works for both 2.1 & 4.1 formats
// /////////////////////////////////////////////////////////////////////////////
// glEnable(GL_DEPTH_TEST);
// glEnable(GL_TEXTURE_2D);
// glActiveTexture(GL_TEXTURE0);
// glActiveTexture(GL_TEXTURE0);
// /////////////////////////////////////////////////////////////////////////////
pgm.setUniformValue("tex", 0);
......@@ -224,9 +234,11 @@ void dtkVisualizationViewVideoGLPrivate::initializeGL(void)
createGeometry();
qDebug() << Q_FUNC_INFO << 2 << this->context << this->context->shareContext() << QOpenGLContext::globalShareContext();
qDebug() << Q_FUNC_INFO << 2 << this->context->format();
qDebug() << "--------------------------------------------";
if (QOpenGLWidget::context()->hasExtension(QByteArrayLiteral("GL_KHR_debug"))) {
qDebug() << Q_FUNC_INFO << 2 << this->context << this->context->shareContext() << QOpenGLContext::globalShareContext();
qDebug() << Q_FUNC_INFO << 2 << this->context->format();
qDebug() << "--------------------------------------------";
}
}
void dtkVisualizationViewVideoGLPrivate::resizeGL(int w, int h)
......@@ -248,15 +260,15 @@ void dtkVisualizationViewVideoGLPrivate::resizeGL(int w, int h)
void dtkVisualizationViewVideoGLPrivate::paintGL(void)
{
// this->context->makeCurrent();
qDebug() << Q_FUNC_INFO;
qDebug() << "Current context:" << QOpenGLWidget::context();
qDebug() << "Current context:" << QOpenGLWidget::context()->format();
qDebug() << " THIS context:" << this->context << this->context->shareContext() << QOpenGLContext::globalShareContext();
qDebug() << " THIS context:" << this->context->format();
qDebug() << "------------------------------------------";
if (QOpenGLWidget::context()->hasExtension(QByteArrayLiteral("GL_KHR_debug"))) {
qDebug() << Q_FUNC_INFO;
qDebug() << "Current context:" << QOpenGLWidget::context();
qDebug() << "Current context:" << QOpenGLWidget::context()->format();
qDebug() << " THIS context:" << this->context << this->context->shareContext() << QOpenGLContext::globalShareContext();
qDebug() << " THIS context:" << this->context->format();
qDebug() << "------------------------------------------";
}
if(this->buffer.isNull())
return;
......@@ -349,10 +361,12 @@ void dtkVisualizationViewVideoGL::setVersion( int major, int minor, bool debug)
QWidget *dtkVisualizationViewVideoGL::widget(void)
{
qDebug() << Q_FUNC_INFO << d->context << d->context->shareContext() << QOpenGLContext::globalShareContext();
qDebug() << Q_FUNC_INFO << d->format();
qDebug() << "--------------------------------------------";
if (d->QOpenGLWidget::context()->hasExtension(QByteArrayLiteral("GL_KHR_debug"))) {
qDebug() << Q_FUNC_INFO << d->context << d->context->shareContext() << QOpenGLContext::globalShareContext();
qDebug() << Q_FUNC_INFO << d->format();
qDebug() << "--------------------------------------------";
}
return d;
}
......
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