Commit 3ae34e1a authored by Sylvain Thery's avatar Sylvain Thery

pb compilation Qt4/5

parent f64d7887
......@@ -124,7 +124,6 @@ void MyQT::createMap()
// initialization GL callback
void MyQT::cb_initGL()
{
// create the render
m_render = new Algo::Render::GL2::MapRender();
......
......@@ -53,7 +53,7 @@ ELSE()
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
SOURCES ${shaders_src} )
ENDIF()
add_dependencies(shader_target shader_to_h) #ensure that shader_to_h is compiled
file(
GLOB # WARNING NO MORE RECURSE TO AVOID TAKING QT FILES
......
......@@ -65,8 +65,6 @@ class CGoGN_UTILS_API GLWidget : public QGLWidget
public:
GLWidget(SimpleQT* cbs, QWidget *parent = 0);
GLWidget(SimpleQT* cbs, QGLFormat& format, QWidget *parent = 0);
~GLWidget();
QSize minimumSizeHint() const;
......
......@@ -53,7 +53,6 @@ SimpleQGLV::SimpleQGLV() :
m_modelView_matrix(m_mat.m_matrices[1]),
m_transfo_matrix(m_mat.m_matrices[2])
{
QGLFormat format;
if (GLSLShader::CURRENT_OGL_VERSION >= 3)
{
QGLFormat glFormat;
......
......@@ -137,11 +137,14 @@ SimpleQT::SimpleQT(const SimpleQT& sqt):
{
if (GLSLShader::CURRENT_OGL_VERSION >= 3)
{
QGLFormat format = sqt.m_glWidget->format();
m_glWidget = new GLWidget(this,format);
QGLFormat glFormat;
glFormat.setVersion( Utils::GLSLShader::MAJOR_OGL_CORE, Utils::GLSLShader::MINOR_OGL_CORE);
glFormat.setProfile( QGLFormat::CoreProfile ); // Requires >=Qt-4.8.0
glFormat.setSampleBuffers( true );
QGLFormat::setDefaultFormat(glFormat);
}
else
m_glWidget = new GLWidget(this);
m_glWidget = new GLWidget(this);
setCentralWidget(m_glWidget);
......@@ -172,11 +175,14 @@ void SimpleQT::operator=(const SimpleQT& sqt)
{
if (GLSLShader::CURRENT_OGL_VERSION >= 3)
{
QGLFormat format = sqt.m_glWidget->format();
m_glWidget = new GLWidget(this,format);
QGLFormat glFormat;
glFormat.setVersion( Utils::GLSLShader::MAJOR_OGL_CORE, Utils::GLSLShader::MINOR_OGL_CORE);
glFormat.setProfile( QGLFormat::CoreProfile ); // Requires >=Qt-4.8.0
glFormat.setSampleBuffers( true );
QGLFormat::setDefaultFormat(glFormat);
}
else
m_glWidget = new GLWidget(this);
m_glWidget = new GLWidget(this);
setCentralWidget(m_glWidget) ;
......
......@@ -44,12 +44,7 @@ namespace QT
float GLWidget::FAR_PLANE = 500.0f;
GLWidget::GLWidget(SimpleQT* cbs, QWidget *parent) :
#ifdef MAC_OSX
// QGLWidget(new Core3_2_context(QGLFormat::defaultFormat()),parent),
QGLWidget(QGLFormat(QGL::Rgba | QGL::DoubleBuffer| QGL::DepthBuffer), parent),
#else
QGLWidget(QGLFormat(QGL::Rgba | QGL::DoubleBuffer| QGL::DepthBuffer), parent),
#endif
QGLWidget(parent),
m_cbs(cbs),
m_state_modifier(0),
allow_rotation(true)
......@@ -70,28 +65,6 @@ GLWidget::GLWidget(SimpleQT* cbs, QWidget *parent) :
}
GLWidget::GLWidget(SimpleQT* cbs, QGLFormat& format, QWidget *parent) :
QGLWidget(format, parent),
m_cbs(cbs),
m_state_modifier(0),
allow_rotation(true)
{
makeCurrent();
glewExperimental = GL_TRUE;
glewInit();
newModel = 1;
m_cbs->trans_x() = 0.;
m_cbs->trans_y() = 0.;
float f = FAR_PLANE;
m_cbs->trans_z() = -f / 5.0f;
foc = 2.0f;
// init trackball
trackball(m_cbs->curquat(), 0.0f, 0.0f, 0.0f, 0.0f);
}
GLWidget::~GLWidget()
{
}
......
......@@ -13,7 +13,6 @@
#include <QKeyEvent>
#include <QMouseEvent>
#include <QWheelEvent>
#include <QWindow>
namespace CGoGN
{
......
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