summaryrefslogtreecommitdiffstats
path: root/src/graphui
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-08-01 18:57:41 +0200
committerSven Gothel <[email protected]>2023-08-01 18:57:41 +0200
commitde4767e90f752cb9804403fa4ac775394bb45324 (patch)
tree34c9f5cc1da976e36fe946e5aa6e05113474699f /src/graphui
parent285459363469e60df9db51a4c0485ec21d4e04ae (diff)
Graph Add {GLRegion, GraphShape}.setTextureUnit(int): Allowing to set texture unit after ctor
Diffstat (limited to 'src/graphui')
-rw-r--r--src/graphui/classes/com/jogamp/graph/ui/GraphShape.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/graphui/classes/com/jogamp/graph/ui/GraphShape.java b/src/graphui/classes/com/jogamp/graph/ui/GraphShape.java
index 7dccd41a0..f0329ad3c 100644
--- a/src/graphui/classes/com/jogamp/graph/ui/GraphShape.java
+++ b/src/graphui/classes/com/jogamp/graph/ui/GraphShape.java
@@ -53,6 +53,7 @@ import com.jogamp.opengl.util.texture.TextureSequence;
*/
public abstract class GraphShape extends Shape {
protected final int renderModes;
+ protected int pass2TexUnit = GLRegion.DEFAULT_TWO_PASS_TEXTURE_UNIT;
protected GLRegion region = null;
protected float oshapeSharpness = OutlineShape.DEFAULT_SHARPNESS;
private int regionQuality = Region.MAX_QUALITY;
@@ -83,6 +84,15 @@ public abstract class GraphShape extends Shape {
}
return this;
}
+
+ /** Set the 2nd pass texture unit. */
+ public void setTextureUnit(final int pass2TexUnit) {
+ this.pass2TexUnit = pass2TexUnit;
+ if( null != region ) {
+ region.setTextureUnit(pass2TexUnit);
+ }
+ }
+
/**
* Return the shape's Graph {@link Region}'s quality parameter.
* @see #setQuality(int)
@@ -178,10 +188,10 @@ public abstract class GraphShape extends Shape {
indexCount += 24;
}
if( null == region ) {
- region = GLRegion.create(glp, renderModes, colorTexSeq, vertexCount, indexCount);
+ region = GLRegion.create(glp, renderModes, colorTexSeq, pass2TexUnit, vertexCount, indexCount);
} else if( null == gl ) {
dirtyRegions.add(region);
- region = GLRegion.create(glp, renderModes, colorTexSeq, vertexCount, indexCount);
+ region = GLRegion.create(glp, renderModes, colorTexSeq, pass2TexUnit, vertexCount, indexCount);
} else {
region.clear(gl);
region.setBufferCapacity(vertexCount, indexCount);