From 90a95e6f689b479f3c3ae3caf4e30447030c7682 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 7 Mar 2023 17:56:08 +0100 Subject: GLArrayData: Promote sealed() from GLArrayDataEditable, to correctly being used for getElemCount() instead of 0==position, ... (API change) API Change - sealed() moved up from GLArrayDataEditable -> GLArrayData - GLArrayDataWrapper is sealed by default - getSizeInBytes() -> getByteCount() - Semantics of getElemCount() and getByteCount() - Correctly use sealed() to switch from position to limit - instead of 0==position Aligned method names: - getElemCount() - elemPosition() - remainingElems() - getElemCapacity() to corresponding byte counts: - getByteCount() - bytePosition() - remainingBytes() - getByteCapacity() --- .../com/jogamp/opengl/test/junit/jogl/demos/es1/GearsObjectES1.java | 2 +- .../com/jogamp/opengl/test/junit/jogl/demos/es2/GearsObjectES2.java | 2 +- src/test/com/jogamp/opengl/test/junit/jogl/glsl/GLSLMiscHelper.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/test/com') diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/GearsObjectES1.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/GearsObjectES1.java index ccd3a1ef0..882cb2c5f 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/GearsObjectES1.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/GearsObjectES1.java @@ -68,7 +68,7 @@ public class GearsObjectES1 extends GearsObject { if( validateBuffers ) { final int bufferTarget = array.getVBOTarget(); final int bufferName = array.getVBOName(); - final long bufferSize = array.getSizeInBytes(); + final long bufferSize = array.getByteCount(); final int hasBufferName = gl.getBoundBuffer(bufferTarget); final GLBufferStorage hasStorage = gl.getBufferStorage(hasBufferName); final boolean ok = bufferName == hasBufferName && diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsObjectES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsObjectES2.java index 763dbd1ba..a74b6e6f1 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsObjectES2.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsObjectES2.java @@ -100,7 +100,7 @@ public class GearsObjectES2 extends GearsObject { array.bindBuffer(gl, true); final int bufferTarget = array.getVBOTarget(); final int bufferName = array.getVBOName(); - final long bufferSize = array.getSizeInBytes(); + final long bufferSize = array.getByteCount(); final int hasBufferName = gl.getBoundBuffer(bufferTarget); final GLBufferStorage hasStorage = gl.getBufferStorage(hasBufferName); final boolean ok = bufferName == hasBufferName && diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/GLSLMiscHelper.java b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/GLSLMiscHelper.java index 696c02490..6a7479993 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/GLSLMiscHelper.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/GLSLMiscHelper.java @@ -57,7 +57,7 @@ public class GLSLMiscHelper { gl.glGetVertexAttribiv(data.getLocation(), GL2ES2.GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, qi, 0); Assert.assertEquals(data.getVBOName(), qi[0]); final GLBufferStorage glStore = gl.getBufferStorage(data.getVBOName()); - Assert.assertEquals("GLBufferStorage size mismatch, storage "+glStore, data.getSizeInBytes(), null != glStore ? glStore.getSize() : -1); + Assert.assertEquals("GLBufferStorage size mismatch, storage "+glStore, data.getByteCount(), null != glStore ? glStore.getSize() : -1); } public static void pause(final long ms) throws InterruptedException { -- cgit v1.2.3