Java Code Examples for com.jogamp.opengl.awt.GLCanvas#setSize()

The following examples show how to use com.jogamp.opengl.awt.GLCanvas#setSize() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JCuboid.java    From MeteoInfo with GNU Lesser General Public License v3.0 6 votes vote down vote up
public static void main(String[] args) {

        final GLProfile gp = GLProfile.get(GLProfile.GL2);
        GLCapabilities cap = new GLCapabilities(gp);

        final GLCanvas gc = new GLCanvas(cap);
        JCuboid cuboid = new JCuboid();

        gc.addGLEventListener(cuboid);
        gc.setSize(100, 100);

        final JFrame frame = new JFrame(" JOGL Cuboid");
        frame.add(gc);
        frame.setSize(500, 400);
        frame.setVisible(true);
        final FPSAnimator animator = new FPSAnimator(gc, 300, true);

        animator.start();
    }
 
Example 2
Source File: JRotation.java    From MeteoInfo with GNU Lesser General Public License v3.0 6 votes vote down vote up
public static void main(String[] args) {

        final GLProfile gp = GLProfile.get(GLProfile.GL2);
        GLCapabilities cap = new GLCapabilities(gp);

        final GLCanvas gc = new GLCanvas(cap);
        JRotation jr = new JRotation();
        gc.addGLEventListener(jr);
        gc.setSize(400, 400);

        final JFrame frame = new JFrame("JOGL Rotation");

        frame.add(gc);
        frame.setSize(500, 400);
        frame.setVisible(true);

        final FPSAnimator animator = new FPSAnimator(gc, 400, true);
        animator.start();

    }
 
Example 3
Source File: Triangle.java    From MeteoInfo with GNU Lesser General Public License v3.0 6 votes vote down vote up
public static void main(String[] args) {

        final GLProfile gp = GLProfile.get(GLProfile.GL2);
        GLCapabilities cap = new GLCapabilities(gp);

        final GLCanvas gc = new GLCanvas(cap);
        Triangle tr = new Triangle();
        gc.addGLEventListener(tr);
        gc.setSize(400, 400);

        final JFrame frame = new JFrame("JOGL Triangle");
        frame.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent windowevent) {
                frame.dispose();
                System.exit(0);
            }
        });
        frame.add(gc);
        frame.setSize(500, 400);
        frame.setVisible(true);
    }
 
Example 4
Source File: Rhombus.java    From MeteoInfo with GNU Lesser General Public License v3.0 6 votes vote down vote up
public static void main(String[] args) {

        //getting the capabilities object of GL2 profile
        final GLProfile profile = GLProfile.get(GLProfile.GL2);
        GLCapabilities capabilities = new GLCapabilities(profile);

        // The canvas
        final GLCanvas glcanvas = new GLCanvas(capabilities);
        Rhombus b = new Rhombus();
        glcanvas.addGLEventListener(b);
        glcanvas.setSize(400, 400);

        //creating frame
        final JFrame frame = new JFrame(" Rhombus 3d");

        //adding canvas to it
        frame.getContentPane().add(glcanvas);
        frame.setSize(frame.getContentPane().getPreferredSize());
        frame.setVisible(true);
    }
 
Example 5
Source File: JPaddle.java    From MeteoInfo with GNU Lesser General Public License v3.0 6 votes vote down vote up
public static void main(String[] args) {

        final GLProfile gp = GLProfile.get(GLProfile.GL2);
        GLCapabilities cap = new GLCapabilities(gp);

        final GLCanvas gc = new GLCanvas(cap);
        JPaddle paddle = new JPaddle();

        gc.addGLEventListener(paddle);
        gc.setSize(400, 400);

        final JFrame frame = new JFrame("Motor Paddle");
        frame.add(gc);
        frame.setSize(600, 500);
        frame.setVisible(true);

        final FPSAnimator animator = new FPSAnimator(gc, 200, true);
        animator.start();
    }
 
