Friday, 27 June 2014

Simple JOGL program

Simple program using JOGL. This should show black screen which is openGL canvas .


import java.awt.Frame;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLProfile;
import javax.media.opengl.awt.GLCanvas;
public class JavaApplication1 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
     
        GLProfile glp=GLProfile.getDefault();
GLCapabilities caps=new GLCapabilities(glp);
GLCanvas canvas=new GLCanvas(caps);
Frame f=new Frame();
f.setSize(500,500);
f.add(canvas);
f.setTitle("Hello JOGL");
f.setVisible(true);
f.addWindowListener(new WindowAdapter( ) {
public void windowClosing(WindowEvent e)
{
System.exit(0);
}

}  );

}
 
    }
 

No comments:

Post a Comment