Skip to content

Commit

Permalink
Change OpenGL version to allowed minimum to make it run as much possi…
Browse files Browse the repository at this point in the history
…ble platforms.

Change vertex shader code to lower version.
  • Loading branch information
coozoo committed May 19, 2018
1 parent 36ac228 commit 01b42d3
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions openhantek/src/glscope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void GlScope::fixOpenGLversion(QSurfaceFormat::RenderableType t) {
format.setRenderableType(QSurfaceFormat::DefaultRenderableType);
QCoreApplication::setAttribute(Qt::AA_UseOpenGLES, true);
} else {
format.setVersion(3, 2);
format.setVersion(format.majorVersion(), format.minorVersion());
format.setRenderableType(QSurfaceFormat::OpenGL);
}
format.setProfile(QSurfaceFormat::NoProfile);
Expand Down Expand Up @@ -202,8 +202,9 @@ void GlScope::initializeGL() {
)";

const char *vshaderDesktop = R"(
#version 150
in highp vec3 vertex;
#version 120
//in highp vec3 vertex;
attribute vec3 vertex;
uniform mat4 matrix;
void main()
{
Expand All @@ -212,10 +213,13 @@ void GlScope::initializeGL() {
}
)";
const char *fshaderDesktop = R"(
#version 150
#version 120
uniform highp vec4 colour;
out vec4 flatColor;
void main() { flatColor = colour; }
//out vec4 flatColor;
void main()
{
gl_FragColor = colour;
}
)";

qDebug() << "compile shaders";
Expand Down

0 comments on commit 01b42d3

Please sign in to comment.