package pixelapp.roation; import java.awt.GraphicsDevice; import java.awt.GraphicsEnvironment; import javax.media.opengl.GLCapabilities; import javax.media.opengl.GLProfile; import javax.media.opengl.awt.GLCanvas; import javax.swing.JFrame; import com.jogamp.opengl.util.FPSAnimator; public class Lesson48 { private static JFrame myFrame; // Create JFrame object. public static void main(String[] args) { // Set the title of the Frame. myFrame = new JFrame("TexturedPolygon"); // Close program on Finish. myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // Eliminates the windows frames look. myFrame.setUndecorated(true); GLProfile glp = GLProfile.getDefault(); GLCapabilities caps = new GLCapabilities(glp); GLCanvas miCanvas = new GLCanvas(caps); //GLDisplay neheGLDisplay = GLDisplay.createGLDisplay("Lesson 48: ArcBall Controller"); Renderer renderer = new Renderer(); InputHandler inputHandler = new InputHandler(renderer); // Indicate Canvas to detect the events of OpenGL in this Class. miCanvas.addGLEventListener(renderer); miCanvas.addMouseListener(inputHandler); miCanvas.addMouseMotionListener(inputHandler); // Insert Canvas in the Frame. myFrame.add(miCanvas); // Size of the window myFrame.setSize(600, 600); // Make visible the object of most weight myFrame.setVisible(true); // Renders continuously JOGL2. FPSAnimator animator = new FPSAnimator(miCanvas, 30); animator.add(miCanvas); animator.start(); /** Full Screen Mode */ GraphicsEnvironment env = GraphicsEnvironment. getLocalGraphicsEnvironment(); GraphicsDevice device = env.getDefaultScreenDevice(); device.setFullScreenWindow(myFrame); //neheGLDisplay.addGLEventListener(renderer); //neheGLDisplay.addMouseListener(inputHandler); //neheGLDisplay.addMouseMotionListener(inputHandler); //neheGLDisplay.start(); } }