예제 #1
0
  @Override
  public void init(GLAutoDrawable drawable) {
    GL _gl = drawable.getGL();

    if (glDebug) {
      try {
        _gl =
            _gl.getContext()
                .setGL(GLPipelineFactory.create("javax.media.opengl.Debug", null, _gl, null));
      } catch (Exception e) {
        e.printStackTrace();
      }
    }

    if (glTrace) {
      try {
        // Trace ..
        _gl =
            _gl.getContext()
                .setGL(
                    GLPipelineFactory.create(
                        "javax.media.opengl.Trace", null, _gl, new Object[] {System.err}));
      } catch (Exception e) {
        e.printStackTrace();
      }
    }

    if (glSwapInterval >= 0) {
      _gl.setSwapInterval(glSwapInterval);
    }
  }
예제 #2
0
  public void init(final GLAutoDrawable drawable) {
    GL _gl = drawable.getGL();

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

    if (glDebug) {
      try {
        _gl =
            _gl.getContext()
                .setGL(GLPipelineFactory.create("javax.media.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(
                        "javax.media.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("---------------------------");
  }