cleaner code

This commit is contained in:
Martin Pernollet 2022-02-22 16:10:21 +01:00
parent ec163c2f09
commit f1c2dc433a
1 changed files with 5 additions and 4 deletions

View File

@ -7,6 +7,7 @@ import org.jzy3d.plot3d.rendering.canvas.ICanvas;
import org.jzy3d.plot3d.rendering.scene.Scene;
import com.jogamp.opengl.GL;
import com.jogamp.opengl.GLAutoDrawable;
import com.jogamp.opengl.GLContext;
import com.jogamp.opengl.GLEventListener;
import com.jogamp.opengl.GLPipelineFactory;
import com.jogamp.opengl.util.GLReadBufferUtil;
@ -66,12 +67,12 @@ public class Renderer3d implements GLEventListener {
public void init(GLAutoDrawable canvas) {
if (canvas != null && canvas.getGL() != null && view != null) {
GLContext context = canvas.getGL().getContext();
if (debugGL)
canvas.getGL().getContext()
.setGL(GLPipelineFactory.create("com.jogamp.opengl.Debug", null, canvas.getGL(), null));
context.setGL(GLPipelineFactory.create("com.jogamp.opengl.Debug", null, canvas.getGL(), null));
if (traceGL)
canvas.getGL().getContext().setGL(GLPipelineFactory.create("com.jogamp.opengl.Trace", null,
canvas.getGL(), new Object[] {System.err}));
context.setGL(GLPipelineFactory.create("com.jogamp.opengl.Trace", null, canvas.getGL(), new Object[] {System.err}));
updatePainterWithGL(canvas);