summaryrefslogtreecommitdiffstats
path: root/src/demos/vertexProgWarp/VertexProgWarp.java
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2008-11-21 01:09:31 +0000
committerKenneth Russel <[email protected]>2008-11-21 01:09:31 +0000
commit985276e9c7eea8b85936435eff35e10ed113840b (patch)
treea4fdc33ee42a49cc834ace4171c7a21e0ffa2882 /src/demos/vertexProgWarp/VertexProgWarp.java
parentf25bdef3b6bc423a08390ab17e86897c85b71282 (diff)
Changed gleem to explicitly declare AWT dependencies. Updated all
demos. All demos now build cleanly. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/branches/JOGL_2_SANDBOX@291 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
Diffstat (limited to 'src/demos/vertexProgWarp/VertexProgWarp.java')
-rw-r--r--src/demos/vertexProgWarp/VertexProgWarp.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/demos/vertexProgWarp/VertexProgWarp.java b/src/demos/vertexProgWarp/VertexProgWarp.java
index 76c43d5..fca8bcf 100644
--- a/src/demos/vertexProgWarp/VertexProgWarp.java
+++ b/src/demos/vertexProgWarp/VertexProgWarp.java
@@ -55,10 +55,12 @@ import java.io.IOException;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.GLAutoDrawable;
+import javax.media.opengl.awt.AWTGLAutoDrawable;
import javax.media.opengl.awt.GLCanvas;
import javax.media.opengl.glu.GLU;
import javax.media.opengl.glu.GLUquadric;
import javax.media.opengl.util.Animator;
+import javax.media.opengl.util.BufferUtil;
import javax.swing.JOptionPane;
@@ -193,7 +195,8 @@ public class VertexProgWarp extends Demo {
gl.glGenPrograms(1, vtxProgTmp, 0);
programs[i] = vtxProgTmp[0];
gl.glBindProgram(GL2.GL_VERTEX_PROGRAM, programs[i]);
- gl.glProgramString(GL2.GL_VERTEX_PROGRAM, GL2.GL_PROGRAM_FORMAT_ASCII, programTexts[i].length(), programTexts[i]);
+ gl.glProgramString(GL2.GL_VERTEX_PROGRAM, GL2.GL_PROGRAM_FORMAT_ASCII, programTexts[i].length(),
+ BufferUtil.newByteBuffer(programTexts[i].getBytes()));
}
gl.glProgramEnvParameter4f(GL2.GL_VERTEX_PROGRAM, 0, 0.0f, 0.0f, 1.0f, 0.0f); // light position/direction
@@ -224,13 +227,13 @@ public class VertexProgWarp extends Demo {
// Register the window with the ManipManager
ManipManager manager = ManipManager.getManipManager();
- manager.registerWindow(drawable);
+ manager.registerWindow((AWTGLAutoDrawable) drawable);
this.drawable = drawable;
viewer = new ExaminerViewer(MouseButtonHelper.numMouseButtons());
viewer.setNoAltKeyMode(true);
viewer.setAutoRedrawMode(false);
- viewer.attach(drawable, new BSphereProvider() {
+ viewer.attach((AWTGLAutoDrawable) drawable, new BSphereProvider() {
public BSphere getBoundingSphere() {
return new BSphere(new Vec3f(0, 0, 0), 1.0f);
}
@@ -286,8 +289,8 @@ public class VertexProgWarp extends Demo {
}
viewer.update(gl);
- ManipManager.getManipManager().updateCameraParameters(drawable, viewer.getCameraParameters());
- ManipManager.getManipManager().render(drawable, gl);
+ ManipManager.getManipManager().updateCameraParameters((AWTGLAutoDrawable) drawable, viewer.getCameraParameters());
+ ManipManager.getManipManager().render((AWTGLAutoDrawable) drawable, gl);
gl.glBindProgram(GL2.GL_VERTEX_PROGRAM, programs[program]);
gl.glProgramEnvParameter4f(GL2.GL_VERTEX_PROGRAM, 7, anim, 0.0f, 0.0f, 0.0f);
@@ -316,7 +319,7 @@ public class VertexProgWarp extends Demo {
// Internals only below this point
//
public void shutdownDemo() {
- ManipManager.getManipManager().unregisterWindow(drawable);
+ ManipManager.getManipManager().unregisterWindow((AWTGLAutoDrawable) drawable);
drawable.removeGLEventListener(this);
super.shutdownDemo();
}