// Might be reduced to !double-buff
 @Test
 public void testGL2OffScreenBitmapDblBuf() throws InterruptedException {
   final GLCapabilities reqGLCaps = new GLCapabilities(GLProfile.getDefault());
   reqGLCaps.setOnscreen(false);
   reqGLCaps.setBitmap(true);
   doTest(reqGLCaps, new Gears(1));
 }
Example #2
0
 public static GLCapabilities fixCaps(
     GLCapabilities caps, boolean onscreen, boolean pbuffer, boolean undecorated) {
   GLCapabilities caps2 = (GLCapabilities) caps.clone();
   caps2.setOnscreen(onscreen);
   caps2.setPBuffer(!onscreen && pbuffer);
   caps2.setDoubleBuffered(!onscreen);
   return caps2;
 }
Example #3
0
  private void initGL() {
    GLProfile profile = GLProfile.getDefault();
    GLCapabilities caps = new GLCapabilities(profile);
    caps.setBackgroundOpaque(true);
    caps.setOnscreen(true);
    caps.setSampleBuffers(false);

    if (TOOLKIT == AWT) {
      awtCanvas = new GLCanvas(caps);
      awtCanvas.setBounds(0, 0, applet.width, applet.height);
      awtCanvas.setBackground(new Color(0xFFCCCCCC, true));
      awtCanvas.setFocusable(true);

      applet.setLayout(new BorderLayout());
      applet.add(awtCanvas, BorderLayout.CENTER);

      if (MANUAL_FRAME_HANDLING) {
        awtCanvas.setIgnoreRepaint(true);
        awtCanvas.setAutoSwapBufferMode(false);
      }
    } else if (TOOLKIT == NEWT) {
      newtWindow = GLWindow.create(caps);
      newtCanvas = new NewtCanvasAWT(newtWindow);
      newtCanvas.setBounds(0, 0, applet.width, applet.height);
      newtCanvas.setBackground(new Color(0xFFCCCCCC, true));
      newtCanvas.setFocusable(true);

      applet.setLayout(new BorderLayout());
      applet.add(newtCanvas, BorderLayout.CENTER);

      if (MANUAL_FRAME_HANDLING) {
        newtCanvas.setIgnoreRepaint(true);
        newtWindow.setAutoSwapBufferMode(false);
      }
    }
  }