/** @return the number of indices currently stored in this buffer */ public int getNumIndices () { return empty ? 0 : buffer.limit(); }
/** @return the number of indices currently stored in this buffer */ public int getNumIndices () { return empty ? 0 : buffer.limit(); }
/** @return the number of indices currently stored in this buffer */ public int getNumIndices () { return empty ? 0 : buffer.limit(); }
/** @return the number of indices currently stored in this buffer */ public int getNumIndices () { return buffer.limit(); }
/** @return the number of indices currently stored in this buffer */ public int getNumIndices () { return buffer.limit(); }
/** @return the number of indices currently stored in this buffer */ public int getNumIndices () { return empty ? 0 : buffer.limit(); }
/** Returns a string representing the state of this short buffer. * * @return a string representing the state of this short buffer. * @since Android 1.0 */ public String toString () { StringBuilder sb = new StringBuilder(); sb.append(getClass().getName()); sb.append(", status: capacity="); //$NON-NLS-1$ sb.append(capacity()); sb.append(" position="); //$NON-NLS-1$ sb.append(position()); sb.append(" limit="); //$NON-NLS-1$ sb.append(limit()); return sb.toString(); } }
/** Returns a string representing the state of this short buffer. * * @return a string representing the state of this short buffer. * @since Android 1.0 */ public String toString () { StringBuilder sb = new StringBuilder(); sb.append(getClass().getName()); sb.append(", status: capacity="); //$NON-NLS-1$ sb.append(capacity()); sb.append(" position="); //$NON-NLS-1$ sb.append(position()); sb.append(" limit="); //$NON-NLS-1$ sb.append(limit()); return sb.toString(); } }
/** Binds this IndexBufferObject for rendering with glDrawElements. */ public void bind () { if (bufferHandle == 0) throw new GdxRuntimeException("No buffer allocated!"); Gdx.gl20.glBindBuffer(GL20.GL_ELEMENT_ARRAY_BUFFER, bufferHandle); if (isDirty) { byteBuffer.limit(buffer.limit() * 2); Gdx.gl20.glBufferData(GL20.GL_ELEMENT_ARRAY_BUFFER, byteBuffer.limit(), byteBuffer, usage); isDirty = false; } isBound = true; }
/** Binds this IndexBufferObject for rendering with glDrawElements. */ public void bind () { if (bufferHandle == 0) throw new GdxRuntimeException("No buffer allocated!"); Gdx.gl20.glBindBuffer(GL20.GL_ELEMENT_ARRAY_BUFFER, bufferHandle); if (isDirty) { byteBuffer.limit(buffer.limit() * 2); Gdx.gl20.glBufferData(GL20.GL_ELEMENT_ARRAY_BUFFER, byteBuffer.limit(), byteBuffer, usage); isDirty = false; } isBound = true; }
/** Binds this IndexBufferObject for rendering with glDrawElements. */ public void bind () { if (bufferHandle == 0) throw new GdxRuntimeException("IndexBufferObject cannot be used after it has been disposed."); Gdx.gl20.glBindBuffer(GL20.GL_ELEMENT_ARRAY_BUFFER, bufferHandle); if (isDirty) { byteBuffer.limit(buffer.limit() * 2); Gdx.gl20.glBufferSubData(GL20.GL_ELEMENT_ARRAY_BUFFER, 0, byteBuffer.limit(), byteBuffer); isDirty = false; } isBound = true; }
/** Binds this IndexBufferObject for rendering with glDrawElements. */ public void bind () { if (bufferHandle == 0) throw new GdxRuntimeException("IndexBufferObject cannot be used after it has been disposed."); Gdx.gl20.glBindBuffer(GL20.GL_ELEMENT_ARRAY_BUFFER, bufferHandle); if (isDirty) { byteBuffer.limit(buffer.limit() * 2); Gdx.gl20.glBufferSubData(GL20.GL_ELEMENT_ARRAY_BUFFER, 0, byteBuffer.limit(), byteBuffer); isDirty = false; } isBound = true; }
public void setIndices (ShortBuffer indices) { int pos = indices.position(); isDirty = true; buffer.clear(); buffer.put(indices); buffer.flip(); indices.position(pos); byteBuffer.position(0); byteBuffer.limit(buffer.limit() << 1); if (isBound) { Gdx.gl20.glBufferSubData(GL20.GL_ELEMENT_ARRAY_BUFFER, 0, byteBuffer.limit(), byteBuffer); isDirty = false; } }
public void setIndices (ShortBuffer indices) { int pos = indices.position(); isDirty = true; buffer.clear(); buffer.put(indices); buffer.flip(); indices.position(pos); byteBuffer.position(0); byteBuffer.limit(buffer.limit() << 1); if (isBound) { Gdx.gl20.glBufferSubData(GL20.GL_ELEMENT_ARRAY_BUFFER, 0, byteBuffer.limit(), byteBuffer); isDirty = false; } }
public void setIndices (ShortBuffer indices) { isDirty = true; int pos = indices.position(); buffer.clear(); buffer.put(indices); buffer.flip(); indices.position(pos); byteBuffer.position(0); byteBuffer.limit(buffer.limit() << 1); if (isBound) { Gdx.gl20.glBufferData(GL20.GL_ELEMENT_ARRAY_BUFFER, byteBuffer.limit(), byteBuffer, usage); isDirty = false; } }
public void setIndices (ShortBuffer indices) { isDirty = true; int pos = indices.position(); buffer.clear(); buffer.put(indices); buffer.flip(); indices.position(pos); byteBuffer.position(0); byteBuffer.limit(buffer.limit() << 1); if (isBound) { Gdx.gl20.glBufferData(GL20.GL_ELEMENT_ARRAY_BUFFER, byteBuffer.limit(), byteBuffer, usage); isDirty = false; } }
public Int16Array copy (ShortBuffer buffer) { if (GWT.isProdMode()) { return ((Int16Array)((HasArrayBufferView)buffer).getTypedArray()).subarray(buffer.position(), buffer.remaining()); } else { ensureCapacity(buffer); for (int i = buffer.position(), j = 0; i < buffer.limit(); i++, j++) { shortBuffer.set(j, buffer.get(i)); } return shortBuffer.subarray(0, buffer.remaining()); } }
public Int16Array copy (ShortBuffer buffer) { if (GWT.isProdMode()) { return ((Int16Array)((HasArrayBufferView)buffer).getTypedArray()).subarray(buffer.position(), buffer.remaining()); } else { ensureCapacity(buffer); for (int i = buffer.position(), j = 0; i < buffer.limit(); i++, j++) { shortBuffer.set(j, buffer.get(i)); } return shortBuffer.subarray(0, buffer.remaining()); } }