diff options
Diffstat (limited to 'src/demos')
22 files changed, 123 insertions, 126 deletions
diff --git a/src/demos/cg/runtime_ogl/cgGL_vertex_example.java b/src/demos/cg/runtime_ogl/cgGL_vertex_example.java index 2a43fd6..5e805e1 100644 --- a/src/demos/cg/runtime_ogl/cgGL_vertex_example.java +++ b/src/demos/cg/runtime_ogl/cgGL_vertex_example.java @@ -154,7 +154,7 @@ public class cgGL_vertex_example implements GLEventListener CgGL.cgGLDisableProfile(profile); } - public void display(GLDrawable drawable) + public void display(GLAutoDrawable drawable) { GL gl = drawable.getGL(); gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); @@ -173,12 +173,12 @@ public class cgGL_vertex_example implements GLEventListener v[1][2] = v[2][2] = v[5][2] = v[6][2] = -1; } - public void displayChanged(GLDrawable drawable, boolean modeChanged, boolean deviceChanged) + public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) { // nothing } - public void init(GLDrawable drawable) + public void init(GLAutoDrawable drawable) { // Note: we initialize Cg in this init() method instead of main() // because Cg (apparently) requires an active OpenGL context in order to @@ -259,7 +259,7 @@ public class cgGL_vertex_example implements GLEventListener } - 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) { // do nothing } diff --git a/src/demos/cg/runtime_ogl_vertex_fragment/runtime_ogl_vertex_fragment.java b/src/demos/cg/runtime_ogl_vertex_fragment/runtime_ogl_vertex_fragment.java index 57693b4..fec2bee 100644 --- a/src/demos/cg/runtime_ogl_vertex_fragment/runtime_ogl_vertex_fragment.java +++ b/src/demos/cg/runtime_ogl_vertex_fragment/runtime_ogl_vertex_fragment.java @@ -91,7 +91,7 @@ public class runtime_ogl_vertex_fragment implements GLEventListener // and all the rest happens in the display function... } - public void init(GLDrawable drawable) + public void init(GLAutoDrawable drawable) { // Use debug pipeline // drawable.setGL(new DebugGL(drawable.getGL())); @@ -125,7 +125,7 @@ public class runtime_ogl_vertex_fragment implements GLEventListener private static int curTime = 0; // display callback function - public void display(GLDrawable drawable) + public void display(GLAutoDrawable drawable) { GL gl = drawable.getGL(); @@ -417,12 +417,12 @@ public class runtime_ogl_vertex_fragment implements GLEventListener N.put(offsetN + 2, P.get(offsetP + 2)); } - public void displayChanged(GLDrawable drawable, boolean modeChanged, boolean deviceChanged) + public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) { // nothing } - 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) { // do nothing } diff --git a/src/demos/fullscreen/GearsFullscreen.java b/src/demos/fullscreen/GearsFullscreen.java index 6c48ef0..f33221a 100755 --- a/src/demos/fullscreen/GearsFullscreen.java +++ b/src/demos/fullscreen/GearsFullscreen.java @@ -99,7 +99,7 @@ public class GearsFullscreen { private int prevMouseX, prevMouseY; private boolean mouseRButtonDown = false; - public void init(GLDrawable drawable) { + public void init(GLAutoDrawable drawable) { // Use debug pipeline // drawable.setGL(new DebugGL(drawable.getGL())); @@ -164,7 +164,7 @@ public class GearsFullscreen { }); } - 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) { GL gl = drawable.getGL(); float h = (float)height / (float)width; @@ -196,7 +196,7 @@ public class GearsFullscreen { gl.glTranslatef(0.0f, 0.0f, -40.0f); } - public void display(GLDrawable drawable) { + public void display(GLAutoDrawable drawable) { angle += 2.0f; GL gl = drawable.getGL(); @@ -228,7 +228,7 @@ public class GearsFullscreen { gl.glPopMatrix(); } - public void displayChanged(GLDrawable drawable, boolean modeChanged, boolean deviceChanged) {} + public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {} private void gear(GL gl, float inner_radius, diff --git a/src/demos/fullscreen/GearsFullscreen2.java b/src/demos/fullscreen/GearsFullscreen2.java index d7502cf..0afad8c 100755 --- a/src/demos/fullscreen/GearsFullscreen2.java +++ b/src/demos/fullscreen/GearsFullscreen2.java @@ -120,7 +120,7 @@ public class GearsFullscreen2 { private int prevMouseX, prevMouseY; private boolean mouseRButtonDown = false; - public void init(GLDrawable drawable) { + public void init(GLAutoDrawable drawable) { // Use debug pipeline // drawable.setGL(new DebugGL(drawable.getGL())); @@ -186,7 +186,7 @@ public class GearsFullscreen2 { }); } - 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) { GL gl = drawable.getGL(); float h = (float)height / (float)width; @@ -218,7 +218,7 @@ public class GearsFullscreen2 { gl.glTranslatef(0.0f, 0.0f, -40.0f); } - public void display(GLDrawable drawable) { + public void display(GLAutoDrawable drawable) { angle += 2.0f; GL gl = drawable.getGL(); @@ -250,7 +250,7 @@ public class GearsFullscreen2 { gl.glPopMatrix(); } - public void displayChanged(GLDrawable drawable, boolean modeChanged, boolean deviceChanged) {} + public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {} private void gear(GL gl, float inner_radius, diff --git a/src/demos/fullscreen/JGearsFullscreen.java b/src/demos/fullscreen/JGearsFullscreen.java index 6b68667..62b10fe 100755 --- a/src/demos/fullscreen/JGearsFullscreen.java +++ b/src/demos/fullscreen/JGearsFullscreen.java @@ -118,7 +118,7 @@ public class JGearsFullscreen { private int prevMouseX, prevMouseY; private boolean mouseRButtonDown = false; - public void init(GLDrawable drawable) { + public void init(GLAutoDrawable drawable) { // Use debug pipeline // drawable.setGL(new DebugGL(drawable.getGL())); @@ -199,7 +199,7 @@ public class JGearsFullscreen { actMap.put(act, act); } - 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) { GL gl = drawable.getGL(); float h = (float)height / (float)width; @@ -231,7 +231,7 @@ public class JGearsFullscreen { gl.glTranslatef(0.0f, 0.0f, -40.0f); } - public void display(GLDrawable drawable) { + public void display(GLAutoDrawable drawable) { angle += 2.0f; GL gl = drawable.getGL(); @@ -263,7 +263,7 @@ public class JGearsFullscreen { gl.glPopMatrix(); } - public void displayChanged(GLDrawable drawable, boolean modeChanged, boolean deviceChanged) {} + public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {} private void gear(GL gl, float inner_radius, diff --git a/src/demos/gears/Gears.java b/src/demos/gears/Gears.java index c007004..2ebc11d 100644 --- a/src/demos/gears/Gears.java +++ b/src/demos/gears/Gears.java @@ -46,7 +46,7 @@ public class Gears { private int prevMouseX, prevMouseY; private boolean mouseRButtonDown = false; - public void init(GLDrawable drawable) { + public void init(GLAutoDrawable drawable) { // Use debug pipeline // drawable.setGL(new DebugGL(drawable.getGL())); @@ -92,7 +92,7 @@ public class Gears { drawable.addMouseMotionListener(this); } - 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) { GL gl = drawable.getGL(); float h = (float)height / (float)width; @@ -124,7 +124,7 @@ public class Gears { gl.glTranslatef(0.0f, 0.0f, -40.0f); } - public void display(GLDrawable drawable) { + public void display(GLAutoDrawable drawable) { angle += 2.0f; GL gl = drawable.getGL(); @@ -156,7 +156,7 @@ public class Gears { gl.glPopMatrix(); } - public void displayChanged(GLDrawable drawable, boolean modeChanged, boolean deviceChanged) {} + public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {} private void gear(GL gl, float inner_radius, diff --git a/src/demos/hdr/HDR.java b/src/demos/hdr/HDR.java index 76b66ac..db79bd6 100755 --- a/src/demos/hdr/HDR.java +++ b/src/demos/hdr/HDR.java @@ -170,7 +170,6 @@ public class HDR { canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities()); canvas.addGLEventListener(new Listener()); - canvas.setNoAutoRedrawMode(true); animator = new Animator(canvas); @@ -207,7 +206,7 @@ public class HDR { private boolean wire = false; private boolean toggleWire = false; - public void init(GLDrawable drawable) { + public void init(GLAutoDrawable drawable) { // printThreadName("init for Listener"); GL gl = drawable.getGL(); @@ -293,7 +292,7 @@ public class HDR { viewer.setZFar(zFar); } - public void display(GLDrawable drawable) { + public void display(GLAutoDrawable drawable) { // printThreadName("display for Listener"); if (initFailed) { @@ -358,10 +357,10 @@ public class HDR { Thread.yield(); } - 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 @@ -502,7 +501,7 @@ public class HDR { // class PbufferListener implements GLEventListener { - public void init(GLDrawable drawable) { + public void init(GLAutoDrawable drawable) { // printThreadName("init for PbufferListener"); // drawable.setGL(new DebugGL(drawable.getGL())); @@ -549,7 +548,7 @@ public class HDR { pipeline.initFloatingPointTexture(gl, pbuffer_tex, pbuffer_w, pbuffer_h); } - public void display(GLDrawable drawable) { + public void display(GLAutoDrawable drawable) { // printThreadName("display for PbufferListener"); GL gl = drawable.getGL(); @@ -562,8 +561,8 @@ public class HDR { } // Unused routines - public void reshape(GLDrawable drawable, int x, int y, int width, int height) {} - public void displayChanged(GLDrawable drawable, boolean modeChanged, boolean deviceChanged) {} + public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {} + public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {} //---------------------------------------------------------------------- // Internals only below this point @@ -693,7 +692,7 @@ public class HDR { } class BlurPbufferListener implements GLEventListener { - public void init(GLDrawable drawable) { + public void init(GLAutoDrawable drawable) { // printThreadName("init for BlurPbufferListener"); // drawable.setGL(new DebugGL(drawable.getGL())); @@ -706,7 +705,7 @@ public class HDR { pipeline.initFloatingPointTexture(gl, blur_pbuffer_tex, blur_w, blur_h); } - public void display(GLDrawable drawable) { + public void display(GLAutoDrawable drawable) { // printThreadName("display for BlurPbufferListener"); GL gl = drawable.getGL(); @@ -721,12 +720,12 @@ public class HDR { } // Unused routines - public void reshape(GLDrawable drawable, int x, int y, int width, int height) {} - public void displayChanged(GLDrawable drawable, boolean modeChanged, boolean deviceChanged) {} + public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {} + public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {} } class Blur2PbufferListener implements GLEventListener { - public void init(GLDrawable drawable) { + public void init(GLAutoDrawable drawable) { // printThreadName("init for Blur2PbufferListener"); // drawable.setGL(new DebugGL(drawable.getGL())); @@ -738,7 +737,7 @@ public class HDR { pipeline.initFloatingPointTexture(gl, blur2_pbuffer_tex, blur_w, blur_h); } - public void display(GLDrawable drawable) { + public void display(GLAutoDrawable drawable) { // printThreadName("display for Blur2PbufferListener"); GL gl = drawable.getGL(); @@ -769,12 +768,12 @@ public class HDR { } // Unused routines - public void reshape(GLDrawable drawable, int x, int y, int width, int height) {} - public void displayChanged(GLDrawable drawable, boolean modeChanged, boolean deviceChanged) {} + public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {} + public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {} } class TonemapPbufferListener implements GLEventListener { - public void init(GLDrawable drawable) { + public void init(GLAutoDrawable drawable) { GL gl = drawable.getGL(); setOrthoProjection(gl, pbuffer_w, pbuffer_h); @@ -782,7 +781,7 @@ public class HDR { pipeline.initTexture(gl, tonemap_pbuffer_tex, pbuffer_w, pbuffer_h); } - public void display(GLDrawable drawable) { + public void display(GLAutoDrawable drawable) { GL gl = drawable.getGL(); toneMappingPass(gl); @@ -791,8 +790,8 @@ public class HDR { } // Unused routines - public void reshape(GLDrawable drawable, int x, int y, int width, int height) {} - public void displayChanged(GLDrawable drawable, boolean modeChanged, boolean deviceChanged) {} + public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {} + public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {} } //---------------------------------------------------------------------- diff --git a/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java b/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java index f757a9a..74f4355 100644 --- a/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java +++ b/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java @@ -160,7 +160,7 @@ public class HWShadowmapsSimple { class Listener implements GLEventListener { - public void init(GLDrawable drawable) { + public void init(GLAutoDrawable drawable) { // Use debug pipeline // drawable.setGL(new DebugGL(drawable.getGL())); @@ -279,7 +279,7 @@ public class HWShadowmapsSimple { }); } - public void display(GLDrawable drawable) { + public void display(GLAutoDrawable drawable) { viewer.update(); // Grab these values once per render to avoid multithreading @@ -332,8 +332,8 @@ public class HWShadowmapsSimple { } // Unused routines - public void reshape(GLDrawable drawable, int x, int y, int width, int height) {} - public void displayChanged(GLDrawable drawable, boolean modeChanged, boolean deviceChanged) {} + public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {} + public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {} //---------------------------------------------------------------------- // Internals only below this point @@ -373,7 +373,7 @@ public class HWShadowmapsSimple { } class PbufferListener implements GLEventListener { - public void init(GLDrawable drawable) { + public void init(GLAutoDrawable drawable) { // Use debug pipeline // drawable.setGL(new DebugGL(drawable.getGL())); @@ -397,7 +397,7 @@ public class HWShadowmapsSimple { fullyInitialized = true; } - public void display(GLDrawable drawable) { + public void display(GLAutoDrawable drawable) { GL gl = drawable.getGL(); GLU glu = drawable.getGLU(); @@ -418,8 +418,8 @@ public class HWShadowmapsSimple { } // Unused routines - public void reshape(GLDrawable drawable, int x, int y, int width, int height) {} - public void displayChanged(GLDrawable drawable, boolean modeChanged, boolean deviceChanged) {} + public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {} + public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {} } private void set_light_view_texture_parameters(GL gl) { diff --git a/src/demos/infiniteShadowVolumes/InfiniteShadowVolumes.java b/src/demos/infiniteShadowVolumes/InfiniteShadowVolumes.java index 990b8c0..7232957 100644 --- a/src/demos/infiniteShadowVolumes/InfiniteShadowVolumes.java +++ b/src/demos/infiniteShadowVolumes/InfiniteShadowVolumes.java @@ -160,7 +160,7 @@ public class InfiniteShadowVolumes { private boolean toggleWireframe; class Listener implements GLEventListener { - public void init(GLDrawable drawable) { + public void init(GLAutoDrawable drawable) { GL gl = drawable.getGL(); GLU glu = drawable.getGLU(); @@ -280,7 +280,7 @@ public class InfiniteShadowVolumes { // glutAddMenuEntry("quit [<esc>]", 27); } - public void display(GLDrawable drawable) { + public void display(GLAutoDrawable drawable) { if (quit) { return; } @@ -546,8 +546,8 @@ public class InfiniteShadowVolumes { } // Unused routines - public void reshape(GLDrawable drawable, int x, int y, int width, int height) {} - public void displayChanged(GLDrawable drawable, boolean modeChanged, boolean deviceChanged) {} + public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {} + public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {} //---------------------------------------------------------------------- // Internals only below this point diff --git a/src/demos/jgears/JGears.java b/src/demos/jgears/JGears.java index 91704f5..6a4d539 100644 --- a/src/demos/jgears/JGears.java +++ b/src/demos/jgears/JGears.java @@ -70,7 +70,7 @@ public class JGears { private boolean mouseRButtonDown = false; - public void init(GLDrawable drawable) { + public void init(GLAutoDrawable drawable) { // Use debug pipeline // drawable.setGL(new DebugGL(drawable.getGL())); @@ -113,7 +113,7 @@ public class JGears { drawable.addMouseMotionListener(this); } - 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) { GL gl = drawable.getGL(); float h = (float)height / (float)width; @@ -145,7 +145,7 @@ public class JGears { gl.glTranslatef(0.0f, 0.0f, -40.0f); } - public void display(GLDrawable drawable) { + public void display(GLAutoDrawable drawable) { angle += 2.0f; GL gl = drawable.getGL(); @@ -177,7 +177,7 @@ public class JGears { gl.glPopMatrix(); } - public void displayChanged(GLDrawable drawable, boolean modeChanged, boolean deviceChanged) {} + public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {} private void gear(GL gl, float inner_radius, diff --git a/src/demos/jrefract/JRefract.java b/src/demos/jrefract/JRefract.java index 4775073..7947a90 100755 --- a/src/demos/jrefract/JRefract.java +++ b/src/demos/jrefract/JRefract.java @@ -337,7 +337,7 @@ public class JRefract { "\n" + "END\n"; - public void init(GLDrawable drawable) { + public void init(GLAutoDrawable drawable) { // Use debug pipeline // drawable.setGL(new DebugGL(drawable.getGL())); @@ -453,7 +453,7 @@ public class JRefract { } } - public void display(GLDrawable drawable) { + public void display(GLAutoDrawable drawable) { if (quit) { return; } @@ -567,8 +567,8 @@ public class JRefract { } // Unused routines - public void reshape(GLDrawable drawable, int x, int y, int width, int height) {} - public void displayChanged(GLDrawable drawable, boolean modeChanged, boolean deviceChanged) {} + public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {} + public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {} //---------------------------------------------------------------------- // Internals only below this point @@ -924,7 +924,7 @@ public class JRefract { private boolean mouseRButtonDown = false; - public void init(GLDrawable drawable) { + public void init(GLAutoDrawable drawable) { // Use debug pipeline // drawable.setGL(new DebugGL(drawable.getGL())); @@ -967,7 +967,7 @@ public class JRefract { drawable.addMouseMotionListener(this); } - 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) { GL gl = drawable.getGL(); float h = (float)height / (float)width; @@ -999,7 +999,7 @@ public class JRefract { gl.glTranslatef(0.0f, 0.0f, -40.0f); } - public void display(GLDrawable drawable) { + public void display(GLAutoDrawable drawable) { angle += 2.0f; GL gl = drawable.getGL(); @@ -1031,7 +1031,7 @@ public class JRefract { gl.glPopMatrix(); } - public void displayChanged(GLDrawable drawable, boolean modeChanged, boolean deviceChanged) {} + public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {} private void gear(GL gl, float inner_radius, diff --git a/src/demos/multisample/Multisample.java b/src/demos/multisample/Multisample.java index f479b0e..6dd00d3 100755 --- a/src/demos/multisample/Multisample.java +++ b/src/demos/multisample/Multisample.java @@ -83,7 +83,7 @@ public class Multisample { caps.setSampleBuffers(true); caps.setNumSamples(4); - canvas = GLDrawableFactory.getFactory().createGLCanvas(caps, chooser); + canvas = GLDrawableFactory.getFactory().createGLCanvas(caps, chooser, null, null); canvas.addGLEventListener(new Listener()); Frame frame = new Frame("Full-scene antialiasing"); @@ -123,7 +123,7 @@ public class Multisample { } class Listener implements GLEventListener { - public void init(GLDrawable drawable) { + public void init(GLAutoDrawable drawable) { GL gl = drawable.getGL(); GLU glu = drawable.getGLU(); @@ -138,7 +138,7 @@ public class Multisample { gl.glOrtho(-1, 1, -1, 1, -1, 1); } - public void display(GLDrawable drawable) { + public void display(GLAutoDrawable drawable) { GL gl = drawable.getGL(); GLU glu = drawable.getGLU(); @@ -161,8 +161,8 @@ public class Multisample { } // Unused routines - public void reshape(GLDrawable drawable, int x, int y, int width, int height) {} - public void displayChanged(GLDrawable drawable, boolean modeChanged, boolean deviceChanged) {} + public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {} + public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {} } private void runExit() { diff --git a/src/demos/printext/PrintExt.java b/src/demos/printext/PrintExt.java index 3edb3a0..ebc9551 100755 --- a/src/demos/printext/PrintExt.java +++ b/src/demos/printext/PrintExt.java @@ -20,7 +20,7 @@ public class PrintExt { } static class Listener implements GLEventListener { - public void init(GLDrawable drawable) { + public void init(GLAutoDrawable drawable) { GL gl = drawable.getGL(); System.out.println("GL vendor: " + gl.glGetString(GL.GL_VENDOR)); System.out.println("GL version: " + gl.glGetString(GL.GL_VERSION)); @@ -44,13 +44,13 @@ public class PrintExt { runExit(); } - public void display(GLDrawable drawable) { + public void display(GLAutoDrawable drawable) { } - public void reshape(GLDrawable drawable, int x, int y, int w, int h) { + public void reshape(GLAutoDrawable drawable, int x, int y, int w, int h) { } - public void displayChanged(GLDrawable drawable, boolean modeChanged, boolean deviceChanged) { + public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) { } } 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) { diff --git a/src/demos/tess/Tess.java b/src/demos/tess/Tess.java index 43a52ae..3bd02b5 100644 --- a/src/demos/tess/Tess.java +++ b/src/demos/tess/Tess.java @@ -100,7 +100,7 @@ public class Tess { private GLU glu; private int startList; - public void init(GLDrawable drawable) { + public void init(GLAutoDrawable drawable) { drawable.setGL(new DebugGL(drawable.getGL())); gl = drawable.getGL(); @@ -171,7 +171,7 @@ public class Tess { }//end init - 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) { gl.glMatrixMode(GL.GL_PROJECTION); gl.glLoadIdentity(); gl.glOrtho( 0, 450, 0, 250, -1, 1 ); @@ -179,10 +179,10 @@ public class Tess { gl.glLoadIdentity(); } - public void displayChanged(GLDrawable drawable, boolean modeChanged, boolean deviceChanged) { + public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) { } - public void display(GLDrawable drawable) { + public void display(GLAutoDrawable drawable) { gl.glClear(GL.GL_COLOR_BUFFER_BIT); gl.glColor3d(1.0, 1.0, 1.0); gl.glCallList(startList); diff --git a/src/demos/testContextDestruction/TestContextDestruction.java b/src/demos/testContextDestruction/TestContextDestruction.java index fd9dd6e..fea89da 100755 --- a/src/demos/testContextDestruction/TestContextDestruction.java +++ b/src/demos/testContextDestruction/TestContextDestruction.java @@ -176,7 +176,7 @@ public class TestContextDestruction { } class Listener implements GLEventListener { - public void init(GLDrawable drawable) { + public void init(GLAutoDrawable drawable) { System.out.println("Listener.init()"); drawable.setGL(new DebugGL(drawable.getGL())); @@ -193,11 +193,10 @@ public class TestContextDestruction { gl.glEnable(GL.GL_NORMALIZE); - Dimension d = drawable.getSize(); - reshape(drawable, 0, 0, d.width, d.height); + reshape(drawable, 0, 0, drawable.getWidth(), drawable.getHeight()); } - public void display(GLDrawable drawable) { + public void display(GLAutoDrawable drawable) { angle += 2.0f; GL gl = drawable.getGL(); @@ -210,7 +209,7 @@ public class TestContextDestruction { gl.glPopMatrix(); } - 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) { System.out.println("Listener.reshape()"); GL gl = drawable.getGL(); @@ -224,7 +223,7 @@ public class TestContextDestruction { gl.glTranslatef(0.0f, 0.0f, -40.0f); } - public void destroy(GLDrawable drawable) { + public void destroy(GLAutoDrawable drawable) { System.out.println("Listener.destroy()"); GL gl = drawable.getGL(); gl.glDeleteLists(gearDisplayList, 1); @@ -232,7 +231,7 @@ public class TestContextDestruction { } // Unused routines - public void displayChanged(GLDrawable drawable, boolean modeChanged, boolean deviceChanged) {} + public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {} } private synchronized void initializeDisplayList(GL gl) { diff --git a/src/demos/testContextSharing/TestContextSharing.java b/src/demos/testContextSharing/TestContextSharing.java index 272c363..93801a6 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(), canvas1); + GLCanvas canvas2 = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities(), null, canvas1, null); canvas2.addGLEventListener(new Listener()); canvas2.setSize(256, 256); Frame frame2 = new Frame("Canvas 2"); @@ -96,7 +96,7 @@ public class TestContextSharing { } class Listener implements GLEventListener { - public void init(GLDrawable drawable) { + public void init(GLAutoDrawable drawable) { drawable.setGL(new DebugGL(drawable.getGL())); GL gl = drawable.getGL(); @@ -113,7 +113,7 @@ public class TestContextSharing { gl.glEnable(GL.GL_NORMALIZE); } - public void display(GLDrawable drawable) { + public void display(GLAutoDrawable drawable) { GL gl = drawable.getGL(); gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); @@ -122,7 +122,7 @@ public class TestContextSharing { gl.glCallList(gearDisplayList); } - 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) { GL gl = drawable.getGL(); float h = (float)height / (float)width; @@ -136,7 +136,7 @@ public class TestContextSharing { } // Unused routines - public void displayChanged(GLDrawable drawable, boolean modeChanged, boolean deviceChanged) {} + public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {} } private synchronized void initializeDisplayList(GL gl) { diff --git a/src/demos/vertexArrayRange/VertexArrayRange.java b/src/demos/vertexArrayRange/VertexArrayRange.java index fee4280..6b598f3 100644 --- a/src/demos/vertexArrayRange/VertexArrayRange.java +++ b/src/demos/vertexArrayRange/VertexArrayRange.java @@ -277,7 +277,7 @@ public class VertexArrayRange { class VARListener implements GLEventListener { boolean exiting = false; - public void init(GLDrawable drawable) { + public void init(GLAutoDrawable drawable) { // drawable.setGL(new TraceGL(drawable.getGL(), System.err)); // drawable.setGL(new DebugGL(drawable.getGL())); @@ -458,7 +458,7 @@ public class VertexArrayRange { } } - public void display(GLDrawable drawable) { + public void display(GLAutoDrawable drawable) { // Don't try to do OpenGL operations if we're tearing things down if (quit) { return; @@ -653,10 +653,10 @@ public class VertexArrayRange { } } - 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) {} } // end class VARListener private void allocateBigArray(GL gl, boolean tryAgain) { diff --git a/src/demos/vertexBufferObject/VertexBufferObject.java b/src/demos/vertexBufferObject/VertexBufferObject.java index 060fd62..f6dab6c 100644 --- a/src/demos/vertexBufferObject/VertexBufferObject.java +++ b/src/demos/vertexBufferObject/VertexBufferObject.java @@ -271,7 +271,7 @@ public class VertexBufferObject { class VBOListener implements GLEventListener { boolean exiting = false; - public void init(GLDrawable drawable) { + public void init(GLAutoDrawable drawable) { // drawable.setGL(new TraceGL(drawable.getGL(), System.err)); // drawable.setGL(new DebugGL(drawable.getGL())); @@ -450,7 +450,7 @@ public class VertexBufferObject { } } - public void display(GLDrawable drawable) { + public void display(GLAutoDrawable drawable) { // Don't try to do OpenGL operations if we're tearing things down if (quit) { return; @@ -677,10 +677,10 @@ public class VertexBufferObject { } } - 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) {} } // end class VBOListener private void allocateBigArray(GL gl) { diff --git a/src/demos/vertexProgRefract/VertexProgRefract.java b/src/demos/vertexProgRefract/VertexProgRefract.java index 6e5a85d..1e3a5e1 100644 --- a/src/demos/vertexProgRefract/VertexProgRefract.java +++ b/src/demos/vertexProgRefract/VertexProgRefract.java @@ -226,7 +226,7 @@ public class VertexProgRefract { "\n" + "END\n"; - public void init(GLDrawable drawable) { + public void init(GLAutoDrawable drawable) { GL gl = drawable.getGL(); GLU glu = drawable.getGLU(); float cc = 1.0f; @@ -325,7 +325,7 @@ public class VertexProgRefract { viewer.setZFar(10.0f); } - public void display(GLDrawable drawable) { + public void display(GLAutoDrawable drawable) { if (quit) { return; } @@ -438,8 +438,8 @@ public class VertexProgRefract { } // Unused routines - public void reshape(GLDrawable drawable, int x, int y, int width, int height) {} - public void displayChanged(GLDrawable drawable, boolean modeChanged, boolean deviceChanged) {} + public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {} + public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {} //---------------------------------------------------------------------- // Internals only below this point diff --git a/src/demos/vertexProgWarp/VertexProgWarp.java b/src/demos/vertexProgWarp/VertexProgWarp.java index bacecab..a95f149 100644 --- a/src/demos/vertexProgWarp/VertexProgWarp.java +++ b/src/demos/vertexProgWarp/VertexProgWarp.java @@ -124,7 +124,7 @@ public class VertexProgWarp { private ExaminerViewer viewer; - public void init(GLDrawable drawable) { + public void init(GLAutoDrawable drawable) { GL gl = drawable.getGL(); GLU glu = drawable.getGLU(); @@ -202,7 +202,7 @@ public class VertexProgWarp { viewer.setZFar(zFar); } - public void display(GLDrawable drawable) { + public void display(GLAutoDrawable drawable) { if (!firstRender) { if (++frameCount == 30) { timer.stop(); @@ -267,8 +267,8 @@ public class VertexProgWarp { } // Unused routines - public void reshape(GLDrawable drawable, int x, int y, int width, int height) {} - public void displayChanged(GLDrawable drawable, boolean modeChanged, boolean deviceChanged) {} + public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {} + public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {} //---------------------------------------------------------------------- // Internals only below this point |