From 3d537d4239e3772ffdb33592e5e66844d94ac9f3 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 24 Feb 2023 15:33:39 +0100 Subject: 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. --- make/config/jogl/gl-impl-CustomJavaCode-gles1.java | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'make/config/jogl/gl-impl-CustomJavaCode-gles1.java') diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gles1.java b/make/config/jogl/gl-impl-CustomJavaCode-gles1.java index c9dafc419..964156473 100644 --- a/make/config/jogl/gl-impl-CustomJavaCode-gles1.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gles1.java @@ -280,42 +280,42 @@ private final boolean checkPackPBOBound(boolean throwException) { @Override public final void glVertexPointer(GLArrayData array) { - if(array.getComponentCount()==0) return; + if(array.getCompsPerElem()==0) return; if(array.isVBO()) { - glVertexPointer(array.getComponentCount(), array.getComponentType(), array.getStride(), array.getVBOOffset()); + glVertexPointer(array.getCompsPerElem(), array.getCompType(), array.getStride(), array.getVBOOffset()); } else { - glVertexPointer(array.getComponentCount(), array.getComponentType(), array.getStride(), array.getBuffer()); + glVertexPointer(array.getCompsPerElem(), array.getCompType(), array.getStride(), array.getBuffer()); } } @Override public final void glColorPointer(GLArrayData array) { - if(array.getComponentCount()==0) return; + if(array.getCompsPerElem()==0) return; if(array.isVBO()) { - glColorPointer(array.getComponentCount(), array.getComponentType(), array.getStride(), array.getVBOOffset()); + glColorPointer(array.getCompsPerElem(), array.getCompType(), array.getStride(), array.getVBOOffset()); } else { - glColorPointer(array.getComponentCount(), array.getComponentType(), array.getStride(), array.getBuffer()); + glColorPointer(array.getCompsPerElem(), array.getCompType(), array.getStride(), array.getBuffer()); } } @Override public final void glNormalPointer(GLArrayData array) { - if(array.getComponentCount()==0) return; - if(array.getComponentCount()!=3) { + if(array.getCompsPerElem()==0) return; + if(array.getCompsPerElem()!=3) { throw new GLException("Only 3 components per normal allowed"); } if(array.isVBO()) { - glNormalPointer(array.getComponentType(), array.getStride(), array.getVBOOffset()); + glNormalPointer(array.getCompType(), array.getStride(), array.getVBOOffset()); } else { - glNormalPointer(array.getComponentType(), array.getStride(), array.getBuffer()); + glNormalPointer(array.getCompType(), array.getStride(), array.getBuffer()); } } @Override public final void glTexCoordPointer(GLArrayData array) { - if(array.getComponentCount()==0) return; + if(array.getCompsPerElem()==0) return; if(array.isVBO()) { - glTexCoordPointer(array.getComponentCount(), array.getComponentType(), array.getStride(), array.getVBOOffset()); + glTexCoordPointer(array.getCompsPerElem(), array.getCompType(), array.getStride(), array.getVBOOffset()); } else { - glTexCoordPointer(array.getComponentCount(), array.getComponentType(), array.getStride(), array.getBuffer()); + glTexCoordPointer(array.getCompsPerElem(), array.getCompType(), array.getStride(), array.getBuffer()); } } -- cgit v1.2.3