diff options
author | Sven Gothel <[email protected]> | 2012-12-23 06:58:20 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-12-23 06:58:20 +0100 |
commit | 1c1e83011a726f49aa29a40df81f7bceceba31f8 (patch) | |
tree | acbfe6e845359587707f6c53a9e308b4ff868210 /src/demos/es2/perftst/PerfModule.java | |
parent | cbc8b07376eb3aab3c35d768b3323159bd79a4a1 (diff) |
Adapt to JOGL ShaderState changes - track our own instance.
Diffstat (limited to 'src/demos/es2/perftst/PerfModule.java')
-rw-r--r-- | src/demos/es2/perftst/PerfModule.java | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/src/demos/es2/perftst/PerfModule.java b/src/demos/es2/perftst/PerfModule.java index 218b49c..1418038 100644 --- a/src/demos/es2/perftst/PerfModule.java +++ b/src/demos/es2/perftst/PerfModule.java @@ -1,22 +1,35 @@ package demos.es2.perftst; -import java.nio.*; -import javax.media.opengl.*; +import java.nio.Buffer; +import java.nio.ByteBuffer; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; +import java.nio.ShortBuffer; + +import javax.media.opengl.GL; +import javax.media.opengl.GL2ES2; +import javax.media.opengl.GLAutoDrawable; +import javax.media.opengl.GLException; import com.jogamp.opengl.math.FixedPoint; -import com.jogamp.opengl.util.*; -import com.jogamp.opengl.util.glsl.*; +import com.jogamp.opengl.util.glsl.ShaderCode; +import com.jogamp.opengl.util.glsl.ShaderProgram; +import com.jogamp.opengl.util.glsl.ShaderState; public abstract class PerfModule { - public abstract void initShaderState(GL2ES2 gl); + public abstract ShaderState initShaderState(GL2ES2 gl); public abstract void run(GLAutoDrawable drawable, int loops); ShaderState st = null; - public void initShaderState(GL2ES2 gl, String vShaderName, String fShaderName) { - if(st!=null) return; + public ShaderState getShaderState() { return st; } + + public ShaderState initShaderState(GL2ES2 gl, String vShaderName, String fShaderName) { + if(st!=null) { + return st; + } long t0, t1; @@ -47,6 +60,8 @@ public abstract class PerfModule { // Let's manage all our states using ShaderState. st.attachShaderProgram(gl, sp, true); + + return st; } public static final void put(Buffer buffer, int type, float v) { |