Skip to content

Commit 56317a8

Browse files
committed
some edits to LowLevelGL example
1 parent 91e416b commit 56317a8

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

java/examples/Demos/Graphics/LowLevelGL/LowLevelGL.pde

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import java.nio.*;
33

44
PGL pgl;
5-
PShader flatShader;
5+
PShader sh;
66

77
int vertLoc;
88
int colorLoc;
@@ -18,7 +18,7 @@ void setup() {
1818

1919
// Loads a shader to render geometry w/out
2020
// textures and lights.
21-
flatShader = loadShader("frag.glsl", "vert.glsl");
21+
sh = loadShader("frag.glsl", "vert.glsl");
2222

2323
vertices = new float[12];
2424
vertData = allocateDirectFloatBuffer(12);
@@ -37,10 +37,10 @@ void draw() {
3737
updateGeometry();
3838

3939
pgl = beginPGL();
40-
flatShader.bind();
40+
sh.bind();
4141

42-
vertLoc = pgl.getAttribLocation(flatShader.glProgram, "vertex");
43-
colorLoc = pgl.getAttribLocation(flatShader.glProgram, "color");
42+
vertLoc = pgl.getAttribLocation(sh.glProgram, "vertex");
43+
colorLoc = pgl.getAttribLocation(sh.glProgram, "color");
4444

4545
pgl.enableVertexAttribArray(vertLoc);
4646
pgl.enableVertexAttribArray(colorLoc);
@@ -53,7 +53,7 @@ void draw() {
5353
pgl.disableVertexAttribArray(vertLoc);
5454
pgl.disableVertexAttribArray(colorLoc);
5555

56-
flatShader.unbind();
56+
sh.unbind();
5757

5858
endPGL();
5959
}

java/examples/Demos/Graphics/LowLevelGL/data/vert.glsl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
Boston, MA 02111-1307 USA
1919
*/
2020

21-
#define PROCESSING_COLOR_SHADER
22-
2321
uniform mat4 transform;
2422

2523
attribute vec4 vertex;

0 commit comments

Comments
 (0)