Package java.nio

Examples of java.nio.IntBuffer.clear()


    return buffer.order() == ByteOrder.LITTLE_ENDIAN ? buffers.int_buffer_little : buffers.int_buffer_big;
  }

  private static IntBuffer doWrap(IntBuffer buffer) {
    IntBuffer 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;
View Full Code Here


    private void addSeparator() {
        IntBuffer buf = cellBeginPositions;
        if (buf.remaining() == 0) {
            IntBuffer newBuf = IntBuffer.allocate(buf.capacity() * 2);
            newBuf.clear();
            buf.flip();
            newBuf.put(buf);
            buf = newBuf;
            cellBeginPositions = newBuf;
        }
View Full Code Here

        sizeNew <<= 1;

      lengths = BufferUtils.createIntBuffer(size);
      lengthsTL.set(lengths);
    } else
      lengths.clear();

    return lengths;
  }

  /**
 
View Full Code Here

        }
    }

    public void deleteVBOs(final Collection<Integer> ids) {
        final IntBuffer idBuffer = BufferUtils.createIntBuffer(ids.size());
        idBuffer.clear();
        for (final Integer i : ids) {
            if (i != null && i != 0) {
                idBuffer.put(i);
            }
        }
View Full Code Here

            // Not on card... return.
            return;
        }

        final IntBuffer idBuffer = BufferUtils.createIntBuffer(1);
        idBuffer.clear();
        idBuffer.put(id.intValue());
        idBuffer.rewind();
        GL11.glDeleteTextures(idBuffer);
        record.removeTextureRecord(id);
        texture.removeFromIdCache(context.getGlContextRep());
View Full Code Here

        // ask for the current state record
        final RenderContext context = ContextManager.getCurrentContext();
        final TextureStateRecord record = (TextureStateRecord) context.getStateRecord(StateType.Texture);

        final IntBuffer idBuffer = BufferUtils.createIntBuffer(ids.size());
        idBuffer.clear();
        for (final Integer i : ids) {
            if (i != null) {
                idBuffer.put(i);
                record.removeTextureRecord(i);
            }
View Full Code Here

            }
        }

        // Create a new texture id for this texture
        final IntBuffer id = BufferUtils.createIntBuffer(1);
        id.clear();
        GL11.glGenTextures(id);
        final int textureId = id.get(0);

        // store the new id by our current gl context.
        texture.setTextureIdForContext(context.getGlContextRep(), textureId);
View Full Code Here

    public static IntBuffer createIntBuffer(int... data) {
        if (data == null) {
            return null;
        }
        IntBuffer buff = createIntBuffer(data.length);
        buff.clear();
        buff.put(data);
        buff.flip();
        return buff;
    }
View Full Code Here

     *            required number of ints to store.
     * @return the new IntBuffer
     */
    public static IntBuffer createIntBuffer(int size) {
        IntBuffer buf = ByteBuffer.allocateDirect(4 * size).order(ByteOrder.nativeOrder()).asIntBuffer();
        buf.clear();
        onBufferAllocated(buf);
        return buf;
    }

    /**
 
View Full Code Here

    if (textureId != null) {
      return textureId.intValue();
    }

    try {
      singleIntBuffer.clear();
      GLAllocation.generateTextureNames(singleIntBuffer);
      int glTextureId = singleIntBuffer.get(0);
      this.settings.minecraft.renderEngine.setupTexture(textureImage, glTextureId);
      textureMap.put(texture, Integer.valueOf(glTextureId));
      return glTextureId;
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.