Package javax.media.opengl.awt

Examples of javax.media.opengl.awt.GLCanvas


        GLCapabilities config = new GLCapabilities(GLProfile.get(GLProfile.GL2));
        config.setSampleBuffers(true);
        config.setNumSamples(4);

        GLCanvas canvas = new GLCanvas(config);
        canvas.addGLEventListener(this);
        usi.init(canvas);

        JFrame frame = new JFrame("JOGL-JOCL Interoperability Example");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.add(canvas);
View Full Code Here


        // setup OpenGL Version 2
        GLProfile profile = GLProfile.get(GLProfile.GL2);
        GLCapabilities capabilities = new GLCapabilities(profile);

        // The canvas is the widget that's drawn in the JFrame
        GLCanvas glcanvas = new GLCanvas(capabilities);
        glcanvas.addGLEventListener(new Renderer());
        glcanvas.setSize( 1000, 500 );

        JFrame frame = new JFrame( "Hello World" );
        frame.getContentPane().add( glcanvas);

        // shutdown the program on windows close event
View Full Code Here

    private final GLCanvas glCanvas;
    private final GLUT glut = new GLUT();

    public GraphCanvas() {
        super();
        glCanvas = new GLCanvas(getCaps());
        super.initDrawable(glCanvas);
        glCanvas.setMinimumSize(new Dimension(0, 0));   //Fix Canvas resize Issue

        //Basic init
        graphComponent = (Component) glCanvas;
View Full Code Here

  public Window() {
    GLProfile glp = GLProfile.getMinimum(true);
    GLCapabilities caps = new GLCapabilities(glp);
    caps.setDepthBits(24);
    this.canvas = new GLCanvas(caps);

    this.frame = new JFrame("Hexel");
    this.frame.setSize(1280, 800);
    this.frame.add(this.canvas);
    this.frame.setVisible(true);
View Full Code Here

     * @param c the container to which to add the canvas
     * @throws IllegalStateException if the Canvas3D is already attached to a Container
     */
    void addNotify(Container c) {
        if (canvas != null) throw new IllegalStateException(Xenon3D.ERR_CANVAS_ALREADY_ATTACHED);
        canvas = new GLCanvas(caps);
        if (view != null) canvas.addGLEventListener(view.getInternalListener());
        c.add(canvas);
    }
View Full Code Here

   
    if(lightweight) {
      canvas = new GLJPanel(CAPABILITIES, null, glContext);
    } else {
      canvas = new GLCanvas(CAPABILITIES, null, glContext, null);
    }
    canvas.addGLEventListener(this);
   
    component = (Component)canvas;
    component.addComponentListener(this);
View Full Code Here

    this.ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    this.gd = ge.getDefaultScreenDevice();
    this.gc = gd.getDefaultConfiguration();
   
//    this.canvas = new GLCanvas(caps);
    this.canvas = new GLCanvas();
    this.canvas.addMouseListener(ioListener);
    this.canvas.addMouseMotionListener(ioListener);
    this.canvas.addMouseWheelListener(ioListener);
    this.canvas.addKeyListener(ioListener);
   
View Full Code Here

  private PA1() {
    // enables double buffering
    this.capabilities.setDoubleBuffered(true);
    this.capabilities.setStencilBits(8);
   
    this.canvas = new GLCanvas(this.capabilities);
    this.canvas.addGLEventListener(this);
    this.canvas.addMouseListener(this);
    this.canvas.addMouseMotionListener(this);
    this.canvas.addKeyListener(this);
    // auto swap buffer mode is true by default, but we are explicit here
View Full Code Here

        // Run the GUI codes in the event-dispatching thread for thread safety
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                //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
View Full Code Here

TOP

Related Classes of javax.media.opengl.awt.GLCanvas

Copyright © 2018 www.massapicom. 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.