Exemple #1
0
  /**
   * <b>Note:</b> does not pre-multiply the alpha channel!</br> Except that difference, same as:
   * {@link GLUtils#texSubImage2D(int, int, int, int, Bitmap, int, int)}</br> </br> See topic: '<a
   * href="http://groups.google.com/group/android-developers/browse_thread/thread/baa6c33e63f82fca">PNG
   * loading that doesn't premultiply alpha?</a>'
   *
   * @param pBorder
   */
  public static void glTexImage2D(
      final GL10 pGL,
      final int pTarget,
      final int pLevel,
      final Bitmap pBitmap,
      final int pBorder,
      final PixelFormat pPixelFormat) {
    final Buffer pixelBuffer = GLHelper.getPixels(pBitmap, pPixelFormat);

    pGL.glTexImage2D(
        pTarget,
        pLevel,
        pPixelFormat.getGLFormat(),
        pBitmap.getWidth(),
        pBitmap.getHeight(),
        pBorder,
        pPixelFormat.getGLFormat(),
        pPixelFormat.getGLType(),
        pixelBuffer);
  }