summaryrefslogtreecommitdiffstats
path: root/src/demos/es1/angeles/Main.java
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2009-06-15 23:05:16 +0000
committerKenneth Russel <[email protected]>2009-06-15 23:05:16 +0000
commit935d2596c13371bb745d921dbcb9f05b0c11a010 (patch)
tree7fcc310618ae5a90edc734dc821e75afc0f080aa /src/demos/es1/angeles/Main.java
parente2332d2f2908e68f1e77454c73f329f8ff2b400d (diff)
Deleted obsolete source code in preparation for copying JOGL_2_SANDBOX
on to trunk git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/trunk@351 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
Diffstat (limited to 'src/demos/es1/angeles/Main.java')
-rwxr-xr-xsrc/demos/es1/angeles/Main.java115
1 files changed, 0 insertions, 115 deletions
diff --git a/src/demos/es1/angeles/Main.java b/src/demos/es1/angeles/Main.java
deleted file mode 100755
index 563e554..0000000
--- a/src/demos/es1/angeles/Main.java
+++ /dev/null
@@ -1,115 +0,0 @@
-package demos.es1.angeles;
-
-import java.nio.*;
-import javax.media.opengl.*;
-import com.sun.javafx.newt.*;
-
-public class Main implements MouseListener {
-
- public boolean quit = false;
- public boolean toggleFS = false;
-
- public void mouseClicked(MouseEvent e) {
- switch(e.getClickCount()) {
- case 1:
- toggleFS=true;
- break;
- default:
- quit=true;
- break;
- }
- }
- public void mouseEntered(MouseEvent e) {
- }
- public void mouseExited(MouseEvent e) {
- }
- public void mousePressed(MouseEvent e) {
- }
- public void mouseReleased(MouseEvent e) {
- }
- public void mouseMoved(MouseEvent e) {
- }
- public void mouseDragged(MouseEvent e) {
- }
-
- public static void main(String[] args) {
- System.out.println("Angeles Main");
- try {
- Display display = NewtFactory.createDisplay(null); // local display
- Screen screen = NewtFactory.createScreen(display, 0); // screen 0
- Window window = NewtFactory.createWindow(screen, 0); // dummy VisualID
-
- Main ml = new Main();
- window.addMouseListener(ml);
-
- // Size OpenGL to Video Surface
- int width = 800;
- int height = 480;
- window.setSize(width, height);
- window.setFullscreen(true);
-
- // Hook this into EGL
- GLDrawableFactory factory = GLDrawableFactory.getFactory(GLDrawableFactory.PROFILE_GLES1, window);
- GLCapabilities caps = new GLCapabilities();
- // For emulation library, use 16 bpp
- caps.setRedBits(5);
- caps.setGreenBits(6);
- caps.setBlueBits(5);
- caps.setDepthBits(16);
- GLDrawable drawable = factory.createGLDrawable(window, caps, null);
- window.setVisible(true);
- drawable.setRealized(true);
- GLContext context = drawable.createContext(null);
- context.makeCurrent();
-
- GL gl = context.getGL();
-
- Angeles angel = new Angeles();
- angel.init(gl);
- angel.reshape(gl, 0, 0, window.getWidth(), window.getHeight());
-
- long startTime = System.currentTimeMillis();
- long lastTime = startTime, curTime = 0, dt0, dt1;
- int totalFrames = 0, lastFrames = 0;
-
- do {
- angel.display(gl);
- drawable.swapBuffers();
-
- totalFrames++; lastFrames++;
- curTime = System.currentTimeMillis();
- dt0 = curTime-lastTime;
- if ( (curTime-lastTime) > 5000 ) {
- dt1 = curTime-startTime;
- System.out.println(dt1/1000+"s, 5s: "+ (lastFrames*1000)/dt0 + " fps, "+
- "total: "+ (totalFrames*1000)/dt1 + " fps");
- lastTime=curTime;
- lastFrames=0;
- }
-
- if(ml.toggleFS) {
- window.setFullscreen(!window.isFullscreen());
- ml.toggleFS=false;
- }
-
- window.pumpMessages();
-
- // Thread.yield();
-
- // try{
- // Thread.sleep(10);
- // } catch(InterruptedException ie) {}
- } while (!ml.quit && (curTime - startTime) < 215000);
-
- // Shut things down cooperatively
- context.release();
- context.destroy();
- drawable.destroy();
- factory.shutdown();
- System.out.println("Angeles shut down cleanly.");
- } catch (GLException e) {
- e.printStackTrace();
- }
- System.exit(0);
- }
-}