summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/com')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java
index 131858271..b6908c1a1 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java
@@ -172,6 +172,27 @@ public class ShaderProgram {
return true;
}
+ /**
+ * Creates the empty GL program object using {@link GL2ES2#glCreateProgram()}
+ *
+ * @param gl
+ */
+ public final void init(GL2ES2 gl) {
+ if(0>shaderProgram) {
+ shaderProgram = gl.glCreateProgram();
+ }
+ }
+
+ /**
+ * Compiles and links the shader code to the program.
+ * Within this process, all GL resources (shader and program objects) are created if necessary.
+ *
+ * @param gl
+ * @param verboseOut
+ * @return
+ *
+ * @see #init(GL2ES2)
+ */
public synchronized boolean link(GL2ES2 gl, PrintStream verboseOut) {
if(programLinked) throw new GLException("Program is already linked");