summaryrefslogtreecommitdiffstats
path: root/src/demos/testContextDestruction
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2005-10-24 19:21:28 +0000
committerKenneth Russel <[email protected]>2005-10-24 19:21:28 +0000
commit6873f65775af236ed270fcbd08661f5b53ba3598 (patch)
tree6fcefdc3a9429d7d3071b1464c11d40fa7bc3ab9 /src/demos/testContextDestruction
parent538be101e7bce7788c82e1b254a66deb5d35bb56 (diff)
Merged JSR-231 branch on to the main JOGL trunk. The main trunk now
contains the evolving JSR-231 Reference Implementation and the JSR-231 branch is permanently closed. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/trunk@144 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
Diffstat (limited to 'src/demos/testContextDestruction')
-rwxr-xr-xsrc/demos/testContextDestruction/TestContextDestruction.java20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/demos/testContextDestruction/TestContextDestruction.java b/src/demos/testContextDestruction/TestContextDestruction.java
index bfc0801..86652bb 100755
--- a/src/demos/testContextDestruction/TestContextDestruction.java
+++ b/src/demos/testContextDestruction/TestContextDestruction.java
@@ -44,7 +44,8 @@ import java.awt.event.*;
import java.util.*;
import javax.swing.*;
-import net.java.games.jogl.*;
+import javax.media.opengl.*;
+import com.sun.opengl.utils.*;
/** A simple demonstration exercising context creation and destruction
as a GLCanvas is added to and removed from its parent container. */
@@ -176,14 +177,14 @@ 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()));
GL gl = drawable.getGL();
float pos[] = { 5.0f, 5.0f, 10.0f, 0.0f };
- gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, pos);
+ gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, pos, 0);
gl.glEnable(GL.GL_CULL_FACE);
gl.glEnable(GL.GL_LIGHTING);
gl.glEnable(GL.GL_LIGHT0);
@@ -193,11 +194,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 +210,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 +224,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,14 +232,14 @@ 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) {
gearDisplayList = gl.glGenLists(1);
gl.glNewList(gearDisplayList, GL.GL_COMPILE);
float red[] = { 0.8f, 0.1f, 0.0f, 1.0f };
- gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, red);
+ gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, red, 0);
gear(gl, 1.0f, 4.0f, 1.0f, 20, 0.7f);
gl.glEndList();
}