Skip to content

Commit

Permalink
Fixes a bug where inspecting in OpenGL would lead to an NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexisDrogoul committed Mar 7, 2022
1 parent 9510a1c commit b9f1137
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ummisco.gama.opengl/src/ummisco/gama/opengl/OpenGL.java
Expand Up @@ -62,7 +62,6 @@
import ummisco.gama.opengl.renderer.caches.TextureCache2;
import ummisco.gama.opengl.renderer.helpers.AbstractRendererHelper;
import ummisco.gama.opengl.renderer.helpers.KeystoneHelper;
import ummisco.gama.opengl.renderer.helpers.PickingHelper;
import ummisco.gama.opengl.scene.AbstractObject;
import ummisco.gama.opengl.scene.ObjectDrawer;
import ummisco.gama.opengl.scene.geometry.GeometryDrawer;
Expand Down Expand Up @@ -137,7 +136,7 @@ public class OpenGL extends AbstractRendererHelper implements ITesselator {
private int viewWidth, viewHeight;

/** The picking state. */
private final PickingHelper pickingState;
// private final PickingHelper pickingState;

/** The texture cache. */
// Textures
Expand Down Expand Up @@ -236,7 +235,7 @@ public OpenGL(final IOpenGLRenderer renderer) {
super(renderer);
glut = new GLUT();
glu = new GLU();
pickingState = renderer.getPickingHelper();
// pickingState = renderer.getPickingHelper();
geometryCache = new GeometryCache(renderer);
glTesselatorDrawer = (final double[] ordinates) -> { tobj.gluTessVertex(ordinates, 0, ordinates); };
GLU.gluTessCallback(tobj, GLU.GLU_TESS_VERTEX, this);
Expand Down Expand Up @@ -1494,7 +1493,7 @@ public void endObject(final AbstractObject object, final boolean isPicking) {
gl.glTexEnvi(GL2ES1.GL_TEXTURE_ENV, GL2ES1.GL_TEXTURE_ENV_MODE, GL2ES1.GL_MODULATE);
}
// setObjectWireframe(false);
if (isPicking) { pickingState.tryPick(object.getAttributes()); }
if (isPicking) { renderer.getPickingHelper().tryPick(object.getAttributes()); }
}

/**
Expand Down

0 comments on commit b9f1137

Please sign in to comment.