@Override public boolean hasData() { return data != null && data.getBuffer() != null; }
@Override public IntBufferData makeCopy() { final IntBufferData copy = new IntBufferData(); copy._buffer = BufferUtils.clone(_buffer); copy._vboAccessMode = _vboAccessMode; return copy; } }
final IntBufferData data = new IntBufferData(group.getIndices().length); data.getBuffer().put(group.getIndices()); data.rewind(); newIndices.put(data);
@Override public void put(final IndexBufferData<?> buf) { if (buf instanceof IntBufferData) { _buffer.put((IntBuffer) buf.getBuffer()); } else { while (buf.getBuffer().hasRemaining()) { put(buf.get()); } } }
@Override public void put(final IndexBufferData<?> buf) { if (buf instanceof IntBufferData) { _buffer.put((IntBuffer) buf.getBuffer()); } else { while (buf.getBuffer().hasRemaining()) { put(buf.get()); } } }
@Override public IntBuffer asIntBuffer() { final IntBuffer source = getBuffer().duplicate(); source.rewind(); final IntBuffer buff = BufferUtils.createIntBufferOnHeap(source.limit()); buff.put(source); buff.flip(); return buff; }
/** * Sets the index buffer. * * @param indices * the new index buffer */ public void setIndexBuffer(final IntBuffer indices) { if (indices == null) { _indexBuffer = null; } else { _indexBuffer = new IntBufferData(indices); } updatePrimitiveCounts(); }
@Override public IntBuffer asIntBuffer() { final IntBuffer source = getBuffer().duplicate(); source.rewind(); final IntBuffer buff = BufferUtils.createIntBufferOnHeap(source.limit()); buff.put(source); buff.flip(); return buff; }
@Override public IntBufferData makeCopy() { final IntBufferData copy = new IntBufferData(); copy._buffer = BufferUtils.clone(_buffer); copy._vboAccessMode = _vboAccessMode; return copy; } }
private static void updateShaderAttribute(final ShaderVariablePointerInt variable, final ShaderObjectsStateRecord record, final boolean useVBO) { enableVertexAttribute(variable, record); if (useVBO) { final RenderContext context = ContextManager.getCurrentContext(); final int vboId = LwjglRenderer.setupVBO(variable.data, context); LwjglRendererUtil.setBoundVBO(context.getRendererRecord(), vboId); ARBVertexProgram.glVertexAttribPointerARB(variable.variableID, variable.size, variable.unsigned ? GL11.GL_UNSIGNED_INT : GL11.GL_INT, variable.normalized, variable.stride, 0); } else { variable.data.getBuffer().rewind(); ARBVertexProgram.glVertexAttribPointerARB(variable.variableID, variable.size, variable.unsigned, variable.normalized, variable.stride, variable.data.getBuffer()); } }
/** * Sets the index buffer. * * @param indices * the new index buffer */ public void setIndexBuffer(final IntBuffer indices) { if (indices == null) { _indexBuffer = null; } else { _indexBuffer = new IntBufferData(indices); } updatePrimitiveCounts(); refreshInterleaved(); }
private static void updateShaderAttribute(final ShaderVariablePointerInt variable, final ShaderObjectsStateRecord record, final boolean useVBO) { enableVertexAttribute(variable, record); if (useVBO) { final RenderContext context = ContextManager.getCurrentContext(); final int vboId = JoglRenderer.setupVBO(variable.data, context); JoglRendererUtil.setBoundVBO(context.getRendererRecord(), vboId); GLContext .getCurrentGL() .getGL2ES2() .glVertexAttribPointer(variable.variableID, variable.size, variable.unsigned ? GL.GL_UNSIGNED_INT : GL2ES2.GL_INT, variable.normalized, variable.stride, 0); } else { variable.data.getBuffer().rewind(); GLContext .getCurrentGL() .getGL2ES2() .glVertexAttribPointer(variable.variableID, variable.size, variable.unsigned ? GL.GL_UNSIGNED_INT : GL2ES2.GL_INT, variable.normalized, variable.stride, variable.data.getBuffer()); } }
@Override public void read(final InputCapsule capsule) throws IOException { super.read(capsule); size = capsule.readInt("size", 0); stride = capsule.readInt("stride", 0); normalized = capsule.readBoolean("normalized", false); unsigned = capsule.readBoolean("unsigned", false); data = (IntBufferData) capsule.readSavable("data", null); // XXX: transitional if (data == null) { final IntBuffer buff = capsule.readIntBuffer("data", null); if (buff != null) { data = new IntBufferData(buff); } } } }
indices = new IntBufferData(BufferUtils.createIntBuffer(_splitIndices)); } else { indices.getBuffer().clear();
indices = new IntBufferData(BufferUtils.createIntBuffer(_splitIndices)); } else { indices.getBuffer().clear();