MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / buffer

Method buffer

src/main/java/field/graphics/BaseMesh.java:222–237  ·  view source on GitHub ↗
(int attribute, int dimension)

Source from the content-addressed store, hash-verified

220 }
221
222 public ArrayBuffer buffer(int attribute, int dimension) {
223 if (buffers[attribute] == null && dimension > 0) {
224 buffers[attribute] = arrayBufferFactory.newArrayBuffer(maxVertex, GL_ARRAY_BUFFER, attribute, dimension, 0);
225 return buffers[attribute];
226 }
227
228 if (dimension == 0)
229 return buffers[attribute];
230
231 if (buffers[attribute].getDimension() != dimension)
232 throw new IllegalArgumentException(" dimension mismatch. Attribute " + attribute + " was previously declared to be of dimension " + buffers[attribute].getDimension() + " not" +
233 " " +
234 "" + dimension);
235
236 return buffers[attribute];
237 }
238
239 public Map<Integer, ArrayBuffer> buffers() {
240 Map<Integer, ArrayBuffer> m = new LinkedHashMap<>();

Callers 4

vertexMethod · 0.95
auxMethod · 0.95
ensureSizeMethod · 0.45
ensureExistsMethod · 0.45

Calls 2

newArrayBufferMethod · 0.65
getDimensionMethod · 0.65

Tested by

no test coverage detected