disabled anti-aliasing from FlowGL until a solution for using glReadPixels will be found

This commit is contained in:
Luis Ángel San Martín 2015-01-13 19:57:00 +01:00
parent b9cc52bf23
commit ef74b04fcb

View File

@ -7,7 +7,7 @@
#ifdef Q_OS_MAC
#include <OpenGL/glu.h>
#else
#include <GL/glu.h>
#include <GL/glu.h>
#endif
#include <QGLContext>
@ -241,7 +241,7 @@ YACReaderFlowGL::YACReaderFlowGL(QWidget *parent,struct Preset p)
QSurfaceFormat f = format();
//TODO add antialiasing
f.setSamples(4);
//f.setSamples(4);
f.setVersion(2, 1);
f.setSwapInterval(0);
setFormat(f);
@ -1084,6 +1084,7 @@ void YACReaderFlowGL::keyPressEvent(QKeyEvent *event)
void YACReaderFlowGL::mousePressEvent(QMouseEvent *event)
{
makeCurrent();
if(event->button() == Qt::LeftButton)
{
float x,y;
@ -1101,9 +1102,10 @@ void YACReaderFlowGL::mousePressEvent(QMouseEvent *event)
winX = (float)x;
winY = (float)viewport[3] - (float)y;
glReadPixels( x, int(winY), 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &winZ );
gluUnProject( winX, winY, winZ, modelview, projection, viewport, &posX, &posY, &posZ);
glReadPixels(winX, int(winY), 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &winZ );
gluUnProject(winX, winY, winZ, modelview, projection, viewport, &posX, &posY, &posZ);
if(posX >= 0.5)
{
@ -1117,35 +1119,37 @@ void YACReaderFlowGL::mousePressEvent(QMouseEvent *event)
showPrevious();
} else
QOpenGLWidget::mousePressEvent(event);
doneCurrent();
}
void YACReaderFlowGL::mouseDoubleClickEvent(QMouseEvent* event)
{
float x,y;
x = event->x();
y = event->y();
GLint viewport[4];
GLdouble modelview[16];
GLdouble projection[16];
GLfloat winX, winY, winZ;
GLdouble posX, posY, posZ;
makeCurrent();
float x,y;
x = event->x();
y = event->y();
GLint viewport[4];
GLdouble modelview[16];
GLdouble projection[16];
GLfloat winX, winY, winZ;
GLdouble posX, posY, posZ;
glGetDoublev( GL_MODELVIEW_MATRIX, modelview );
glGetDoublev( GL_PROJECTION_MATRIX, projection );
glGetIntegerv( GL_VIEWPORT, viewport );
glGetDoublev( GL_MODELVIEW_MATRIX, modelview );
glGetDoublev( GL_PROJECTION_MATRIX, projection );
glGetIntegerv( GL_VIEWPORT, viewport );
winX = (float)x;
winY = (float)viewport[3] - (float)y;
glReadPixels( x, int(winY), 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &winZ );
winX = (float)x;
winY = (float)viewport[3] - (float)y;
glReadPixels( x, int(winY), 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &winZ );
gluUnProject( winX, winY, winZ, modelview, projection, viewport, &posX, &posY, &posZ);
if(posX <= 0.5 && posX >= -0.5)
{
emit selected(centerIndex());
event->accept();
}
gluUnProject( winX, winY, winZ, modelview, projection, viewport, &posX, &posY, &posZ);
if(posX <= 0.5 && posX >= -0.5)
{
emit selected(centerIndex());
event->accept();
}
doneCurrent();
}
YACReaderComicFlowGL::YACReaderComicFlowGL(QWidget *parent,struct Preset p )