Examples of asIntBuffer()


Examples of java.nio.ByteBuffer.asIntBuffer()

   * Prepares the indices for updating.
   */    
  public void beginUpdateIndices() {
    gl.glBindBufferARB(GL.GL_ELEMENT_ARRAY_BUFFER, indicesVBO[0]);
    ByteBuffer temp = gl.glMapBufferARB(GL.GL_ELEMENT_ARRAY_BUFFER, GL.GL_WRITE_ONLY);
    indices = temp.asIntBuffer();  
  }

  /**
   * Cleans-up index updating.
   */      
View Full Code Here

Examples of java.nio.ByteBuffer.asIntBuffer()

                result = array;
                break;
            }
            case VariableInfo.INT: {
                final int[] array = new int[length];
                buffer.asIntBuffer().get(array);
                result = array;
                break;
            }
            case VariableInfo.FLOAT: {
                final float[] array = new float[length];
View Full Code Here

Examples of java.nio.ByteBuffer.asIntBuffer()

      ByteBuffer pictureByteBuffer = picture.getByteBuffer(ref);

      if (imageInts != null)
      {
        pictureByteBuffer.order(ByteOrder.BIG_ENDIAN);
        IntBuffer pictureIntBuffer = pictureByteBuffer.asIntBuffer();
        pictureIntBuffer.put(imageInts);
      }
      else
      {
        pictureByteBuffer.put(imageBytes);
View Full Code Here

Examples of java.nio.ByteBuffer.asIntBuffer()

      // now, for this class of problems, we don't want the code
      // to switch byte order, so we'll pretend it's in native java order

      byteBuf.order(ByteOrder.BIG_ENDIAN);
      final IntBuffer intBuf = byteBuf.asIntBuffer();
      final int[] ints = new int[picture.getSize() / 4];
      intBuf.get(ints, 0, ints.length);

      // create the data buffer from the ints
View Full Code Here

Examples of java.nio.ByteBuffer.asIntBuffer()

    ByteBuffer imageData = imageLoader.loadMouseCursorImage(ResourceLoader.getResourceAsStream(name));
    imageData.rewind();
    int width = imageLoader.getWidth();
    int height = imageLoader.getHeight();
    try {
      return new Cursor(width, height, hotspotX, height - hotspotY - 1, 1, imageData.asIntBuffer(), null);
    } catch (LWJGLException e) {
      throw new IOException(e);
    }
  }
View Full Code Here

Examples of java.nio.ByteBuffer.asIntBuffer()

  }

  private IntBuffer createIntBuffer(final int size) {
    ByteBuffer temp = ByteBuffer.allocateDirect(4 * size);
    temp.order(ByteOrder.nativeOrder());
    return temp.asIntBuffer();
  }   

  public void bind() {
    GL11.glBindTexture(GL11.GL_TEXTURE_2D, textureId);
    checkGLError();
View Full Code Here

Examples of java.nio.ByteBuffer.asIntBuffer()

    }
     public static void enviar(int cod, int param){
        System.out.println("****VOZ Envia: cod: "+ cod + " param: " + param);
       
        ByteBuffer buffer = ByteBuffer.allocate(8);
        IntBuffer intBuffer = buffer.asIntBuffer();
       
        intBuffer.put(0, cod);
        intBuffer.put(1, param);
//        System.out.println("Dev crear evento: "+ intBufferMensaje.get(0)+ "  "+ intBufferMensaje.get());
//        System.out.println("Dev luego: "+ intBuffer.get(0)+ "  "+ intBuffer.get(1));
View Full Code Here

Examples of java.nio.ByteBuffer.asIntBuffer()

            }
    }

    public static void enviarNombreDriver(){
     ByteBuffer buffer2 = ByteBuffer.allocate(8);
     IntBuffer intBuffer2 = buffer2.asIntBuffer();
      
        try {
            intBuffer2.put(0, 8);
            intBuffer2.put(1, 2);
            //buffer.put(nombre.getBytes());
View Full Code Here

Examples of java.nio.ByteBuffer.asIntBuffer()

    }
     public static void enviar(int cod, int param){
        System.out.println("Enviar: cod: "+ cod + " param: " + param);
       
        ByteBuffer buffer = ByteBuffer.allocate(8);
        IntBuffer intBuffer = buffer.asIntBuffer();
       
        intBuffer.put(0, cod);
        intBuffer.put(1, param);
        try {
                if (buffer !=null){
View Full Code Here

Examples of java.nio.MappedByteBuffer.asIntBuffer()

            byte b = mmb.get();
            assertEquals("Got wrong byte value", (byte) 'A' + i, b); //$NON-NLS-1$
        }

        // Now convert to an IntBuffer to read our ints
        IntBuffer ibuffer = mmb.asIntBuffer();
        for (int i = 0; i < 5; i++) {
            int val = ibuffer.get();
            assertEquals("Got wrong int value", i + 1, val); //$NON-NLS-1$
        }
        fc.close();
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.