Package java.nio

Examples of java.nio.FloatBuffer.limit()


    return direct_buffer;
  }

  private static FloatBuffer doNoCopyWrap(FloatBuffer buffer) {
    FloatBuffer direct_buffer = lookupBuffer(buffer);
    direct_buffer.limit(buffer.limit());
    direct_buffer.position(buffer.position());
    return direct_buffer;
  }

  private static LongBuffer doNoCopyWrap(LongBuffer buffer) {
View Full Code Here


      if(( vertexFormat & GeometryArray.USE_NIO_BUFFER) != 0) {
    if ((vertexFormat & GeometryArray.INTERLEAVED) == 0) {
        switch ((vertexType & GeometryArrayRetained.TEXCOORD_DEFINED)) {
        case TF:
      FloatBuffer texBuffer = (FloatBuffer)refTexCoordsBuffer[texCoordSet].getROBuffer();
      if(refTexCoords[texCoordSet] != null &&  multiplier * newMax >= texBuffer.limit()) {
          throw new ArrayIndexOutOfBoundsException(J3dI18N.getString("IndexedGeometryArray25"));
      }
      break;
        }
    }
View Full Code Here

        try
        {
            FloatBuffer vb = this.coordBuffer;
            gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vboIds[0]);
            gl.glBufferData(GL.GL_ARRAY_BUFFER, vb.limit() * Buffers.SIZEOF_FLOAT, vb.rewind(), GL.GL_STATIC_DRAW);
        }
        finally
        {
            gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
        }
View Full Code Here

    @Override
    protected void simpleUpdate() {
        FloatBuffer fb = s.getVertexBuffer();
        s.getVBOInfo();
        //fb.rewind();
        float[] far = new float[fb.limit()];
        for (int i = 0; i < far.length; i++) {
            far[i] = fb.get(i) + (r.nextFloat() -0.5f) * 0.05f ;
        }
        s.setVertexBuffer(BufferUtils.createFloatBuffer(far));
    }
View Full Code Here

    @Override
    protected void simpleUpdate() {
        FloatBuffer fb = s.getVertexBuffer();
        s.getVBOInfo();
        //fb.rewind();
        float[] far = new float[fb.limit()];
        for (int i = 0; i < far.length; i++) {
            far[i] = fb.get(i) + (r.nextFloat() -0.5f) * 0.05f ;
        }
        s.setVertexBuffer(BufferUtils.createFloatBuffer(far));
    }
View Full Code Here

      bufferImpl = (FloatBuffer)vertexData.getROBuffer();

            assert bufferImpl.isDirect();

      int bufferSize = bufferImpl.limit();

      if (this instanceof IndexedGeometryArrayRetained) {
    IndexedGeometryArrayRetained idx = (IndexedGeometryArrayRetained)this;

    if (stride * idx.maxCoordIndex >= bufferSize) {
View Full Code Here

    case TF:
        FloatBuffer texBuffer;
        for (int i = 0; i < texCoordSetCount; i++) {
      texBuffer = (FloatBuffer)refTexCoordsBuffer[i].getROBuffer();
      if ((vertexFormat & GeometryArray.TEXTURE_COORDINATE_2) != 0) {
          if (texBuffer.limit() 2 * (initialTexCoordIndex[i] + validVertexCount) ) {
        throw new ArrayIndexOutOfBoundsException(
                   J3dI18N.getString("GeometryArray113"));
          }
      } else if ((vertexFormat & GeometryArray.TEXTURE_COORDINATE_3) != 0) {
          if (texBuffer.limit() < 3 * (initialTexCoordIndex[i] + validVertexCount) ) {
View Full Code Here

          if (texBuffer.limit() 2 * (initialTexCoordIndex[i] + validVertexCount) ) {
        throw new ArrayIndexOutOfBoundsException(
                   J3dI18N.getString("GeometryArray113"));
          }
      } else if ((vertexFormat & GeometryArray.TEXTURE_COORDINATE_3) != 0) {
          if (texBuffer.limit() < 3 * (initialTexCoordIndex[i] + validVertexCount) ) {
        throw new ArrayIndexOutOfBoundsException(
                   J3dI18N.getString("GeometryArray113"));
          }
      } else if ((vertexFormat & GeometryArray.TEXTURE_COORDINATE_4) != 0) {
          if (texBuffer.limit() < 4 * (initialTexCoordIndex[i] + validVertexCount)) {
View Full Code Here

          if (texBuffer.limit() < 3 * (initialTexCoordIndex[i] + validVertexCount) ) {
        throw new ArrayIndexOutOfBoundsException(
                   J3dI18N.getString("GeometryArray113"));
          }
      } else if ((vertexFormat & GeometryArray.TEXTURE_COORDINATE_4) != 0) {
          if (texBuffer.limit() < 4 * (initialTexCoordIndex[i] + validVertexCount)) {
        throw new ArrayIndexOutOfBoundsException(
                   J3dI18N.getString("GeometryArray113"));
          }
      }
        }
View Full Code Here

  if((vertexFormat & GeometryArray.USE_NIO_BUFFER) != 0){
      if((vertexType & TEXCOORD_DEFINED) == TF) {
    FloatBuffer texBuffer = (FloatBuffer)refTexCoordsBuffer[texCoordSet].getROBuffer();
    if ((vertexFormat & GeometryArray.TEXTURE_COORDINATE_2) != 0) {
        if (texBuffer.limit() < 2 * (initialTexCoordIndex+ validVertexCount) ) {
      throw new ArrayIndexOutOfBoundsException(
                 J3dI18N.getString("GeometryArray113"));
        }
    } else if ((vertexFormat & GeometryArray.TEXTURE_COORDINATE_3) != 0) {
        if (texBuffer.limit() < 3 * (initialTexCoordIndex + validVertexCount) ) {
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.