/** * Gets the index buffer. * * @return the index buffer */ public Buffer getIndexBuffer() { if (_indexBuffer == null) { return null; } return _indexBuffer.getBuffer(); }
private int getGLDataType(final IndexBufferData<?> indices) { if (indices.getBuffer() instanceof ByteBuffer) { return GL11.GL_UNSIGNED_BYTE; } else if (indices.getBuffer() instanceof ShortBuffer) { return GL11.GL_UNSIGNED_SHORT; } else if (indices.getBuffer() instanceof IntBuffer) { return GL11.GL_UNSIGNED_INT; } throw new IllegalArgumentException("Unknown buffer type: " + indices.getBuffer()); }
private int getGLDataType(final IndexBufferData<?> indices) { if (indices.getBuffer() instanceof ByteBuffer) { return GL.GL_UNSIGNED_BYTE; } else if (indices.getBuffer() instanceof ShortBuffer) { return GL.GL_UNSIGNED_SHORT; } else if (indices.getBuffer() instanceof IntBuffer) { return GL.GL_UNSIGNED_INT; } throw new IllegalArgumentException("Unknown buffer type: " + indices.getBuffer()); }
/** * @see Buffer#limit(); */ public int limit() { return getBuffer().limit(); }
/** * @see Buffer#position(int); */ public void position(final int position) { getBuffer().position(position); }
/** * @see Buffer#position(); */ public int position() { return getBuffer().position(); }
/** * @see Buffer#position(int); */ public void position(final int position) { getBuffer().position(position); }
/** * @see Buffer#capacity(); */ public int capacity() { return getBuffer().capacity(); }
/** * @see Buffer#rewind(); */ public void rewind() { getBuffer().rewind(); }
/** * @see Buffer#flip(); */ public void flip() { getBuffer().flip(); }
/** * @see Buffer#reset(); */ public void reset() { getBuffer().reset(); }
/** * @see Buffer#reset(); */ public void reset() { getBuffer().reset(); }
/** * @see Buffer#remaining(); */ public int remaining() { return getBuffer().remaining(); }
/** * @see Buffer#rewind(); */ public void rewind() { getBuffer().rewind(); }
/** * @see Buffer#flip(); */ public void flip() { getBuffer().flip(); }
private void setIndexData() { final IndexBufferData<?> indices = _meshData.getIndices(); indices.getBuffer().rewind(); indices.put(4).put(0).put(2); indices.put(4).put(2).put(1); indices.put(4).put(1).put(3); indices.put(4).put(3).put(0); indices.put(5).put(2).put(0); indices.put(5).put(1).put(2); indices.put(5).put(3).put(1); indices.put(5).put(0).put(3); }
private void setIndexData() { final IndexBufferData<?> indices = _meshData.getIndices(); indices.getBuffer().rewind(); indices.put(4).put(0).put(2); indices.put(4).put(2).put(1); indices.put(4).put(1).put(3); indices.put(4).put(3).put(0); indices.put(5).put(2).put(0); indices.put(5).put(1).put(2); indices.put(5).put(3).put(1); indices.put(5).put(0).put(3); }