mirror of https://github.com/CGAL/cgal
workaround for multiple linking under windows.
This commit is contained in:
parent
ab3ad395fc
commit
c3fab3df15
|
|
@ -1217,6 +1217,7 @@ protected:
|
||||||
//C o n t e x t
|
//C o n t e x t
|
||||||
bool is_ogl_4_3;
|
bool is_ogl_4_3;
|
||||||
bool is_sharing;
|
bool is_sharing;
|
||||||
|
bool is_linked;
|
||||||
QOpenGLContext* shared_context;
|
QOpenGLContext* shared_context;
|
||||||
public:
|
public:
|
||||||
//! Is used to know if the openGL context is 4.3 or ES 2.0.
|
//! Is used to know if the openGL context is 4.3 or ES 2.0.
|
||||||
|
|
|
||||||
|
|
@ -160,6 +160,7 @@ void CGAL::QGLViewer::defaultConstructor() {
|
||||||
_offset = CGAL::qglviewer::Vec(0,0,0);
|
_offset = CGAL::qglviewer::Vec(0,0,0);
|
||||||
stored_fbo = NULL;
|
stored_fbo = NULL;
|
||||||
is_sharing = false;
|
is_sharing = false;
|
||||||
|
is_linked = false;
|
||||||
shared_context = nullptr;
|
shared_context = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -275,7 +276,7 @@ void CGAL::QGLViewer::initializeGL() {
|
||||||
{
|
{
|
||||||
vbos[i].create();
|
vbos[i].create();
|
||||||
}
|
}
|
||||||
//program without light
|
if(!is_linked)
|
||||||
{
|
{
|
||||||
//Vertex source code
|
//Vertex source code
|
||||||
const char v_s[] =
|
const char v_s[] =
|
||||||
|
|
@ -361,9 +362,6 @@ void CGAL::QGLViewer::initializeGL() {
|
||||||
{
|
{
|
||||||
qDebug() << rendering_program.log();
|
qDebug() << rendering_program.log();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
//program with light
|
|
||||||
{
|
|
||||||
//Vertex source code
|
//Vertex source code
|
||||||
const char vertex_source[] =
|
const char vertex_source[] =
|
||||||
{
|
{
|
||||||
|
|
@ -476,8 +474,6 @@ void CGAL::QGLViewer::initializeGL() {
|
||||||
//It is said in the doc that a QOpenGLShader is
|
//It is said in the doc that a QOpenGLShader is
|
||||||
// only destroyed with the QOpenGLShaderProgram
|
// only destroyed with the QOpenGLShaderProgram
|
||||||
//it has been linked with.
|
//it has been linked with.
|
||||||
QOpenGLShader vertex_shader(QOpenGLShader::Vertex);
|
|
||||||
QOpenGLShader fragment_shader(QOpenGLShader::Fragment);
|
|
||||||
if(is_ogl_4_3)
|
if(is_ogl_4_3)
|
||||||
{
|
{
|
||||||
if(!vertex_shader.compileSourceCode(vertex_source))
|
if(!vertex_shader.compileSourceCode(vertex_source))
|
||||||
|
|
@ -516,7 +512,7 @@ void CGAL::QGLViewer::initializeGL() {
|
||||||
qDebug() << rendering_program_light.log();
|
qDebug() << rendering_program_light.log();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
is_linked = true;
|
||||||
// Give time to glInit to finish and then call setFullScreen().
|
// Give time to glInit to finish and then call setFullScreen().
|
||||||
if (isFullScreen())
|
if (isFullScreen())
|
||||||
QTimer::singleShot(100, this, SLOT(delayedFullScreen()));
|
QTimer::singleShot(100, this, SLOT(delayedFullScreen()));
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,6 @@ public:
|
||||||
//! Decides if the distance between APoint and BPoint must be drawn;
|
//! Decides if the distance between APoint and BPoint must be drawn;
|
||||||
bool distance_is_displayed;
|
bool distance_is_displayed;
|
||||||
bool i_is_pressed;
|
bool i_is_pressed;
|
||||||
bool initialized;
|
|
||||||
bool z_is_pressed;
|
bool z_is_pressed;
|
||||||
QImage static_image;
|
QImage static_image;
|
||||||
//!Draws the distance between two selected points.
|
//!Draws the distance between two selected points.
|
||||||
|
|
@ -249,7 +248,6 @@ void Viewer::doBindings()
|
||||||
d->spec_power = viewer_settings.value("spec_power", 51.8).toFloat();
|
d->spec_power = viewer_settings.value("spec_power", 51.8).toFloat();
|
||||||
d->scene = 0;
|
d->scene = 0;
|
||||||
d->projection_is_ortho = false;
|
d->projection_is_ortho = false;
|
||||||
d->initialized = false;
|
|
||||||
d->twosides = false;
|
d->twosides = false;
|
||||||
this->setProperty("draw_two_sides", false);
|
this->setProperty("draw_two_sides", false);
|
||||||
d->macro_mode = false;
|
d->macro_mode = false;
|
||||||
|
|
@ -460,6 +458,7 @@ void Viewer::init()
|
||||||
d->buffer.create();
|
d->buffer.create();
|
||||||
|
|
||||||
//setting the program used for the distance
|
//setting the program used for the distance
|
||||||
|
if(!is_linked)
|
||||||
{
|
{
|
||||||
//Vertex source code
|
//Vertex source code
|
||||||
const char vertex_source_dist[] =
|
const char vertex_source_dist[] =
|
||||||
|
|
@ -544,7 +543,6 @@ void Viewer::init()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
d->painter = new QPainter();
|
d->painter = new QPainter();
|
||||||
d->initialized = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
|
|
@ -1332,8 +1330,6 @@ QPainter* Viewer::getPainter(){return d->painter;}
|
||||||
|
|
||||||
void Viewer::paintEvent(QPaintEvent *)
|
void Viewer::paintEvent(QPaintEvent *)
|
||||||
{
|
{
|
||||||
if(!d->initialized)
|
|
||||||
initializeGL();
|
|
||||||
paintGL();
|
paintGL();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue