Package java.nio

Examples of java.nio.IntBuffer.flip()


    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;
  }

  private static LongBuffer lookupBuffer(LongBuffer buffer) {
    CachedBuffers buffers = getCachedBuffers(buffer.remaining()*8);
 
View Full Code Here


          }
        }
      }
    }
    cursorDelays.put(2000).put(2000).put(2000);
    cursorDelays.flip();
    cursorImages.flip();

    cursors[1] = new Cursor(cursorWidth, cursorHeight, cursorWidth/2, cursorHeight/2, cursorImageCount, cursorImages, cursorDelays);
    // ----------------------------------
View Full Code Here

        }
      }
      step += step;
    }
    cursorImages.flip();
    cursorDelays.flip();
    cursors[2] = new Cursor(cursorWidth, cursorHeight, cursorWidth/2, cursorHeight/2, cursorImageCount, cursorImages, cursorDelays);
    // ----------------------------------

    Mouse.setNativeCursor(cursors[0]);
  }
View Full Code Here

  public Cursor getAnimatedCursor(String ref,int x,int y, int width, int height, int[] cursorDelays) throws IOException, LWJGLException {
    IntBuffer cursorDelaysBuffer = ByteBuffer.allocateDirect(cursorDelays.length*4).order(ByteOrder.nativeOrder()).asIntBuffer();
    for (int i=0;i<cursorDelays.length;i++) {
      cursorDelaysBuffer.put(cursorDelays[i]);
    }
    cursorDelaysBuffer.flip();

    LoadableImageData imageData = new TGAImageData();
    ByteBuffer buf = imageData.loadImage(ResourceLoader.getResourceAsStream(ref), false, null);
         
    return new Cursor(width, height, x, y, cursorDelays.length, buf.asIntBuffer(), cursorDelaysBuffer);
View Full Code Here

   * @see org.newdawn.slick.opengl.Texture#release()
   */
    public void release() {
        IntBuffer texBuf = createIntBuffer(1);
        texBuf.put(textureID);
        texBuf.flip();
       
      GL.glDeleteTextures(texBuf);
     
        if (lastBind == this) {
          bindNone();
View Full Code Here

    IntBuffer buffer = getLengths(strings.length);

    for ( CharSequence string : strings )
      buffer.put(string.length());

    buffer.flip();
    return MemoryUtil.getAddress0(buffer);
  }

  static long getInt(final int value) {
    return MemoryUtil.getAddress(getBufferInt().put(0, value), 0);
View Full Code Here

        attribs.put(key.eglAttrib).put(config.get(key));
    }

    // Finish the attribute list
    attribs.put(EGL_NONE);
    attribs.flip();

    return attribs;
  }

  /**
 
View Full Code Here

  public void destroy() {
    super.destroy();

    IntBuffer buffer = BufferUtils.createIntBuffer(1);
    buffer.put(FBO);
    buffer.flip();
   
    EXTFramebufferObject.glDeleteFramebuffersEXT(buffer);
    valid = false;
  }
}
View Full Code Here

        for (final Integer i : ids) {
            if (i != null && i != 0) {
                idBuffer.put(i);
            }
        }
        idBuffer.flip();
        if (idBuffer.remaining() > 0) {
            ARBBufferObject.glDeleteBuffersARB(idBuffer);
        }
    }
View Full Code Here

        buffer.removeVBOID(context.getGlContextRep());

        final IntBuffer idBuff = BufferUtils.createIntBuffer(1);
        idBuff.put(id);
        idBuff.flip();
        ARBBufferObject.glDeleteBuffersARB(idBuff);
    }

    public void updateTexture1DSubImage(final Texture1D destination, final int dstOffsetX, final int dstWidth,
            final ByteBuffer source, final int srcOffsetX) {
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.