summaryrefslogtreecommitdiffstats
path: root/src/demos/testContextSharing/TestContextSharing.java
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/testContextSharing/TestContextSharing.java
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/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();
}