Context 3.3 Core changed into 2.1

This commit is contained in:
Maxime Gimeno 2015-08-10 08:59:54 +02:00
parent 71b0fd8d31
commit 7d220d3da8
3 changed files with 9 additions and 9 deletions

View File

@ -29,14 +29,14 @@ void Viewer::compile_shaders()
//Vertex source code
const char vertex_source[] =
{
"#version 330 \n"
"#version 120 \n"
"in highp vec4 vertex;\n"
"in highp vec3 normal;\n"
"uniform highp mat4 mvp_matrix;\n"
"uniform highp mat4 mv_matrix; \n"
"out highp vec4 fP; \n"
"out highp vec3 fN; \n"
"varying highp vec4 fP; \n"
"varying highp vec3 fN; \n"
"void main(void)\n"
"{\n"
" fP = mv_matrix * vertex; \n"
@ -47,7 +47,7 @@ void Viewer::compile_shaders()
//Vertex source code
const char fragment_source[] =
{
"#version 330 \n"
"#version 120 \n"
"in highp vec4 fP; \n"
"in highp vec3 fN; \n"
"uniform highp vec4 color; \n"
@ -105,7 +105,7 @@ rendering_program.bind();
//Vertex source code
const char vertex_source_points[] =
{
"#version 330 \n"
"#version 120 \n"
"in highp vec4 vertex;\n"
"uniform highp mat4 mvp_matrix;\n"
@ -117,7 +117,7 @@ const char vertex_source_points[] =
//Vertex source code
const char fragment_source_points[] =
{
"#version 330 \n"
"#version 120 \n"
"uniform highp vec4 color; \n"
"void main(void) { \n"

View File

@ -3,13 +3,13 @@
#include "typedefs.h"
#include <QGLViewer/qglviewer.h>
#include <QOpenGLFunctions_3_3_Core>
#include <QOpenGLFunctions_2_1>
#include <QOpenGLVertexArrayObject>
#include <QOpenGLBuffer>
#include <QOpenGLShaderProgram>
class Viewer : public QGLViewer, protected QOpenGLFunctions_3_3_Core{
class Viewer : public QGLViewer, protected QOpenGLFunctions_2_1{
Q_OBJECT
CGAL::Timer timer;

View File

@ -27,7 +27,7 @@ inline QGLContext* createOpenGLContext()
{
QOpenGLContext *context = new QOpenGLContext();
QSurfaceFormat format;
format.setVersion(3,3);
format.setVersion(2,1);
format.setProfile(QSurfaceFormat::CompatibilityProfile);
context->setFormat(format);
return QGLContext::fromOpenGLContext(context);