Package java.nio

Examples of java.nio.IntBuffer.position()


  }

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

  private static FloatBuffer doNoCopyWrap(FloatBuffer buffer) {
    FloatBuffer direct_buffer = lookupBuffer(buffer);
View Full Code Here


   */
  static boolean initialize() {
    try {
      IntBuffer ib = BufferUtils.createIntBuffer(2);
      ALC10.alcGetInteger(AL.getDevice(), ALC10.ALC_MAJOR_VERSION, ib);
      ib.position(1);
      ALC10.alcGetInteger(AL.getDevice(), ALC10.ALC_MINOR_VERSION, ib);

      int major = ib.get(0);
      int minor = ib.get(1);

View Full Code Here

        AL10.alGenBuffers(buffers);
        if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
            exit(lastError);
        }

        sources.position(0).limit(1);
        AL10.alGenSources(sources);
        if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
            exit(lastError);
        }
       
View Full Code Here

        if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
            exit(lastError);
        }       
       
        //delete buffers and sources
        sources.position(0).limit(1);
        AL10.alDeleteSources(sources);
        if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
            exit(lastError);
        }
       
View Full Code Here

          long delay = (delays != null) ? delays.get(i) : 0;
          long timeout = System.currentTimeMillis();
          cursors[i] = new CursorElement(handle, delay, timeout);

          // offset to next image
          images_copy.position(width*height*(i+1));
        }
        break;
      case LWJGLUtil.PLATFORM_LINUX:
        // create our cursor elements
        Object handle = Mouse.getImplementation().createCursor(width, height, xHotspot, yHotspot, numImages, images_copy, delays);
View Full Code Here

    AL10.alGenBuffers(buffers);
    if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
      exit(lastError);
    }

    sources.position(0).limit(1);
    AL10.alGenSources(sources);
    if ((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
      exit(lastError);
    }
View Full Code Here

    //make bytbuffer that can hold sourcesToCreate sources
    IntBuffer sources = BufferUtils.createIntBuffer(sourcesToCreate);

    //Create sourcesToCreate sources in one fell swoop
    try {
      sources.position(0).limit(sourcesToCreate);
      AL10.alGenSources(sources);
 
      //delete sources
      sources.position(0).limit(sourcesToCreate);
      AL10.alDeleteSources(sources);
View Full Code Here

    try {
      sources.position(0).limit(sourcesToCreate);
      AL10.alGenSources(sources);
 
      //delete sources
      sources.position(0).limit(sourcesToCreate);
      AL10.alDeleteSources(sources);

      System.out.println("created " + sourcesToCreate + " sources successfully!");
    } catch (OpenALException oale) {
      System.out.println("Unable to create " + sourcesToCreate + " sources");
View Full Code Here

    //mo query
    buffer.rewind();
    buffer.position(0);
      ALC10.alcGetInteger(AL.getDevice(), ALC10.ALC_MAJOR_VERSION, buffer);
      ALC10.alcGetInteger(AL.getDevice(), ALC10.ALC_MINOR_VERSION, (IntBuffer) buffer.position(1));

    System.out.println("ALC_MAJOR_VERSION: " + buffer.get(0));
    System.out.println("ALC_MINOR_VERSION: " + buffer.get(1));

    //no check for ALC_ALL_ATTRIBUTES / ALC_ATTRIBUTES_SIZE since it
View Full Code Here

          IntBuffer sources = BufferUtils.createIntBuffer(1);       
         
          buffers.position(0).limit(1);
          AL10.alGenBuffers(buffers);

          sources.position(0).limit(1);
          AL10.alGenSources(sources);

          System.out.print("Playing...");

        AL10.alBufferData(buffers.get(0), FMT, buf, FREQ);
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.