Example 6
Source File: JLight.java    From MeteoInfo with GNU Lesser General Public License v3.0 6 votes vote down vote up
public static void main(String[] args) {

        final GLProfile gp = GLProfile.get(GLProfile.GL2);
        GLCapabilities cap = new GLCapabilities(gp);

        final GLCanvas gc = new GLCanvas(cap);
        JLight tr = new JLight();
        gc.addGLEventListener(tr);
        gc.setSize(400, 400);

        final JFrame frame = new JFrame("JOGL Lighting");
        frame.add(gc);
        frame.setSize(500, 400);
        frame.setVisible(true);

        final FPSAnimator animator = new FPSAnimator(gc, 400, true);
        animator.start();
    }
 
Example 7
Source File: J3DTriangle.java    From MeteoInfo with GNU Lesser General Public License v3.0 6 votes vote down vote up
public static void main(String[] args) {

        final GLProfile gp = GLProfile.get(GLProfile.GL2);
        GLCapabilities cap = new GLCapabilities(gp);

        final GLCanvas gc = new GLCanvas(cap);
        J3DTriangle triangle = new J3DTriangle();

        gc.addGLEventListener(triangle);
        gc.setSize(400, 400);

        final JFrame frame = new JFrame("3D Triangle");

        frame.add(gc);
        frame.setSize(500, 400);
        frame.setVisible(true);

        final FPSAnimator animator = new FPSAnimator(gc, 400, true);
        animator.start();
    }
 
Example 8
Source File: J3DBasic.java    From MeteoInfo with GNU Lesser General Public License v3.0 6 votes vote down vote up
public static void main(String[] args) {

        final GLProfile gp = GLProfile.get(GLProfile.GL2);
        GLCapabilities cap = new GLCapabilities(gp);

        final GLCanvas gc = new GLCanvas(cap);
        J3DBasic b = new J3DBasic();
        gc.addGLEventListener(b);
        gc.setSize(600, 400);

        final JFrame frame = new JFrame("JOGL 3D");

        frame.getContentPane().add(gc);
        frame.setSize(frame.getContentPane().getPreferredSize());
        frame.setVisible(true);
    }
 
Example 9
Source File: JQuad.java    From MeteoInfo with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static void main(String[] args) {

        final GLProfile gp = GLProfile.get(GLProfile.GL2);
        GLCapabilities cap = new GLCapabilities(gp);

        final GLCanvas gc = new GLCanvas(cap);
        JQuad jq = new JQuad();
        gc.addGLEventListener(jq);
        gc.setSize(400, 400);

        final JFrame frame = new JFrame("JOGL Primitive Quadrilateral");
        frame.add(gc);
        frame.setSize(500, 400);
        frame.setVisible(true);
    }
 
Example 10
Source File: JColor.java    From MeteoInfo with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static void main(String[] args) {

        final GLProfile gp = GLProfile.get(GLProfile.GL2);
        GLCapabilities cap = new GLCapabilities(gp);

        final GLCanvas gc = new GLCanvas(cap);
        JColor jc = new JColor();
        gc.addGLEventListener(jc);
        gc.setSize(400, 400);

        final JFrame frame = new JFrame("JOGL Coloring");
        frame.add(gc);
        frame.setSize(500, 400);
        frame.setVisible(true);
    }
 
Example 11
Source File: JScaling.java    From MeteoInfo with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static void main(String[] args) {

        final GLProfile gp = GLProfile.get(GLProfile.GL2);
        GLCapabilities cap = new GLCapabilities(gp);

        final GLCanvas gc = new GLCanvas(cap);
        JScaling js = new JScaling();
        gc.addGLEventListener(js);
        gc.setSize(400, 400);

        final JFrame frame = new JFrame("After Scaling");
        frame.add(gc);
        frame.setSize(500, 400);
        frame.setVisible(true);
    }
 
Example 12
Source File: JMColor.java    From MeteoInfo with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static void main(String[] args) {

        final GLProfile gp = GLProfile.get(GLProfile.GL2);
        GLCapabilities cap = new GLCapabilities(gp);

        final GLCanvas gc = new GLCanvas(cap);
        JMColor jc = new JMColor();
        gc.addGLEventListener(jc);
        gc.setSize(400, 400);

        final JFrame frame = new JFrame("JOGL Mixed Coloring");
        frame.add(gc);
        frame.setSize(500, 400);
        frame.setVisible(true);
    }