| 982 | ArrayBuffer a = target.buffer(attribute, dimension); |
| 983 | if (a == null) { |
| 984 | a = target.arrayBufferFactory.newArrayBuffer((int) (num * GROWTH + 1), GL15.GL_ARRAY_BUFFER, attribute, |
| 985 | dimension, 0); |
| 986 | } |
| 987 | if (a.getSize() < (num + 1)) { |
| 988 | a = a.replaceWithSize((int) ((num + 1) * GROWTH + 1)); |
| 989 | target.setBuffer(attribute, a); |
| 990 | } |
| 991 | FloatBuffer f = a.floats(); |
| 992 | f.clear(); |
| 993 | f.position(dimension * vertexCursor); |
| 994 | return f; |
| 995 | } |
| 996 | |
| 997 | public ArrayBuffer ensureExists(int attribute, int dimension, int num) { |
| 998 | ArrayBuffer a = target.buffer(attribute, dimension); |
| 999 | if (a == null) { |
| 1000 | a = target.arrayBufferFactory.newArrayBuffer((int) (num * GROWTH + 1), GL15.GL_ARRAY_BUFFER, attribute, |
| 1001 | dimension, 0); |