public static SceneCanvas createSceneCanvas(int width,int height,boolean fullScreen,JoglCanvasRenderer canvasRenderer,boolean mainCanvas){
  GLCapabilities glCaps=new GLCapabilities(GLProfile.getDefault());
  if (glCaps.getAlphaBits() < 8) {
    glCaps.setAlphaBits(8);
  }
  if (glCaps.getRedBits() < 8) {
    glCaps.setRedBits(8);
  }
  if (glCaps.getGreenBits() < 8) {
    glCaps.setGreenBits(8);
  }
  if (glCaps.getBlueBits() < 8) {
    glCaps.setBlueBits(8);
  }
  int colorDepth=glCaps.getRedBits() + glCaps.getGreenBits() + glCaps.getBlueBits();
  if (glCaps.getDepthBits() < 32) {
    glCaps.setDepthBits(32);
  }
  DisplaySettings displaySettings=new DisplaySettings(width,height,colorDepth,0,glCaps.getAlphaBits(),glCaps.getDepthBits(),glCaps.getStencilBits(),0,fullScreen,glCaps.getStereo());
  SceneCanvas canvas=null;
  try {
    canvas=new SceneCanvas(displaySettings,glCaps,canvasRenderer,mainCanvas);
  }
 catch (  Exception e32) {
    e32.printStackTrace();
    try {
      glCaps.setDepthBits(24);
      displaySettings=new DisplaySettings(width,height,colorDepth,0,glCaps.getAlphaBits(),glCaps.getDepthBits(),glCaps.getStencilBits(),0,fullScreen,glCaps.getStereo());
      canvas=new SceneCanvas(displaySettings,glCaps,canvasRenderer,mainCanvas);
    }
 catch (    Exception e24) {
      e24.printStackTrace();
      throw new IllegalStateException("System is not configured for 24 or 32 bit graphics.");
    }
  }
  return (canvas);
}

public static SceneCanvas createSceneCanvas ( int width , int height , boolean fullScreen , JoglCanvasRenderer canvasRenderer , boolean mainCanvas ) { GLCapabilities glCaps = new GLCapabilities ( GLProfile . getDefault ( ) ) ; if ( glCaps . getAlphaBits ( ) < 8 ) { glCaps . setAlphaBits ( 8 ) ; } if ( glCaps . getRedBits ( ) < 8 ) { glCaps . setRedBits ( 8 ) ; } if ( glCaps . getGreenBits ( ) < 8 ) { glCaps . setGreenBits ( 8 ) ; } if ( glCaps . getBlueBits ( ) < 8 ) { glCaps . setBlueBits ( 8 ) ; } int colorDepth = glCaps . getRedBits ( ) + glCaps . getGreenBits ( ) + glCaps . getBlueBits ( ) ; if ( glCaps . getDepthBits ( ) < 32 ) { glCaps . setDepthBits ( 32 ) ; } DisplaySettings displaySettings = new DisplaySettings ( width , height , colorDepth , 0 , glCaps . getAlphaBits ( ) , glCaps . getDepthBits ( ) , glCaps . getStencilBits ( ) , 0 , fullScreen , glCaps . getStereo ( ) ) ; SceneCanvas canvas = null ; try { canvas = new SceneCanvas ( displaySettings , glCaps , canvasRenderer , mainCanvas ) ; } catch ( Exception e32 ) { e32 . printStackTrace ( ) ; try { glCaps . setDepthBits ( 24 ) ; displaySettings = new DisplaySettings ( width , height , colorDepth , 0 , glCaps . getAlphaBits ( ) , glCaps . getDepthBits ( ) , glCaps . getStencilBits ( ) , 0 , fullScreen , glCaps . getStereo ( ) ) ; canvas = new SceneCanvas ( displaySettings , glCaps , canvasRenderer , mainCanvas ) ; } catch ( Exception e24 ) { e24 . printStackTrace ( ) ; throw new IllegalStateException ( "System is not configured for 24 or 32 bit graphics." ) ; } } return ( canvas ) ; }
create a scenecanvas . try 32 bit color depth , then 24 , if there is an error .
