aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/opengl/GLArrayData.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-02-24 15:33:39 +0100
committerSven Gothel <[email protected]>2023-02-24 15:33:39 +0100
commit3d537d4239e3772ffdb33592e5e66844d94ac9f3 (patch)
tree191f5edc014e0da8d9aa1588ce875cbbc5397f1d /src/jogl/classes/com/jogamp/opengl/GLArrayData.java
parentd2d09d37be87bebf7700b9f82bccdf94a7ff5e51 (diff)
GLArrayData*: Shorten methods (*API Change*), use proper constructor and finalize immutables, add growthFactor (default golden ratio 1.618), add getCapacity*() and printStats(..)
The growthFactor becomes essential for better growth behavior and can be set via setGrowthFactor(). The other changes were merely to clean up the GLArrayData interface and its 4 implementations. Not great to change its API, but one name was misleading ['getComponentCount' -> 'getCompsPerEleme'], so overall .. readability is enhanced. Motivation for this change was the performance analysis and improvement of our Graph Curve Renderer.
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/GLArrayData.java')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/GLArrayData.java18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/GLArrayData.java b/src/jogl/classes/com/jogamp/opengl/GLArrayData.java
index ea2dfb0f3..972b10d4e 100644
--- a/src/jogl/classes/com/jogamp/opengl/GLArrayData.java
+++ b/src/jogl/classes/com/jogamp/opengl/GLArrayData.java
@@ -28,6 +28,7 @@
package com.jogamp.opengl;
+import java.io.PrintStream;
import java.nio.Buffer;
import com.jogamp.opengl.fixedfunc.GLPointerFunc;
@@ -159,26 +160,26 @@ public interface GLArrayData {
/**
* The number of components per element
*/
- public int getComponentCount();
+ public int getCompsPerElem();
/**
* The component's GL data type, ie. GL_FLOAT
*/
- public int getComponentType();
+ public int getCompType();
/**
* The component's size in bytes
*/
- public int getComponentSizeInBytes();
+ public int getBytesPerComp();
/**
* The current number of used elements.
* <p>
- * On element consist out of {@link #getComponentCount()} components.
+ * On element consist out of {@link #getCompsPerElem()} components.
* </p>
* In case the buffer's position is 0 (sealed, flipped), it's based on it's limit instead of it's position.
*/
- public int getElementCount();
+ public int getElemCount();
/**
* The currently used size in bytes.<br>
@@ -187,6 +188,13 @@ public interface GLArrayData {
public int getSizeInBytes();
/**
+ * The current capacity in bytes.
+ */
+ public int getCapacityInBytes();
+
+ public void printStats(final PrintStream out);
+
+ /**
* True, if GL shall normalize fixed point data while converting
* them into float.
* <p>