Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.gmail.bernabe.laurent.jogl.simple_test;
- import java.awt.Frame;
- import java.awt.event.WindowAdapter;
- import java.awt.event.WindowEvent;
- import javax.media.opengl.awt.GLCanvas;
- import com.jogamp.opengl.util.Animator;
- public class SimpleTest extends Frame {
- public SimpleTest(){
- setTitle("simple test OpenGL");
- setSize(300, 300);
- setLocationRelativeTo(null);
- GLCanvas canvas3D = new GLCanvas();
- canvas3D.addGLEventListener(new MyGLEventListener());
- add(canvas3D);
- final Animator animator = new Animator(canvas3D);
- addWindowListener(new WindowAdapter() {
- @Override
- public void windowClosing(WindowEvent event) {
- animator.stop();
- System.exit(0);
- }
- });
- animator.start();
- }
- public static void main(String[] args) {
- new SimpleTest().setVisible(true);
- }
- private static final long serialVersionUID = -3365940389896758499L;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement