Examples of FPSAnimator


Examples of com.jogamp.opengl.util.FPSAnimator

                //Create the OpenGL rendering canvas
                GLCanvas canvas = new NormansAdventure();
                canvas.setPreferredSize( new Dimension(CANVAS_WIDTH, CANVAS_HEIGHT));
               
                // Create an animator that drives canvas' display() at the specified FPS
                final FPSAnimator animator = new FPSAnimator(canvas, FPS, true);
               
                //Create the top-level container
                final JFrame frame = new JFrame(); // Swing's JFrame or AWT's Frame
                frame.getContentPane().add(canvas);
                frame.addWindowListener(new WindowAdapter() {
                    @Override
                    public void windowClosing(WindowEvent e) {
                        // Use a dedicated thread to run the stop() to ensure the animator
                        // thread stops before program exists.
                        new Thread() {
                            @Override
                            public void run() {
                                if (animator.isStarted()) animator.stop();
                                System.exit(0);
                            }
                        }.start();
                    }
                });
                frame.setTitle(TITLE);
                frame.pack();
                frame.setVisible(true);
                animator.start(); // Start the animation loop
            }
        });
    }
View Full Code Here

Examples of com.sun.opengl.util.FPSAnimator

      renderer.started = true;     
      if (useOwnFrameRate) {
        // Remove from GLGraphics control and pass on to
        // the FPSAnimator
        override = true;
        animator = new FPSAnimator(canvas, (int)frameRateTarget);
        animator.start();
        return;
      }   
      canvas.display();
    }
View Full Code Here

Examples of com.sun.opengl.util.FPSAnimator

        this.fullscreen = fullscreen;
        this.width = width;
        this.height = height;

        animator = new FPSAnimator( glCanvas, 60, false );
        animator.setRunAsFastAsPossible(true);
    }
View Full Code Here

Examples of com.sun.opengl.util.FPSAnimator

        this.fullscreen = fullscreen;
        this.width = width;
        this.height = height;

        animator = new FPSAnimator( glCanvas, 60, false);
        animator.setRunAsFastAsPossible(true);
    }
View Full Code Here

Examples of com.sun.opengl.util.FPSAnimator

        //addKeyListener( new MyKeyAdapter() );

        this.width = width;
        this.height = height;

        animator = new FPSAnimator( glCanvas,1000);
        animator.setRunAsFastAsPossible(true);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.