Example #1
0
  void redraw(GL2 gl) {
    if ((state == null) || (state.cgl.gl != gl))
      state = new GLState.Applier(new CurrentGL(gl, glconf));

    Frame f = curdraw;
    if ((f != null) && (f.on.gl == gl)) {
      GPUProfile.Frame curgf = null;
      if (Config.profilegpu) curgf = gprof.new Frame((GL3) gl);
      if (f.pf != null) f.pf.tick("awt");
      f.buf.run(gl);
      GOut.checkerr(gl);
      if (f.pf != null) f.pf.tick("gl");
      if (curgf != null) {
        curgf.tick("draw");
        curgf.fin();
      }

      if (glconf.pref.dirty) {
        glconf.pref.save();
        glconf.pref.dirty = false;
      }
      f.doneat = System.currentTimeMillis();
    }
  }