diff options
author | Sven Gothel <[email protected]> | 2009-03-16 15:33:10 +0000 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2009-03-16 15:33:10 +0000 |
commit | aefbc0323da190835bc146709bf560b3e3181b39 (patch) | |
tree | 0c025c00504372eb64ef0092b17186103d82bb58 /src/demos/es2/openmax | |
parent | b2c27c8edc2e9516a5341332a3480485d72eb6af (diff) |
sync with JOGL changes
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/branches/JOGL_2_SANDBOX@322 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
Diffstat (limited to 'src/demos/es2/openmax')
-rw-r--r-- | src/demos/es2/openmax/Cube.java | 42 | ||||
-rwxr-xr-x | src/demos/es2/openmax/MovieCube.java | 20 | ||||
-rwxr-xr-x | src/demos/es2/openmax/MovieSimple.java | 2 |
3 files changed, 14 insertions, 50 deletions
diff --git a/src/demos/es2/openmax/Cube.java b/src/demos/es2/openmax/Cube.java index d782bd3..44f607c 100644 --- a/src/demos/es2/openmax/Cube.java +++ b/src/demos/es2/openmax/Cube.java @@ -36,11 +36,10 @@ import javax.media.opengl.*; import javax.media.opengl.sub.fixed.*; import javax.media.opengl.util.*; import javax.media.opengl.glu.*; -import com.sun.opengl.util.glsl.fixed.*; -import com.sun.opengl.impl.fixed.GLFixedFuncImpl; import java.nio.*; import com.sun.javafx.newt.*; +import com.sun.javafx.newt.opengl.*; public class Cube implements GLEventListener { boolean quit = false; @@ -93,20 +92,7 @@ public class Cube implements GLEventListener { } public void init(GLAutoDrawable drawable) { - 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); - } - } + GL2ES1 gl = GLFixedFuncUtil.getFixedFuncImpl(drawable.getGL()); glu = GLU.createGLU(); @@ -126,11 +112,7 @@ public class Cube implements GLEventListener { public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { float aspect = (height != 0) ? ((float)width / (float)height) : 1.0f; - GLFixedFuncIf gl = GLFixedFuncUtil.getGLFixedFuncIf(drawable.getGL()); - GL2ES1 gl2es1=null; - if(gl.isGL2ES1()) { - gl2es1 = drawable.getGL().getGL2ES1(); - } + GL2ES1 gl = drawable.getGL().getGL2ES1(); gl.glViewport(0, 0, width, height); @@ -161,12 +143,10 @@ public class Cube implements GLEventListener { gl.glDisable(gl.GL_LIGHT0); } gl.glEnable(gl.GL_CULL_FACE); - if(null!=gl2es1) { - gl.glEnable(gl.GL_NORMALIZE); + gl.glEnable(gl.GL_NORMALIZE); - gl.glShadeModel(gl.GL_SMOOTH); - gl.glDisable(GL.GL_DITHER); - } + gl.glShadeModel(gl.GL_SMOOTH); + gl.glDisable(GL.GL_DITHER); gl.glEnableClientState(gl.GL_VERTEX_ARRAY); gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vboNames[0]); @@ -191,17 +171,13 @@ public class Cube implements GLEventListener { gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vboNames[3]); gl.glBufferData(GL.GL_ARRAY_BUFFER, cubeTexCoords.limit() * BufferUtil.SIZEOF_SHORT, cubeTexCoords, GL.GL_STATIC_DRAW); gl.glTexCoordPointer(2, gl.GL_SHORT, 0, 0); - if(null!=gl2es1) { - gl2es1.glTexEnvi(gl2es1.GL_TEXTURE_ENV, gl2es1.GL_TEXTURE_ENV_MODE, gl2es1.GL_INCR); - } + gl.glTexEnvi(gl.GL_TEXTURE_ENV, gl.GL_TEXTURE_ENV_MODE, gl.GL_INCR); } else { gl.glDisableClientState(gl.GL_TEXTURE_COORD_ARRAY); } gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0); - if(null!=gl2es1) { - gl2es1.glHint(gl2es1.GL_PERSPECTIVE_CORRECTION_HINT, gl2es1.GL_FASTEST); - } + gl.glHint(gl.GL_PERSPECTIVE_CORRECTION_HINT, gl.GL_FASTEST); gl.glMatrixMode(gl.GL_PROJECTION); gl.glLoadIdentity(); @@ -219,7 +195,7 @@ public class Cube implements GLEventListener { } public void display(GLAutoDrawable drawable) { - GLFixedFuncIf gl = GLFixedFuncUtil.getGLFixedFuncIf(drawable.getGL()); + GL2ES1 gl = drawable.getGL().getGL2ES1(); gl.glClear(gl.GL_COLOR_BUFFER_BIT | gl.GL_DEPTH_BUFFER_BIT); diff --git a/src/demos/es2/openmax/MovieCube.java b/src/demos/es2/openmax/MovieCube.java index 7e6c588..75fba14 100755 --- a/src/demos/es2/openmax/MovieCube.java +++ b/src/demos/es2/openmax/MovieCube.java @@ -39,8 +39,6 @@ import javax.media.nwi.*; 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.*; @@ -48,6 +46,7 @@ import java.nio.*; import java.net.*; import com.sun.javafx.newt.*; +import com.sun.javafx.newt.opengl.*; public class MovieCube implements MouseListener, GLEventListener, OMXEventListener { GLWindow window; @@ -125,20 +124,7 @@ public class MovieCube implements MouseListener, GLEventListener, OMXEventListen } public void init(GLAutoDrawable drawable) { - 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); - } - } + GL2ES1 gl = GLFixedFuncUtil.getFixedFuncImpl(drawable.getGL()); System.out.println(gl); gl.glGetError(); // flush error .. @@ -194,7 +180,7 @@ public class MovieCube implements MouseListener, GLEventListener, OMXEventListen } public void display(GLAutoDrawable drawable) { - GLFixedFuncIf gl = GLFixedFuncUtil.getGLFixedFuncIf(drawable.getGL()); + GL2ES1 gl = drawable.getGL().getGL2ES1(); com.sun.opengl.util.texture.Texture tex = null; if(null!=movie) { diff --git a/src/demos/es2/openmax/MovieSimple.java b/src/demos/es2/openmax/MovieSimple.java index c626bc2..376c576 100755 --- a/src/demos/es2/openmax/MovieSimple.java +++ b/src/demos/es2/openmax/MovieSimple.java @@ -39,6 +39,7 @@ import javax.media.opengl.*; import javax.media.opengl.util.*; import com.sun.opengl.util.glsl.*; +import com.sun.opengl.util.*; import com.sun.openmax.*; @@ -46,6 +47,7 @@ import java.nio.*; import java.net.*; import com.sun.javafx.newt.*; +import com.sun.javafx.newt.opengl.*; public class MovieSimple implements MouseListener, GLEventListener, OMXEventListener { private GLWindow window; |