Пример #1
0
  public void init(final GLAutoDrawable drawable) {
    GL _gl = drawable.getGL();

    _gl.glGetError(); // flush error ..

    if (glDebug) {
      try {
        _gl =
            _gl.getContext()
                .setGL(GLPipelineFactory.create("com.jogamp.opengl.Debug", null, _gl, null));
      } catch (final Exception e) {
        throw new RuntimeException("can not set debug pipeline", e);
      }
    }

    if (glTrace) {
      try {
        _gl =
            _gl.getContext()
                .setGL(
                    GLPipelineFactory.create(
                        "com.jogamp.opengl.Trace", null, _gl, new Object[] {System.err}));
      } catch (final Exception e) {
        throw new RuntimeException("can not set trace pipeline", e);
      }
    }

    System.out.println(_gl);

    _gl.getContext().setGLReadDrawable(externalRead);
    if (_gl.isGL2GL3()) {
      _gl.getGL2GL3().glReadBuffer(GL.GL_FRONT);
    }
    System.out.println("---------------------------");
    System.out.println(_gl.getContext());
    System.out.println("---------------------------");
  }