@Override public boolean hasData() { return data != null && data.getBuffer() != null; }
@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 IntBuffer asIntBuffer() { final IntBuffer source = getBuffer().duplicate(); source.rewind(); final IntBuffer buff = BufferUtils.createIntBufferOnHeap(source.limit()); buff.put(source); buff.flip(); return buff; }
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()); } }
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()); } }
for (final PrimitiveGroup group : strips) { final IntBufferData data = new IntBufferData(group.getIndices().length); data.getBuffer().put(group.getIndices()); data.rewind(); newIndices.put(data);