Package java.nio

Examples of java.nio.IntBuffer.limit()


    if (buffer == null) throw new GdxRuntimeException("dst must be a ByteBuffer or IntBuffer");

    int oldPosition = buffer.position();
    buffer.put(src, srcOffset, numElements);
    buffer.position(oldPosition);
    buffer.limit(oldPosition + numElements);
  }

  /** Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements. The {@link Buffer} instance's
   * {@link Buffer#position()} is used to define the offset into the Buffer itself. The position will stay the same, the limit
   * will be set to position + numElements. <b>The Buffer must be a direct Buffer with native byte order. No error checking is
View Full Code Here


        int width = texture.getWidth();
        int height = texture.getHeight();

        heightmap = new float[width][height];
        while (intBuf.position() < intBuf.limit()) {
            int pos = intBuf.position();
            int val = intBuf.get();
            heightmap[pos % width][pos / width] = val / (256 * 256 * 256 * 12.8f);
        }

View Full Code Here

        if (lightBuffer) {
            bufferIds.put(GL_COLOR_ATTACHMENT2_EXT);
        }
        bufferIds.flip();

        if (bufferIds.limit() == 0) {
            GL11.glReadBuffer(GL11.GL_NONE);
            GL20.glDrawBuffers(GL11.GL_NONE);
        } else {
            GL20.glDrawBuffers(bufferIds);
        }
View Full Code Here

     */
    @Test
    public void testAllocateIntBuffer()
    {
        IntBuffer buffer = BufferUtils.allocateIntBuffer();
        assertEquals(1, buffer.limit());
    }

    /**
     * Tests the {@link BufferUtils#allocateLongBuffer()} method.
     */
 
View Full Code Here

        }
      }
     
      //DRAW //Draw with drawElements if geometry is indexed, else draw with drawArrays!
      if (this.getGeometryInfo().isIndexed()){
        gl.glDrawElements(this.getFillDrawMode(), indexBuff.limit(), GL.GL_UNSIGNED_INT, indexBuff);
//        gl.glDrawElements(this.getFillDrawMode(), indexBuff.capacity(), GL.GL_UNSIGNED_INT, indexBuff);
      }else{
        gl.glDrawArrays(this.getFillDrawMode(), 0, vertBuff.capacity()/3);
      }
     
View Full Code Here

        gl.glLineWidth(this.getStrokeWeight());
     
      //DRAW Polygon outline
      //Draw with drawElements if geometry is indexed, else draw with drawArrays!
      if (this.getGeometryInfo().isIndexed()){
        gl.glDrawElements(GL.GL_LINE_STRIP, indexBuff.limit(), GL.GL_UNSIGNED_INT, indexBuff);
//        gl.glDrawElements(this.getFillDrawMode(), indexBuff.capacity(), GL.GL_UNSIGNED_INT, indexBuff);
      }else{
        gl.glDrawArrays(GL.GL_LINE_STRIP, 0, vertBuff.capacity()/3);
      }
     
View Full Code Here

  public void destroy() {
    if (fboID > 0) {
      final IntBuffer id = ToolsBuffers.createIntBuffer(1);
      id.put(fboID);
      id.rewind();
      gl.glDeleteFramebuffersEXT(id.limit(), id);
      fboID = 0;
    }

    if (depthRBID > 0) {
      final IntBuffer id = ToolsBuffers.createIntBuffer(1);
View Full Code Here

    if (depthRBID > 0) {
      final IntBuffer id = ToolsBuffers.createIntBuffer(1);
      id.put(depthRBID);
      id.rewind();
      gl.glDeleteRenderbuffersEXT(id.limit(), id);
      depthRBID = 0;
    }
   
    this.textures.clear();
  }
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.