aboutsummaryrefslogtreecommitdiffstats
path: root/src/graphui/classes/com/jogamp/graph
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-03-19 07:47:18 +0100
committerSven Gothel <[email protected]>2023-03-19 07:47:18 +0100
commitc04c8947c7cd0788ea8a4e615887d236eb2fbbb8 (patch)
tree07c8d504e4c1e24c4e55ad56efb5bd6daf30a0fc /src/graphui/classes/com/jogamp/graph
parentea4938a5e82332382c493044cbbd691e17743fb2 (diff)
Graph Scene: RegionRenderer is owned and never null
Diffstat (limited to 'src/graphui/classes/com/jogamp/graph')
-rw-r--r--src/graphui/classes/com/jogamp/graph/ui/gl/Scene.java24
1 files changed, 6 insertions, 18 deletions
diff --git a/src/graphui/classes/com/jogamp/graph/ui/gl/Scene.java b/src/graphui/classes/com/jogamp/graph/ui/gl/Scene.java
index f095783c9..9c9334182 100644
--- a/src/graphui/classes/com/jogamp/graph/ui/gl/Scene.java
+++ b/src/graphui/classes/com/jogamp/graph/ui/gl/Scene.java
@@ -177,18 +177,10 @@ public final class Scene implements GLEventListener {
public RegionRenderer getRenderer() { return renderer; }
/** Returns the associated RegionRenderer's RenderState, may be null. */
- public RenderState getRenderState() {
- if( null != renderer ) {
- return renderer.getRenderState();
- }
- return null;
- }
- public final Vertex.Factory<? extends Vertex> getVertexFactory() {
- if( null != renderer ) {
- return renderer.getRenderState().getVertexFactory();
- }
- return null;
- }
+ public RenderState getRenderState() { return renderer.getRenderState(); }
+
+ public final Vertex.Factory<? extends Vertex> getVertexFactory() { return renderer.getRenderState().getVertexFactory(); }
+
/**
* Sets the clear parameter for {@link GL#glClearColor(float, float, float, float) glClearColor(..)} and {@link GL#glClear(int) glClear(..)}
* to be issued at {@link #display(GLAutoDrawable)}.
@@ -281,9 +273,7 @@ public final class Scene implements GLEventListener {
public void init(final GLAutoDrawable drawable) {
System.err.println("SceneUIController: init");
cDrawable = drawable;
- if( null != renderer ) {
- renderer.init(drawable.getGL().getGL2ES2());
- }
+ renderer.init(drawable.getGL().getGL2ES2());
}
private static Comparator<Shape> shapeZAscComparator = new Comparator<Shape>() {
@@ -543,9 +533,7 @@ public final class Scene implements GLEventListener {
}
shapes.clear();
cDrawable = null;
- if( null != renderer ) {
- renderer.destroy(gl);
- }
+ renderer.destroy(gl);
}
/**