Package java.nio

Examples of java.nio.ShortBuffer.rewind()


        indicesCount = indicies.length;
        ByteBuffer indicesBuffer = BufferUtils.createByteBuffer(indicesCount * 2);

        ShortBuffer indiciesShortBuffer = indicesBuffer.asShortBuffer();
        indiciesShortBuffer.put(indicies);
        indiciesShortBuffer.rewind();

        GL15.glBindBuffer(GL15.GL_ELEMENT_ARRAY_BUFFER, indiciesHandle);
        GL15.glBufferData(GL15.GL_ELEMENT_ARRAY_BUFFER, indiciesShortBuffer, GL15.GL_STREAM_DRAW);

        GL15.glBindBuffer(GL15.GL_ELEMENT_ARRAY_BUFFER, 0);
View Full Code Here


        ByteBuffer indiciesBuffer = BufferUtils.createByteBuffer(indicesCount * 2);
        ShortBuffer indiciesShortBuffer = indiciesBuffer.asShortBuffer();
        indiciesShortBuffer.put(indicies);
        indiciesShortBuffer.flip();
        //System.out.println("ECS Indices Buffer:\t" + ArrayPrinter.arrayToString(indiciesShortBuffer));
        indiciesShortBuffer.rewind();

        indiciesHandle = GL15.glGenBuffers();
        GL15.glBindBuffer(GL15.GL_ELEMENT_ARRAY_BUFFER, indiciesHandle);
        GL15.glBufferData(GL15.GL_ELEMENT_ARRAY_BUFFER, indiciesShortBuffer, GL15.GL_STATIC_DRAW);

View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.