aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-10-03 04:12:23 +0200
committerSven Gothel <[email protected]>2023-10-03 04:12:23 +0200
commit3b994439acd0c001b64e96634636026f11af619c (patch)
treefd1857dcea51b240e2fbf66f4651b4cc9886b863
parent4fd725b1cd4bf4d9f1bd3a20e3b23784485c3751 (diff)
TextureSequence.setTexCoordBBox(): Add 'verbose' parameter for debug output instead hard coded branch
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java8
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java2
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java2
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java2
4 files changed, 7 insertions, 7 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
index 7c924864a..2951eec90 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
@@ -311,9 +311,9 @@ public interface TextureSequence {
* @param box the {@Link AABBpx} of the destination
* @param letterBox true to produce letter-box space to match aspect-ratio, otherwise will zoom in
* @param colorTexBBox destination float[6] array for the following three texture-coordinate tuples: minX/minY, maxX/maxY, texW/texH
+ * @param verbose TODO
*/
- @SuppressWarnings("unused")
- public static void setTexCoordBBox(final Texture tex, final AABBox box, final boolean letterBox, final float[] colorTexBBox) {
+ public static void setTexCoordBBox(final Texture tex, final AABBox box, final boolean letterBox, final float[] colorTexBBox, final boolean verbose) {
final TextureCoords tc = tex.getImageTexCoords();
final float boxRatio = box.getWidth() / box.getHeight();
final float imgRatio = tex.getAspectRatio();
@@ -398,14 +398,14 @@ public interface TextureSequence {
}
colorTexBBox[4] = tcW;
colorTexBBox[5] = tcH;
- if( false ) {
+ if( verbose ) {
final float texWidthRatio = (float)tex.getImageWidth() / (float)tex.getWidth();
final float texHeightRatio = (float)tex.getImageHeight() / (float)tex.getHeight();
final float texRatio = ( tc.right() - tc.left() ) / ( tc.bottom() - tc.top() );
final float box2TexRatio = boxRatio / texRatio;
final float colorTexBBoxW = colorTexBBox[2] - colorTexBBox[0];
final float colorTexBBoxH = colorTexBBox[3] - colorTexBBox[1];
- System.err.println("XXX");
+ System.err.println("XXX setTexCoordBBox:");
System.err.println("XXX ColorTex imgRatio "+imgRatio+", texRatio "+texRatio+", texPixelRatio[w "+texWidthRatio+", h "+texHeightRatio+"], "+tex);
System.err.println("XXX ColorTexBBox lbox "+letterBox+", cut "+boxWidthCut+"/"+boxHeightCut+", ext "+boxWidthExt+"/"+boxHeightExt);
System.err.println("XXX ColorTexBBox min "+colorTexBBox[0]+"/"+colorTexBBox[1]+", max "+colorTexBBox[2]+" x "+colorTexBBox[3]+
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java
index c5b1e8309..040e0328c 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java
@@ -147,7 +147,7 @@ public final class VBORegion2PMSAAES2 extends GLRegion {
vpc_ileave.enableBuffer(gl, false);
if( hasColorTexture && null != gcu_ColorTexUnit && colorTexSeq.isTextureAvailable() ) {
- TextureSequence.setTexCoordBBox(colorTexSeq.getLastTexture().getTexture(), box, isColorTextureLetterbox(), colorTexBBox);
+ TextureSequence.setTexCoordBBox(colorTexSeq.getLastTexture().getTexture(), box, isColorTextureLetterbox(), colorTexBBox, false);
}
gca_FboVerticesAttr.seal(gl, false);
{
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java
index b05a04802..a26e5d70a 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java
@@ -245,7 +245,7 @@ public final class VBORegion2PVBAAES2 extends GLRegion {
vpc_ileave.seal(gl, true);
vpc_ileave.enableBuffer(gl, false);
if( hasColorTexture && null != gcu_ColorTexUnit && colorTexSeq.isTextureAvailable() ) {
- TextureSequence.setTexCoordBBox(colorTexSeq.getLastTexture().getTexture(), box, isColorTextureLetterbox(), colorTexBBox);
+ TextureSequence.setTexCoordBBox(colorTexSeq.getLastTexture().getTexture(), box, isColorTextureLetterbox(), colorTexBBox, false);
}
gca_FboVerticesAttr.seal(gl, false);
{
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java
index 634b53fe2..2514f4a1e 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java
@@ -90,7 +90,7 @@ public final class VBORegionSPES2 extends GLRegion {
vpc_ileave.seal(gl, true);
vpc_ileave.enableBuffer(gl, false);
if( hasColorTexture && null != gcu_ColorTexUnit && colorTexSeq.isTextureAvailable() ) {
- TextureSequence.setTexCoordBBox(colorTexSeq.getLastTexture().getTexture(), box, isColorTextureLetterbox(), colorTexBBox);
+ TextureSequence.setTexCoordBBox(colorTexSeq.getLastTexture().getTexture(), box, isColorTextureLetterbox(), colorTexBBox, false);
}
indicesBuffer.seal(gl, true);
indicesBuffer.enableBuffer(gl, false);