summaryrefslogtreecommitdiffstats
path: root/src/demos/es1
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2009-03-13 12:10:29 +0000
committerSven Gothel <[email protected]>2009-03-13 12:10:29 +0000
commit8417ded5c1f892b58a4608ff248842c8aed4026a (patch)
treef9ce74136307bd122c72cec3babd03c26052e9df /src/demos/es1
parente03aaaf1b14cc40cb2c8f2158acf02390c4fafe6 (diff)
Adapt to JOGL nwi package changes
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/branches/JOGL_2_SANDBOX@320 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
Diffstat (limited to 'src/demos/es1')
-rwxr-xr-xsrc/demos/es1/Info.java3
-rwxr-xr-xsrc/demos/es1/RedSquare.java18
-rwxr-xr-xsrc/demos/es1/angeles/Main.java3
-rw-r--r--src/demos/es1/cube/Cube.java3
-rw-r--r--src/demos/es1/cube/CubeImmModeSink.java3
-rwxr-xr-xsrc/demos/es1/cubefbo/Main.java3
6 files changed, 25 insertions, 8 deletions
diff --git a/src/demos/es1/Info.java b/src/demos/es1/Info.java
index 527c6f1..4c7d667 100755
--- a/src/demos/es1/Info.java
+++ b/src/demos/es1/Info.java
@@ -1,6 +1,7 @@
package demos.es1;
import java.nio.*;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import javax.media.opengl.util.*;
import javax.media.opengl.glu.*;
@@ -17,7 +18,7 @@ public class Info implements GLEventListener {
System.err.println("Info.run()");
GLProfile.setProfileGL2ES1();
try {
- GLCapabilities caps = new GLCapabilities();
+ NWCapabilities caps = new NWCapabilities();
// For emulation library, use 16 bpp
caps.setRedBits(5);
caps.setGreenBits(6);
diff --git a/src/demos/es1/RedSquare.java b/src/demos/es1/RedSquare.java
index 04ea334..56a367a 100755
--- a/src/demos/es1/RedSquare.java
+++ b/src/demos/es1/RedSquare.java
@@ -1,6 +1,7 @@
package demos.es1;
import java.nio.*;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import javax.media.opengl.sub.fixed.*;
import javax.media.opengl.util.*;
@@ -10,12 +11,22 @@ import com.sun.opengl.impl.fixed.GLFixedFuncImpl;
import com.sun.javafx.newt.*;
-public class RedSquare implements MouseListener, GLEventListener {
+public class RedSquare implements KeyListener, MouseListener, GLEventListener {
private GLWindow window;
private GLU glu;
private boolean quit = false;
+ public void keyPressed(KeyEvent e) {
+ System.out.println(e);
+ }
+ public void keyReleased(KeyEvent e) {
+ System.out.println(e);
+ }
+ public void keyTyped(KeyEvent e) {
+ System.out.println(e);
+ }
+
public void mouseClicked(MouseEvent e) {
System.out.println("mouseevent: "+e);
switch(e.getClickCount()) {
@@ -46,7 +57,7 @@ public class RedSquare implements MouseListener, GLEventListener {
System.err.println("RedSquare.run()");
GLProfile.setProfileGLAny();
try {
- GLCapabilities caps = new GLCapabilities();
+ NWCapabilities caps = new NWCapabilities();
// For emulation library, use 16 bpp
caps.setRedBits(5);
caps.setGreenBits(6);
@@ -62,6 +73,7 @@ public class RedSquare implements MouseListener, GLEventListener {
window = GLWindow.create(nWindow, caps);
window.addMouseListener(this);
+ window.addKeyListener(this);
window.addGLEventListener(this);
// window.setEventHandlerMode(GLWindow.EVENT_HANDLER_GL_CURRENT); // default
// window.setEventHandlerMode(GLWindow.EVENT_HANDLER_GL_NONE); // no current ..
@@ -69,7 +81,7 @@ public class RedSquare implements MouseListener, GLEventListener {
window.enablePerfLog(true);
// Size OpenGL to Video Surface
window.setSize(width, height);
- window.setFullscreen(true);
+ // window.setFullscreen(true);
window.setVisible(true);
while (!quit && window.getDuration() < 20000) {
diff --git a/src/demos/es1/angeles/Main.java b/src/demos/es1/angeles/Main.java
index 5833c7c..4983619 100755
--- a/src/demos/es1/angeles/Main.java
+++ b/src/demos/es1/angeles/Main.java
@@ -1,6 +1,7 @@
package demos.es1.angeles;
import java.nio.*;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.javafx.newt.*;
@@ -35,7 +36,7 @@ public class Main implements MouseListener {
GLProfile.setProfileGLAny();
try {
// Hook this into EGL
- GLCapabilities caps = new GLCapabilities();
+ NWCapabilities caps = new NWCapabilities();
// For emulation library, use 16 bpp
caps.setRedBits(5);
caps.setGreenBits(6);
diff --git a/src/demos/es1/cube/Cube.java b/src/demos/es1/cube/Cube.java
index 63bea14..1ef6aab 100644
--- a/src/demos/es1/cube/Cube.java
+++ b/src/demos/es1/cube/Cube.java
@@ -32,6 +32,7 @@
package demos.es1.cube;
import java.nio.*;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import javax.media.opengl.sub.fixed.*;
import javax.media.opengl.util.*;
@@ -308,7 +309,7 @@ public class Cube implements GLEventListener {
System.err.println("Cube.run()");
GLProfile.setProfileGLAny();
try {
- GLCapabilities caps = new GLCapabilities();
+ NWCapabilities caps = new NWCapabilities();
// For emulation library, use 16 bpp
caps.setRedBits(5);
caps.setGreenBits(6);
diff --git a/src/demos/es1/cube/CubeImmModeSink.java b/src/demos/es1/cube/CubeImmModeSink.java
index c85fed0..c7536d2 100644
--- a/src/demos/es1/cube/CubeImmModeSink.java
+++ b/src/demos/es1/cube/CubeImmModeSink.java
@@ -31,6 +31,7 @@
*/
package demos.es1.cube;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import javax.media.opengl.sub.fixed.*;
import javax.media.opengl.util.*;
@@ -399,7 +400,7 @@ public class CubeImmModeSink implements GLEventListener {
System.err.println("CubeImmModeSink.run()");
GLProfile.setProfileGLAny();
try {
- GLCapabilities caps = new GLCapabilities();
+ NWCapabilities caps = new NWCapabilities();
// For emulation library, use 16 bpp
caps.setRedBits(5);
caps.setGreenBits(6);
diff --git a/src/demos/es1/cubefbo/Main.java b/src/demos/es1/cubefbo/Main.java
index c9abaf2..f245733 100755
--- a/src/demos/es1/cubefbo/Main.java
+++ b/src/demos/es1/cubefbo/Main.java
@@ -1,6 +1,7 @@
package demos.es1.cubefbo;
import java.nio.*;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.javafx.newt.*;
@@ -41,7 +42,7 @@ public class Main implements MouseListener {
GLProfile.setProfileGLAny();
try {
// Hook this into EGL
- GLCapabilities caps = new GLCapabilities();
+ NWCapabilities caps = new NWCapabilities();
// For emulation library, use 16 bpp
caps.setRedBits(5);
caps.setGreenBits(6);