summaryrefslogtreecommitdiffstats
path: root/src/demos/proceduralTexturePhysics
diff options
context:
space:
mode:
Diffstat (limited to 'src/demos/proceduralTexturePhysics')
-rw-r--r--src/demos/proceduralTexturePhysics/ProceduralTexturePhysics.java21
-rw-r--r--src/demos/proceduralTexturePhysics/Water.java10
2 files changed, 15 insertions, 16 deletions
diff --git a/src/demos/proceduralTexturePhysics/ProceduralTexturePhysics.java b/src/demos/proceduralTexturePhysics/ProceduralTexturePhysics.java
index d2a04af..7f8d67b 100644
--- a/src/demos/proceduralTexturePhysics/ProceduralTexturePhysics.java
+++ b/src/demos/proceduralTexturePhysics/ProceduralTexturePhysics.java
@@ -82,7 +82,12 @@ public class ProceduralTexturePhysics {
public void run(String[] args) {
canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities());
canvas.addGLEventListener(new Listener());
- canvas.setNoAutoRedrawMode(true);
+ water = new Water();
+ water.initialize("demos/data/images/nvfixed.tga",
+ "demos/data/images/nvspin.tga",
+ "demos/data/images/droplet.tga",
+ "demos/data/cubemaps/CloudyHills_{0}.tga",
+ canvas);
animator = new Animator(canvas);
@@ -100,12 +105,6 @@ public class ProceduralTexturePhysics {
}
});
- water = new Water();
- water.initialize("demos/data/images/nvfixed.tga",
- "demos/data/images/nvspin.tga",
- "demos/data/images/droplet.tga",
- "demos/data/cubemaps/CloudyHills_{0}.tga",
- canvas);
animator.start();
}
@@ -126,7 +125,7 @@ public class ProceduralTexturePhysics {
private float bumpIncrement = 0.01f;
private float frequencyIncrement = 0.1f;
- public void init(GLDrawable drawable) {
+ public void init(GLAutoDrawable drawable) {
GL gl = drawable.getGL();
gl.setSwapInterval(1);
@@ -189,7 +188,7 @@ public class ProceduralTexturePhysics {
});
}
- public void display(GLDrawable drawable) {
+ public void display(GLAutoDrawable drawable) {
if (!firstRender) {
if (++frameCount == 30) {
timer.stop();
@@ -229,10 +228,10 @@ public class ProceduralTexturePhysics {
water.draw(gl, params.getOrientation().inverse());
}
- public void reshape(GLDrawable drawable, int x, int y, int width, int height) {}
+ public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {}
// Unused routines
- public void displayChanged(GLDrawable drawable, boolean modeChanged, boolean deviceChanged) {}
+ public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {}
//----------------------------------------------------------------------
// Internals only below this point
diff --git a/src/demos/proceduralTexturePhysics/Water.java b/src/demos/proceduralTexturePhysics/Water.java
index 56357fb..295da6c 100644
--- a/src/demos/proceduralTexturePhysics/Water.java
+++ b/src/demos/proceduralTexturePhysics/Water.java
@@ -75,7 +75,7 @@ public class Water {
private String tmpDropletFilename;
private String tmpCubeMapFilenamePattern;
- private GLDrawable pbuffer;
+ private GLPbuffer pbuffer;
private Rotf cameraOrientation = new Rotf();
// Static texture names
@@ -408,14 +408,14 @@ public class Water {
//
class Listener implements GLEventListener {
- public void init(GLDrawable drawable) {
+ public void init(GLAutoDrawable drawable) {
GL gl = drawable.getGL();
GLU glu = drawable.getGLU();
initOpenGL(gl, glu);
}
- public void display(GLDrawable drawable) {
+ public void display(GLAutoDrawable drawable) {
GL gl = drawable.getGL();
if (mustUpdateBlurOffsets) {
updateBlurVertOffset(gl);
@@ -448,10 +448,10 @@ public class Water {
}
}
- public void reshape(GLDrawable drawable, int x, int y, int width, int height) {}
+ public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {}
// Unused routines
- public void displayChanged(GLDrawable drawable, boolean modeChanged, boolean deviceChanged) {}
+ public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {}
}
private TGAImage loadImage(String resourceName) {