summaryrefslogtreecommitdiffstats
path: root/src/demos
diff options
context:
space:
mode:
Diffstat (limited to 'src/demos')
-rwxr-xr-xsrc/demos/hdr/HDR.java13
-rw-r--r--src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java10
-rwxr-xr-xsrc/demos/jrefract/JRefract.java1
-rw-r--r--src/demos/proceduralTexturePhysics/ProceduralTexturePhysics.java12
-rw-r--r--src/demos/proceduralTexturePhysics/Water.java2
-rw-r--r--src/demos/testContextSharing/TestContextSharing.java2
-rw-r--r--src/demos/vertexProgRefract/VertexProgRefract.java1
-rw-r--r--src/demos/vertexProgWarp/VertexProgWarp.java1
8 files changed, 28 insertions, 14 deletions
diff --git a/src/demos/hdr/HDR.java b/src/demos/hdr/HDR.java
index db79bd6..3bf1b49 100755
--- a/src/demos/hdr/HDR.java
+++ b/src/demos/hdr/HDR.java
@@ -282,6 +282,7 @@ public class HDR {
manager.registerWindow(drawable);
viewer = new ExaminerViewer(MouseButtonHelper.numMouseButtons());
+ viewer.setAutoRedrawMode(false);
viewer.setNoAltKeyMode(true);
viewer.attach(drawable, new BSphereProvider() {
public BSphere getBoundingSphere() {
@@ -324,6 +325,12 @@ public class HDR {
pbuffer.display();
+ // FIXME: because of changes in lazy pbuffer instantiation
+ // behavior the pbuffer might not have been run just now
+ if (pipeline == null) {
+ return;
+ }
+
// blur pass
if (b['g']) {
// shrink image
@@ -502,7 +509,7 @@ public class HDR {
class PbufferListener implements GLEventListener {
public void init(GLAutoDrawable drawable) {
- // printThreadName("init for PbufferListener");
+ printThreadName("init for PbufferListener");
// drawable.setGL(new DebugGL(drawable.getGL()));
@@ -693,7 +700,7 @@ public class HDR {
class BlurPbufferListener implements GLEventListener {
public void init(GLAutoDrawable drawable) {
- // printThreadName("init for BlurPbufferListener");
+ printThreadName("init for BlurPbufferListener");
// drawable.setGL(new DebugGL(drawable.getGL()));
@@ -726,7 +733,7 @@ public class HDR {
class Blur2PbufferListener implements GLEventListener {
public void init(GLAutoDrawable drawable) {
- // printThreadName("init for Blur2PbufferListener");
+ printThreadName("init for Blur2PbufferListener");
// drawable.setGL(new DebugGL(drawable.getGL()));
diff --git a/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java b/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java
index 74f4355..cd70062 100644
--- a/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java
+++ b/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java
@@ -303,6 +303,8 @@ public class HWShadowmapsSimple {
}
if (!fullyInitialized) {
+ // Repaint again later once everything is set up
+ canvas.repaint();
return;
}
@@ -564,7 +566,7 @@ public class HWShadowmapsSimple {
gl.glMatrixMode(GL.GL_MODELVIEW);
}
- private void render_scene(GL gl, Mat4f view, GLDrawable drawable, CameraParameters params) {
+ private void render_scene(GL gl, Mat4f view, GLAutoDrawable drawable, CameraParameters params) {
gl.glColor3f(1,1,1);
gl.glPushMatrix();
Mat4f inverseView = new Mat4f(view);
@@ -585,7 +587,7 @@ public class HWShadowmapsSimple {
gl.glPopMatrix();
}
- private void render_manipulators(GL gl, Mat4f view, GLDrawable drawable, CameraParameters params) {
+ private void render_manipulators(GL gl, Mat4f view, GLAutoDrawable drawable, CameraParameters params) {
gl.glColor3f(1,1,1);
gl.glPushMatrix();
Mat4f inverseView = new Mat4f(view);
@@ -600,7 +602,7 @@ public class HWShadowmapsSimple {
gl.glPopMatrix();
}
- private void render_scene_from_camera_view(GL gl, GLU glu, GLDrawable drawable, CameraParameters params) {
+ private void render_scene_from_camera_view(GL gl, GLU glu, GLAutoDrawable drawable, CameraParameters params) {
// place light
gl.glPushMatrix();
gl.glLoadIdentity();
@@ -647,7 +649,7 @@ public class HWShadowmapsSimple {
render_light_frustum(gl);
}
- private void render_scene_from_camera_view_shadowed(GL gl, GLU glu, GLDrawable drawable, CameraParameters params) {
+ private void render_scene_from_camera_view_shadowed(GL gl, GLU glu, GLAutoDrawable drawable, CameraParameters params) {
// place light
gl.glPushMatrix();
gl.glLoadIdentity();
diff --git a/src/demos/jrefract/JRefract.java b/src/demos/jrefract/JRefract.java
index 7947a90..09b5095 100755
--- a/src/demos/jrefract/JRefract.java
+++ b/src/demos/jrefract/JRefract.java
@@ -442,6 +442,7 @@ public class JRefract {
viewer = new ExaminerViewer(MouseButtonHelper.numMouseButtons());
viewer.setNoAltKeyMode(true);
+ viewer.setAutoRedrawMode(false);
viewer.attach(drawable, new BSphereProvider() {
public BSphere getBoundingSphere() {
return new BSphere(new Vec3f(0, 0, 0), 1.0f);
diff --git a/src/demos/proceduralTexturePhysics/ProceduralTexturePhysics.java b/src/demos/proceduralTexturePhysics/ProceduralTexturePhysics.java
index 7f8d67b..9713b6b 100644
--- a/src/demos/proceduralTexturePhysics/ProceduralTexturePhysics.java
+++ b/src/demos/proceduralTexturePhysics/ProceduralTexturePhysics.java
@@ -83,11 +83,6 @@ public class ProceduralTexturePhysics {
canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities());
canvas.addGLEventListener(new Listener());
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);
@@ -126,6 +121,12 @@ public class ProceduralTexturePhysics {
private float frequencyIncrement = 0.1f;
public void init(GLAutoDrawable drawable) {
+ water.initialize("demos/data/images/nvfixed.tga",
+ "demos/data/images/nvspin.tga",
+ "demos/data/images/droplet.tga",
+ "demos/data/cubemaps/CloudyHills_{0}.tga",
+ drawable);
+
GL gl = drawable.getGL();
gl.setSwapInterval(1);
@@ -150,6 +151,7 @@ public class ProceduralTexturePhysics {
manager.registerWindow(drawable);
viewer = new ExaminerViewer(MouseButtonHelper.numMouseButtons());
+ viewer.setAutoRedrawMode(false);
viewer.attach(drawable, new BSphereProvider() {
public BSphere getBoundingSphere() {
return new BSphere(new Vec3f(0, 0, 0), 1.2f);
diff --git a/src/demos/proceduralTexturePhysics/Water.java b/src/demos/proceduralTexturePhysics/Water.java
index 295da6c..46d199a 100644
--- a/src/demos/proceduralTexturePhysics/Water.java
+++ b/src/demos/proceduralTexturePhysics/Water.java
@@ -186,7 +186,7 @@ public class Water {
String spinFilename,
String dropletFilename,
String cubeMapFilenamePattern,
- GLDrawable parentWindow) {
+ GLAutoDrawable parentWindow) {
loadInitialTexture(initialMapFilename);
tmpSpinFilename = spinFilename;
tmpDropletFilename = dropletFilename;
diff --git a/src/demos/testContextSharing/TestContextSharing.java b/src/demos/testContextSharing/TestContextSharing.java
index 93801a6..9d23f12 100644
--- a/src/demos/testContextSharing/TestContextSharing.java
+++ b/src/demos/testContextSharing/TestContextSharing.java
@@ -62,7 +62,7 @@ public class TestContextSharing {
frame1.setLayout(new BorderLayout());
frame1.add(canvas1, BorderLayout.CENTER);
- GLCanvas canvas2 = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities(), null, canvas1, null);
+ GLCanvas canvas2 = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities(), null, canvas1.getContext(), null);
canvas2.addGLEventListener(new Listener());
canvas2.setSize(256, 256);
Frame frame2 = new Frame("Canvas 2");
diff --git a/src/demos/vertexProgRefract/VertexProgRefract.java b/src/demos/vertexProgRefract/VertexProgRefract.java
index 1e3a5e1..7bc223f 100644
--- a/src/demos/vertexProgRefract/VertexProgRefract.java
+++ b/src/demos/vertexProgRefract/VertexProgRefract.java
@@ -315,6 +315,7 @@ public class VertexProgRefract {
viewer = new ExaminerViewer(MouseButtonHelper.numMouseButtons());
viewer.setNoAltKeyMode(true);
+ viewer.setAutoRedrawMode(false);
viewer.attach(drawable, new BSphereProvider() {
public BSphere getBoundingSphere() {
return new BSphere(new Vec3f(0, 0, 0), 1.0f);
diff --git a/src/demos/vertexProgWarp/VertexProgWarp.java b/src/demos/vertexProgWarp/VertexProgWarp.java
index a95f149..4fbb345 100644
--- a/src/demos/vertexProgWarp/VertexProgWarp.java
+++ b/src/demos/vertexProgWarp/VertexProgWarp.java
@@ -192,6 +192,7 @@ public class VertexProgWarp {
viewer = new ExaminerViewer(MouseButtonHelper.numMouseButtons());
viewer.setNoAltKeyMode(true);
+ viewer.setAutoRedrawMode(false);
viewer.attach(drawable, new BSphereProvider() {
public BSphere getBoundingSphere() {
return new BSphere(new Vec3f(0, 0, 0), 1.0f);