Browse Source

reduced required GLSL version to 1.2

naelstrof 7 years ago
parent
commit
ee76d8e0dc
2 changed files with 4 additions and 4 deletions
  1. 2
    2
      src/glrectangle.cpp
  2. 2
    2
      src/slop.cpp

+ 2
- 2
src/glrectangle.cpp View File

@@ -21,8 +21,8 @@ slop::GLRectangle::GLRectangle( glm::vec2 p1, glm::vec2 p2, float border, float
21 21
     our = ur + glm::vec2(border,border);
22 22
     obr = br + glm::vec2(border,-border);
23 23
     generateBuffers();
24
-    std::string vert = "#version 130\n in vec2 position;\n uniform mat4 projection;\n void main() {\n gl_Position = projection*vec4(position,0,1);\n }";
25
-    std::string frag = "#version 130\n uniform vec4 color;\n out vec4 outColor;\n void main() {\n outColor = color;\n }";
24
+    std::string vert = "#version 120\nattribute vec2 position;\nuniform mat4 projection;\nvoid main() {\ngl_Position = projection*vec4(position,0,1);\n}";
25
+    std::string frag = "#version 120\nuniform vec4 color;\nvoid main() {\ngl_FragColor = color;\n}";
26 26
 
27 27
     shader = new Shader( vert, frag, false );
28 28
 }

+ 2
- 2
src/slop.cpp View File

@@ -171,8 +171,8 @@ slop::SlopSelection slop::XShapeSlopSelect( slop::SlopOptions* options, bool* ca
171 171
 slop::SlopSelection slop::GLSlopSelect( slop::SlopOptions* options, bool* cancelled, SlopWindow* window ) {
172 172
     slop::mouse = new slop::Mouse( x11, options->nodecorations, window->window );
173 173
 
174
-    std::string vert = "#version 130\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 uvCoord;\nvoid main()\n{\nuvCoord = uv;\ngl_Position = vec4(position,0,1);\n}\n";
175
-    std::string frag = "#version 130\n uniform sampler2D texture;\n varying vec2 uvCoord;\n out vec4 outColor;\n void main()\n {\n outColor = texture2D( texture, uvCoord );\n }\n";
174
+    std::string vert = "#version 120\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 uvCoord;\nvoid main()\n{\nuvCoord = uv;\ngl_Position = vec4(position,0,1);\n}\n";
175
+    std::string frag = "#version 120\nuniform sampler2D texture;\nvarying vec2 uvCoord;\nvoid main()\n {\ngl_FragColor = texture2D( texture, uvCoord );\n}\n";
176 176
     slop::Shader* textured = new slop::Shader( vert, frag, false );
177 177
     std::vector<slop::Shader*> shaders;
178 178
     for( int i=0;i<options->shaders.size();i++ ) {