From 38f80b10486bb7f10873d327564bfe075cabe54d Mon Sep 17 00:00:00 2001 From: Adrian Jeakins Date: Wed, 5 Dec 2018 22:27:04 +0000 Subject: Fix device view not showing anything on macOS. * Fix line shader when running under the core profile and make version match those elsewhere. * Make surface format version match the openGL functions we are using. --- gui/lineshader.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'gui/lineshader.h') diff --git a/gui/lineshader.h b/gui/lineshader.h index 98042051..74203261 100644 --- a/gui/lineshader.h +++ b/gui/lineshader.h @@ -172,10 +172,10 @@ class LineShader LineShader(QObject *parent) : parent_(parent), program_(nullptr) {} static constexpr const char *vertexShaderSource_ = - "#version 110\n" - "attribute highp vec2 position;\n" - "attribute highp vec2 normal;\n" - "attribute highp float miter;\n" + "#version 330\n" + "in highp vec2 position;\n" + "in highp vec2 normal;\n" + "in highp float miter;\n" "uniform highp float thickness;\n" "uniform highp mat4 projection;\n" "void main() {\n" @@ -183,10 +183,11 @@ class LineShader " gl_Position = projection * vec4(p, 0.0, 1.0);\n" "}\n"; - static constexpr const char *fragmentShaderSource_ = "#version 110\n" + static constexpr const char *fragmentShaderSource_ = "#version 330\n" "uniform lowp vec4 color;\n" + "out vec4 Out_Color;\n" "void main() {\n" - " gl_FragColor = color;\n" + " Out_Color = color;\n" "}\n"; // Must be called on initialization. -- cgit v1.2.3