/** * */ package cg; import javax.swing.JFrame; import com.jogamp.opengl.GL2; import com.jogamp.opengl.GLAutoDrawable; import com.jogamp.opengl.GLCapabilities; import com.jogamp.opengl.GLEventListener; import com.jogamp.opengl.GLProfile; import com.jogamp.opengl.awt.GLCanvas; /** * @author * */ public class Main implements GLEventListener { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub //instantiating OpenGL functionality final GLProfile profile = GLProfile.get(GLProfile.GL2); GLCapabilities capabilities = new GLCapabilities(profile); //creating canvas final GLCanvas glcanvas = new GLCanvas(capabilities); //setting frame size inputs final int width = 800; final int height = 600; Main m = new Main(); glcanvas.addGLEventListener(m); //creating frame final JFrame frame = new JFrame ("OpenGL Fenster"); //adding canvas to frame frame.getContentPane().add(glcanvas); //setting visibility and sizes to frame: frame.setSize(width, height); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } @Override public void init(GLAutoDrawable drawable) { // TODO Auto-generated method stub } @Override public void dispose(GLAutoDrawable drawable) { // TODO Auto-generated method stub } @Override public void display(GLAutoDrawable drawable) { // TODO Auto-generated method stub } @Override public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { // TODO Auto-generated method stub } }