diff options
Diffstat (limited to 'src/demos/es2/openmax/MovieCube.java')
-rwxr-xr-x | src/demos/es2/openmax/MovieCube.java | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/demos/es2/openmax/MovieCube.java b/src/demos/es2/openmax/MovieCube.java index 5af3081..e52783f 100755 --- a/src/demos/es2/openmax/MovieCube.java +++ b/src/demos/es2/openmax/MovieCube.java @@ -37,6 +37,9 @@ package demos.es2.openmax; import javax.media.opengl.*; import javax.media.opengl.util.*; +import javax.media.opengl.sub.fixed.*; +import com.sun.opengl.util.glsl.fixed.*; +import com.sun.opengl.impl.fixed.GLFixedFuncImpl; import com.sun.openmax.*; @@ -121,12 +124,21 @@ public class MovieCube implements MouseListener, GLEventListener, OMXEventListen } public void init(GLAutoDrawable drawable) { - GL gl = drawable.getGL(); - - if(gl.isGLES2()) { - gl.getGLES2().enableFixedFunctionEmulationMode(GLES2.FIXED_EMULATION_VERTEXCOLORTEXTURE); - System.err.println("MovieCube Fixed emu: FIXED_EMULATION_VERTEXCOLORTEXTURE"); + GLFixedFuncIf gl; + { + GL _gl = drawable.getGL(); + if(!GLFixedFuncUtil.isGLFixedFuncIf(_gl)) { + if(_gl.isGLES2()) { + gl = new GLFixedFuncImpl(_gl, new FixedFuncHook(_gl.getGL2ES2())); + } else { + gl = new GLFixedFuncImpl(_gl, _gl.getGL2ES1()); + } + _gl.getContext().setGL(gl); + } else { + gl = GLFixedFuncUtil.getGLFixedFuncIf(_gl); + } } + System.out.println(gl); gl.glGetError(); // flush error .. @@ -171,7 +183,7 @@ public class MovieCube implements MouseListener, GLEventListener, OMXEventListen } public void display(GLAutoDrawable drawable) { - GL gl = drawable.getGL(); + GLFixedFuncIf gl = GLFixedFuncUtil.getGLFixedFuncIf(drawable.getGL()); com.sun.opengl.util.texture.Texture tex = null; if(null!=movie) { |