Esempio n. 1
0
 @Override
 protected GLJPanel createDrawable() {
   GLCapabilities caps = new GLCapabilities(null);
   caps.setSampleBuffers(true); // enable sample buffers for aliasing
   caps.setNumSamples(2);
   //
   GLJPanel panel = new GLJPanel(caps);
   panel.addGLEventListener(this);
   panel.addKeyListener(this);
   return panel;
 }
Esempio n. 2
0
 private static GLCapabilities stdcaps() {
   GLProfile prof = GLProfile.getDefault();
   GLCapabilities cap = new GLCapabilities(prof);
   cap.setDoubleBuffered(true);
   cap.setAlphaBits(8);
   cap.setRedBits(8);
   cap.setGreenBits(8);
   cap.setBlueBits(8);
   cap.setSampleBuffers(true);
   cap.setNumSamples(4);
   return (cap);
 }
Esempio n. 3
0
  public static void main(String[] args) {
    GLCapabilities caps = new GLCapabilities(null);
    caps.setSampleBuffers(true); // enable sample buffers for aliasing
    caps.setNumSamples(2);

    varray demo = new varray();

    JFrame.setDefaultLookAndFeelDecorated(true);
    JFrame frame = new JFrame("varray");
    frame.setSize(512, 256);
    frame.setLocationRelativeTo(null);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    frame.getContentPane().add(demo.drawable);
    frame.setVisible(true);
    demo.drawable.requestFocusInWindow();
  }