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

pb compilation Qt4/5

parent f64d7887
...@@ -124,7 +124,6 @@ void MyQT::createMap() ...@@ -124,7 +124,6 @@ void MyQT::createMap()
// initialization GL callback // initialization GL callback
void MyQT::cb_initGL() void MyQT::cb_initGL()
{ {
// create the render // create the render
m_render = new Algo::Render::GL2::MapRender(); m_render = new Algo::Render::GL2::MapRender();
......
...@@ -53,7 +53,7 @@ ELSE() ...@@ -53,7 +53,7 @@ ELSE()
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
SOURCES ${shaders_src} ) SOURCES ${shaders_src} )
ENDIF() ENDIF()
add_dependencies(shader_target shader_to_h) #ensure that shader_to_h is compiled
file( file(
GLOB # WARNING NO MORE RECURSE TO AVOID TAKING QT FILES GLOB # WARNING NO MORE RECURSE TO AVOID TAKING QT FILES
......
...@@ -65,8 +65,6 @@ class CGoGN_UTILS_API GLWidget : public QGLWidget ...@@ -65,8 +65,6 @@ class CGoGN_UTILS_API GLWidget : public QGLWidget
public: public:
GLWidget(SimpleQT* cbs, QWidget *parent = 0); GLWidget(SimpleQT* cbs, QWidget *parent = 0);
GLWidget(SimpleQT* cbs, QGLFormat& format, QWidget *parent = 0);
~GLWidget(); ~GLWidget();
QSize minimumSizeHint() const; QSize minimumSizeHint() const;
......
...@@ -53,7 +53,6 @@ SimpleQGLV::SimpleQGLV() : ...@@ -53,7 +53,6 @@ SimpleQGLV::SimpleQGLV() :
m_modelView_matrix(m_mat.m_matrices[1]), m_modelView_matrix(m_mat.m_matrices[1]),
m_transfo_matrix(m_mat.m_matrices[2]) m_transfo_matrix(m_mat.m_matrices[2])
{ {
QGLFormat format;
if (GLSLShader::CURRENT_OGL_VERSION >= 3) if (GLSLShader::CURRENT_OGL_VERSION >= 3)
{ {
QGLFormat glFormat; QGLFormat glFormat;
......
...@@ -137,11 +137,14 @@ SimpleQT::SimpleQT(const SimpleQT& sqt): ...@@ -137,11 +137,14 @@ SimpleQT::SimpleQT(const SimpleQT& sqt):
{ {
if (GLSLShader::CURRENT_OGL_VERSION >= 3) if (GLSLShader::CURRENT_OGL_VERSION >= 3)
{ {
QGLFormat format = sqt.m_glWidget->format(); QGLFormat glFormat;
m_glWidget = new GLWidget(this,format); 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); setCentralWidget(m_glWidget);
...@@ -172,11 +175,14 @@ void SimpleQT::operator=(const SimpleQT& sqt) ...@@ -172,11 +175,14 @@ void SimpleQT::operator=(const SimpleQT& sqt)
{ {
if (GLSLShader::CURRENT_OGL_VERSION >= 3) if (GLSLShader::CURRENT_OGL_VERSION >= 3)
{ {
QGLFormat format = sqt.m_glWidget->format(); QGLFormat glFormat;
m_glWidget = new GLWidget(this,format); 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) ; setCentralWidget(m_glWidget) ;
......
...@@ -44,12 +44,7 @@ namespace QT ...@@ -44,12 +44,7 @@ namespace QT
float GLWidget::FAR_PLANE = 500.0f; float GLWidget::FAR_PLANE = 500.0f;
GLWidget::GLWidget(SimpleQT* cbs, QWidget *parent) : GLWidget::GLWidget(SimpleQT* cbs, QWidget *parent) :
#ifdef MAC_OSX QGLWidget(parent),
// 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
m_cbs(cbs), m_cbs(cbs),
m_state_modifier(0), m_state_modifier(0),
allow_rotation(true) allow_rotation(true)
...@@ -70,28 +65,6 @@ GLWidget::GLWidget(SimpleQT* cbs, QWidget *parent) : ...@@ -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() GLWidget::~GLWidget()
{ {
} }
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include <QKeyEvent> #include <QKeyEvent>
#include <QMouseEvent> #include <QMouseEvent>
#include <QWheelEvent> #include <QWheelEvent>
#include <QWindow>
namespace CGoGN 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