Package java.nio

Examples of java.nio.DoubleBuffer.flip()


    DoubleBuffer direct_buffer = lookupBuffer(buffer);
    direct_buffer.clear();
    int saved_position = buffer.position();
    direct_buffer.put(buffer);
    buffer.position(saved_position);
    direct_buffer.flip();
    return direct_buffer;
  }

  private static final class CachedBuffers {
    private final ByteBuffer byte_buffer;
View Full Code Here


 
  protected void applyCoordinatesSystem() {
    glTranslated(position.getX(), position.getY(), position.getZ());
    DoubleBuffer buf = BufferUtils.createDoubleBuffer(16).put(
        direction.convertToOpenGL());
    buf.flip();
    glMultMatrix(buf);
  }
}
View Full Code Here

    int len = (int) a.elementCount();
    DoubleBuffer buf = DoubleBuffer.allocate(len);
    assertEquals(len, buf.remaining());
    a.toDoubleBuffer(buf);
    assertEquals(0, buf.remaining());
    buf.flip();
    AVector vv = Vectorz.create(buf);
    assertEquals(a.asVector(), vv);
    assertEquals(a, vv.reshape(a.getShape()));
  }
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.