summaryrefslogtreecommitdiffstats
path: root/src/demos/testContextSharing/TestContextSharing.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/demos/testContextSharing/TestContextSharing.java')
-rw-r--r--src/demos/testContextSharing/TestContextSharing.java17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/demos/testContextSharing/TestContextSharing.java b/src/demos/testContextSharing/TestContextSharing.java
index 569fa50..c6d7552 100644
--- a/src/demos/testContextSharing/TestContextSharing.java
+++ b/src/demos/testContextSharing/TestContextSharing.java
@@ -42,7 +42,8 @@ package demos.testContextSharing;
import java.awt.*;
import java.util.*;
-import net.java.games.jogl.*;
+import javax.media.opengl.*;
+import com.sun.opengl.utils.*;
/** A simple demonstration of sharing of display lists between drawables. */
@@ -62,7 +63,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.getContext(), null);
canvas2.addGLEventListener(new Listener());
canvas2.setSize(256, 256);
Frame frame2 = new Frame("Canvas 2");
@@ -96,13 +97,13 @@ 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();
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);
@@ -113,7 +114,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 +123,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 +137,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) {
@@ -147,7 +148,7 @@ public class TestContextSharing {
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();
}