Fix Periodic-3 demos

This commit is contained in:
Maxime Gimeno 2018-07-10 16:32:22 +02:00
parent 4ca9d8b83d
commit fcf16d31e3
2 changed files with 3 additions and 12 deletions

View File

@ -69,6 +69,7 @@ void Scene::compile_shaders()
"uniform highp mat4 mvp_matrix;\n"
"void main(void)\n"
"{\n"
" gl_PointSize = 5.0; \n"
" gl_Position = mvp_matrix * vertex; \n"
"}"
};
@ -796,8 +797,6 @@ void Scene::init() {
ui->viewer->setForegroundColor(Qt::red);
// OpenGL inits
glPointSize(10.0);
glLineWidth(1.0);
glEnable(GL_POINT_SMOOTH);
glEnable(GL_LINE_SMOOTH);
@ -828,8 +827,7 @@ void Scene::draw() {
change_material(materials[VERTEX_COLOR]);
attrib_buffers(ui->viewer);
rendering_program.bind();
glPointSize(5);
glEnable(GL_POINT_SMOOTH);
rendering_program.setUniformValue(colorLocation[0], color);
@ -843,7 +841,6 @@ void Scene::draw() {
attrib_buffers(ui->viewer);
rendering_program.bind();
glPointSize(5);
glEnable(GL_POINT_SMOOTH);
rendering_program.setUniformValue(colorLocation[0], color);
glDrawArrays(GL_POINTS, 0, 1);

View File

@ -38,10 +38,6 @@ Viewer::draw()
glEnable(GL_LINE_SMOOTH);
glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glPointSize(5);
glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);
glColor3f(0.2f, 0.2f, 1.f);
glEnable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(3.0f,-3.0f);
@ -56,9 +52,6 @@ Viewer::draw()
vao[0].release();
//The Lines
glLineWidth(1.);
glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);
glColor3ub(0,0,0);
glDisable(GL_POLYGON_OFFSET_FILL);
vao[1].bind();
@ -248,6 +241,7 @@ void Viewer::compile_shaders()
"uniform highp mat4 mvp_matrix;\n"
"void main(void)\n"
"{\n"
" gl_PointSize = 5.0; \n"
" gl_Position = mvp_matrix * vertex; \n"
"}"
};