Package java.nio

Examples of java.nio.ShortBuffer.rewind()


            } else if (ind >= vertCount) {
                ind -= vertCount;
                sib.put(i, (short) ind);
            }
        }
        sib.rewind();

        setBuffer(Type.Position, 3, fpb);
        setBuffer(Type.Normal,   3, fnb);
        setBuffer(Type.TexCoord, 2, ftb);
        setBuffer(Type.Index,    3, sib);
View Full Code Here


        bcb.rewind();
        bcb = BufferUtils.ensureLargeEnough(bcb, vertCount * 4);
        bcb.limit(vertCount * 4);
        cb.updateData(bcb);

        sib.rewind();
        sib = BufferUtils.ensureLargeEnough(sib, triCount * 3);
        sib.limit(triCount * 3);
        ib.updateData(sib);

        m.updateCounts();
View Full Code Here

            }
        }

        fpb.rewind();
        ftb.rewind();
        sib.rewind();
        bcb.rewind();

        updateModelBound();
    }
}
View Full Code Here

        }else{
            ShortBuffer value = BufferUtils.createShortBuffer(length);
            for (int x = 0; x < length; x++) {
                value.put(readShortForBuffer(content));
            }
            value.rewind();
            return value;
        }
    }

    static private class ID {
View Full Code Here

            // create little endian store
            final ByteBuffer buf = ByteBuffer.allocate(array.length).order(ByteOrder.LITTLE_ENDIAN);

            // place buffer into store. Rewind buffers
            value.rewind();
            buf.asShortBuffer().put(value);
            buf.rewind();

            // Pull out store as array
            buf.get(array);
View Full Code Here

            value = BufferUtils.createShortBufferOnHeap(length);
            contentCopyRequired = true;
        }
        if (contentCopyRequired) {
            value.put(buf.asShortBuffer());
            value.rewind();
        }
        return value;
    }

    // byte buffer
View Full Code Here

    }

    @Override
    public IntBuffer asIntBuffer() {
        final ShortBuffer source = getBuffer().duplicate();
        source.rewind();
        final IntBuffer buff = BufferUtils.createIntBufferOnHeap(source.limit());
        for (int i = 0, max = source.limit(); i < max; i++) {
            buff.put(source.get() & 0xFFFF);
        }
        buff.flip();
View Full Code Here

        array.setAll(ShortArray.unsafeValueOf());
        assertArrayEquals(new short[]{}, array.toArray());
        assertEquals(0, array.length());
        assertEquals(offset, array.offset());
        ShortBuffer buffer = array.buffer();
        buffer.rewind().limit(buffer.capacity());
        while (buffer.hasRemaining()) {
            assertEquals(0, buffer.get());
        }
    }
View Full Code Here

        }
        assertArrayEquals(new short[]{}, array.toArray());
        assertEquals(0, array.length());
        assertEquals(offset, array.offset());
        ShortBuffer buffer = array.buffer();
        buffer.rewind().limit(buffer.capacity());
        while (buffer.hasRemaining()) {
            assertEquals(0, buffer.get());
        }
    }
View Full Code Here

        array.clear();
        assertArrayEquals(new short[]{}, array.toArray());
        assertEquals(0, array.length());
        assertEquals(offset, array.offset());
        ShortBuffer buffer = array.buffer();
        buffer.rewind().limit(buffer.capacity());
        while (buffer.hasRemaining()) {
            assertEquals(0, buffer.get());
        }
    }
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.