summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Tschöpe <[email protected]>2010-10-31 20:06:43 +0800
committerSven Gothel <[email protected]>2010-11-15 16:31:25 +0800
commit03f397d2da70b8120908b631d53748678c46272c (patch)
tree10c8edb9e68466afd69ed21787473fd20134cd56
parentb4890c42c79419150ae17babe9ad10f46ee9fbbb (diff)
Fixed includes and adapt to the new interface-structure
As the interface structure was updated some time ago these tests didn't compile any more. This patch adjusts them to use the new structure, such that they can be run again.
-rw-r--r--test/Issue326Test1.java23
-rw-r--r--test/Issue326Test2.java21
-rw-r--r--test/Issue344Base.java30
3 files changed, 39 insertions, 35 deletions
diff --git a/test/Issue326Test1.java b/test/Issue326Test1.java
index 217c2819b..adf2861d0 100644
--- a/test/Issue326Test1.java
+++ b/test/Issue326Test1.java
@@ -7,14 +7,14 @@ import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.Random;
-import javax.media.opengl.GL;
+import javax.media.opengl.GL2;
import javax.media.opengl.GLAutoDrawable;
-import javax.media.opengl.GLCanvas;
import javax.media.opengl.GLEventListener;
+import javax.media.opengl.awt.GLCanvas;
import javax.media.opengl.glu.GLU;
import com.jogamp.opengl.util.Animator;
-import com.jogamp.opengl.util.j2d.TextRenderer;
+import com.jogamp.opengl.util.awt.TextRenderer;
/**
* Demonstrates corruption with older versions of TextRenderer. Two
@@ -52,16 +52,16 @@ public class Issue326Test1 extends Frame implements GLEventListener {
}
public void display(GLAutoDrawable drawable) {
- GL gl = drawable.getGL();
+ GL2 gl = drawable.getGL().getGL2();
gl.glClearColor(0, 0, 0, 0);
- gl.glClear(GL.GL_COLOR_BUFFER_BIT|GL.GL_DEPTH_BUFFER_BIT);
+ gl.glClear(GL2.GL_COLOR_BUFFER_BIT|GL2.GL_DEPTH_BUFFER_BIT);
- gl.glMatrixMode(GL.GL_PROJECTION);
+ gl.glMatrixMode(GL2.GL_PROJECTION);
gl.glLoadIdentity();
//new GLU().gluPerspective(45f, (float)width/(float)height, 0.1f, 1000f);
gl.glOrtho(0.0, 800, 0.0, 800, -100.0, 100.0);
- gl.glMatrixMode(GL.GL_MODELVIEW);
+ gl.glMatrixMode(GL2.GL_MODELVIEW);
gl.glLoadIdentity();
tr.beginRendering(800,800);
@@ -79,13 +79,14 @@ public class Issue326Test1 extends Frame implements GLEventListener {
public void reshape(GLAutoDrawable arg0, int arg1, int arg2, int arg3, int arg4) {
width = arg3;
height = arg4;
- GL gl = arg0.getGL();
+ GL2 gl = arg0.getGL().getGL2();
gl.glViewport(0, 0, width, height);
- gl.glMatrixMode(GL.GL_PROJECTION);
+ gl.glMatrixMode(GL2.GL_PROJECTION);
gl.glLoadIdentity();
gl.glOrtho(0.0, 800, 0.0, 200, -100.0, 100.0);
- gl.glMatrixMode(GL.GL_MODELVIEW);
+ gl.glMatrixMode(GL2.GL_MODELVIEW);
gl.glLoadIdentity();
}
- public void displayChanged(GLAutoDrawable arg0, boolean arg1, boolean arg2) {}
+
+ public void dispose(GLAutoDrawable drawable) {}
}
diff --git a/test/Issue326Test2.java b/test/Issue326Test2.java
index 10ec4417b..b87eee21b 100644
--- a/test/Issue326Test2.java
+++ b/test/Issue326Test2.java
@@ -1,8 +1,12 @@
import java.awt.Font;
import java.awt.Frame;
import java.awt.event.*;
-import javax.media.opengl.*;
-import com.jogamp.opengl.util.j2d.*;
+import javax.media.opengl.GL2;
+import javax.media.opengl.GLAutoDrawable;
+import javax.media.opengl.GLEventListener;
+import javax.media.opengl.awt.GLCanvas;
+
+import com.jogamp.opengl.util.awt.*;
/**
* Another test case demonstrating corruption with older version of
@@ -37,9 +41,9 @@ public class Issue326Test2 extends Frame implements GLEventListener {
}
public void display(GLAutoDrawable drawable) {
- GL gl = drawable.getGL();
+ GL2 gl = drawable.getGL().getGL2();
gl.glClearColor(0, 0, 0, 0);
- gl.glClear(GL.GL_COLOR_BUFFER_BIT|GL.GL_DEPTH_BUFFER_BIT);
+ gl.glClear(GL2.GL_COLOR_BUFFER_BIT|GL2.GL_DEPTH_BUFFER_BIT);
tr.beginRendering(drawable.getWidth(), drawable.getHeight());
tr.draw("LA CLAPI\u00c8RE \nAlt: 1100-1700m \nGlissement de terrain majeur", 16, 80);
@@ -54,13 +58,14 @@ public class Issue326Test2 extends Frame implements GLEventListener {
}
public void reshape(GLAutoDrawable arg0, int x, int y, int w, int h) {
- GL gl = arg0.getGL();
- gl.glMatrixMode(GL.GL_PROJECTION);
+ GL2 gl = arg0.getGL().getGL2();
+ gl.glMatrixMode(GL2.GL_PROJECTION);
gl.glLoadIdentity();
gl.glOrtho(0.0, w, 0.0, h, -1, 1);
- gl.glMatrixMode(GL.GL_MODELVIEW);
+ gl.glMatrixMode(GL2.GL_MODELVIEW);
gl.glLoadIdentity();
}
- public void displayChanged(GLAutoDrawable arg0, boolean arg1, boolean arg2) {}
+
+ public void dispose(GLAutoDrawable drawable) {}
}
diff --git a/test/Issue344Base.java b/test/Issue344Base.java
index 6d0c99290..8d0c3b0e1 100644
--- a/test/Issue344Base.java
+++ b/test/Issue344Base.java
@@ -1,14 +1,15 @@
import java.awt.BorderLayout;
-import java.awt.Color;
import java.awt.Font;
import java.awt.Frame;
import java.awt.event.*;
import java.awt.geom.*;
-import javax.media.opengl.*;
+import javax.media.opengl.GL2;
+import javax.media.opengl.GLAutoDrawable;
+import javax.media.opengl.GLEventListener;
+import javax.media.opengl.awt.GLCanvas;
import javax.media.opengl.glu.*;
-import com.jogamp.opengl.util.*;
-import com.jogamp.opengl.util.j2d.*;
+import com.jogamp.opengl.util.awt.TextRenderer;
/** Test Code adapted from TextCube.java (in JOGL demos)
*
@@ -50,14 +51,14 @@ public abstract class Issue344Base implements GLEventListener
}).start();
}
});
- frame.show();
+ frame.setVisible(true);
}
public void init(GLAutoDrawable drawable)
{
- GL gl = drawable.getGL();
+ GL2 gl = drawable.getGL().getGL2();
- gl.glEnable(GL.GL_DEPTH_TEST);
+ gl.glEnable(GL2.GL_DEPTH_TEST);
renderer = new TextRenderer(font, useMipMaps);
@@ -70,10 +71,10 @@ public abstract class Issue344Base implements GLEventListener
public void display(GLAutoDrawable drawable)
{
- GL gl = drawable.getGL();
- gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
+ GL2 gl = drawable.getGL().getGL2();
+ gl.glClear(GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT);
- gl.glMatrixMode(GL.GL_MODELVIEW);
+ gl.glMatrixMode(GL2.GL_MODELVIEW);
gl.glLoadIdentity();
glu.gluLookAt(0, 0, 10,
0, 0, 0,
@@ -94,14 +95,11 @@ public abstract class Issue344Base implements GLEventListener
public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height)
{
- GL gl = drawable.getGL();
- gl.glMatrixMode(GL.GL_PROJECTION);
+ GL2 gl = drawable.getGL().getGL2();
+ gl.glMatrixMode(GL2.GL_PROJECTION);
gl.glLoadIdentity();
glu.gluPerspective(15, (float) width / (float) height, 5, 15);
}
- public void displayChanged(GLAutoDrawable drawable, boolean modeChanged,
- boolean deviceChanged)
- {
- }
+ public void dispose(GLAutoDrawable drawable) {}
}