Package org.lwjgl

Examples of org.lwjgl.PointerBuffer$PointerBufferR


  }

  protected PointerBuffer getSizesBuffer(final T object, final int param_name) {
    final int size = getInfoSizeArraySize(object, param_name);

    final PointerBuffer buffer = APIUtil.getBufferPointer(size);
    buffer.limit(size);

    getInfo(object, param_name, buffer.getBuffer(), null);

    return buffer;
  }
View Full Code Here


  }

  public long getInfoSize(final T object, final int param_name) {
    object.checkValid();

    final PointerBuffer buffer = APIUtil.getBufferPointer();
    getInfo(object, param_name, buffer.getBuffer(), null);

    return buffer.get(0);
  }
View Full Code Here

  public long[] getInfoSizeArray(final T object, final int param_name) {
    object.checkValid();

    final int size = getInfoSizeArraySize(object, param_name);
    final PointerBuffer buffer = APIUtil.getBufferPointer(size);

    getInfo(object, param_name, buffer.getBuffer(), null);

    final long[] array = new long[size];
    for ( int i = 0; i < size; i++ )
      array[i] = buffer.get(i);

    return array;
  }
View Full Code Here

    buffer.limit(bytes - 1); // Exclude null-termination
    return APIUtil.getString(buffer);
  }

  protected final int getSizeRet(final T object, final int param_name) {
    final PointerBuffer bytes = APIUtil.getBufferPointer();
    final int errcode = getInfo(object, param_name, null, bytes);
    if ( errcode != CL_SUCCESS )
      throw new IllegalArgumentException("Invalid parameter specified: " + LWJGLUtil.toHexString(param_name));

    return (int)bytes.get(0);
  }
View Full Code Here

        printPlatformInfo(platform, "CL_PLATFORM_NAME", CL_PLATFORM_NAME);
        printPlatformInfo(platform, "CL_PLATFORM_VENDOR", CL_PLATFORM_VENDOR);
        printPlatformInfo(platform, "CL_PLATFORM_EXTENSIONS", CL_PLATFORM_EXTENSIONS);
        System.out.println("");

        final PointerBuffer ctxProps = BufferUtils.createPointerBuffer(3);
        ctxProps.put(CL_CONTEXT_PLATFORM).put(platform.getPointer()).put(0).flip();

        final List<CLDevice> devices = platform.getDevices(CL_DEVICE_TYPE_ALL);
        for ( CLDevice device : devices ) {
          final CLDeviceCapabilities caps = CLCapabilities.getDeviceCapabilities(device);
View Full Code Here

    return buffer;
  }

  static PointerBuffer getBufferPointer(final int size) {
    PointerBuffer buffer = bufferPointerTL.get();

    if ( buffer.capacity() < size ) {
      int sizeNew = buffer.capacity() << 1;
      while ( sizeNew < size )
        sizeNew <<= 1;

      buffer = BufferUtils.createPointerBuffer(size);
      bufferPointerTL.set(buffer);
    } else
      buffer.clear();

    return buffer;
  }
View Full Code Here

  static PointerBuffer getLengths() {
    return getLengths(1);
  }

  static PointerBuffer getLengths(final int size) {
    PointerBuffer lengths = lengthsTL.get();

    if ( lengths.capacity() < size ) {
      int sizeNew = lengths.capacity();
      while ( sizeNew < size )
        sizeNew <<= 1;

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

    return lengths;
  }
View Full Code Here

   * @param strings
   *
   * @return the String lengths in a PointerBuffer
   */
  static PointerBuffer getLengths(final CharSequence[] strings) {
    PointerBuffer buffer = getLengths(strings.length);

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

    buffer.flip();
    return buffer;
  }
View Full Code Here

   * @param buffers the buffer array
   *
   * @return the buffer lengths in a PointerBuffer
   */
  static PointerBuffer getLengths(final ByteBuffer[] buffers) {
    PointerBuffer lengths = getLengths(buffers.length);

    for ( ByteBuffer buffer : buffers )
      lengths.put(buffer.remaining());

    lengths.flip();
    return lengths;
  }
View Full Code Here

   * @param size The size, in memory addresses
   *
   * @return a PointerBuffer
   */
  public static PointerBuffer createPointerBuffer(int size) {
    return new PointerBuffer(createByteBuffer(size * PointerBuffer.getPointerSize()));
  }
 
View Full Code Here

TOP

Related Classes of org.lwjgl.PointerBuffer$PointerBufferR

Copyright © 2018 www.massapicom. 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.