aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/opengl/util
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-07-31 20:40:56 +0200
committerSven Gothel <[email protected]>2011-07-31 20:40:56 +0200
commit99df2204c92eb06b37fba6ff75aa6b7f5e803502 (patch)
tree0620fc095a5009992ea1deab15311fe1186b9bda /src/jogl/classes/com/jogamp/opengl/util
parent3349511aeb68c1228e420b3c1ea1758bb75d3e03 (diff)
FixedFuncUtil: Name/Fix getFixedFuncImpl() -> wrapFixedFuncEmul()
Fix wrapFixedFuncEmul(): - only wrap if ES2 and (!ES1 || force) - return same profile if ES1 - otherwise throw exception
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/util')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/FixedFuncUtil.java18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/FixedFuncUtil.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/FixedFuncUtil.java
index 9d7eecb60..c2b3308db 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/FixedFuncUtil.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/FixedFuncUtil.java
@@ -15,29 +15,31 @@ import jogamp.opengl.util.glsl.fixedfunc.*;
public class FixedFuncUtil {
/**
* @return If gl is a GL2ES1 and force is false, return the type cast object,
- * otherwise create a fixed function emulation pipeline with the GL2ES2 impl.
+ * otherwise create a fixed function emulation pipeline using the given GL2ES2 impl
+ * and hook it to the GLContext via {@link GLContext#setGL(GL)}.
* @throws GLException if the GL object is neither GL2ES1 nor GL2ES2
*/
- public static final GL2ES1 getFixedFuncImpl(GL gl, boolean force) {
- if(!force && gl.isGL2ES1()) {
- return gl.getGL2ES1();
- } else if(gl.isGL2ES2()) {
+ public static final GL2ES1 wrapFixedFuncEmul(GL gl, boolean force) {
+ if(gl.isGL2ES2() && ( !gl.isGL2ES1() || force ) ) {
GL2ES2 es2 = gl.getGL2ES2();
FixedFuncHook hook = new FixedFuncHook(es2);
FixedFuncImpl impl = new FixedFuncImpl(es2, hook);
gl.getContext().setGL(impl);
return impl;
+ } else if(gl.isGL2ES1()) {
+ return gl.getGL2ES1();
}
throw new GLException("GL Object is neither GL2ES1 nor GL2ES2: "+gl.getContext());
}
/**
* @return If gl is a GL2ES1, return the type cast object,
- * otherwise create a fixed function emulation pipeline with the GL2ES2 impl.
+ * otherwise create a fixed function emulation pipeline using the GL2ES2 impl.
+ * and hook it to the GLContext via {@link GLContext#setGL(GL)}.
* @throws GLException if the GL object is neither GL2ES1 nor GL2ES2
*/
- public static final GL2ES1 getFixedFuncImpl(GL gl) {
- return getFixedFuncImpl(gl, false);
+ public static final GL2ES1 wrapFixedFuncEmul(GL gl) {
+ return wrapFixedFuncEmul(gl, false);
}
/**