我正在从URL下载图像,并将位图存储在Bitmap变量位图中。然后我这样做:
Log.d("log", String.valueOf(bitmap.getWidth())); //gives me 1536
Log.d("log", String.valueOf(bitmap.getHeight())); //gives me 9216
Log.d("log", String.valueOf(bitmap.getByteCount())); // gives me 56623104
int bytes = bitmap.getByteCount();
ByteBuffer pixels = ByteBuffer.allocate(bytes);
bitmap.copyPixelsToBuffer(pixels);
GLES20.glPixelStorei(GLES20.GL_UNPACK_ALIGNMENT, 1);
GLES20.glTexImage2D(
GLES20.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
0,
GLES20.GL_RGB,
bitmap.getWidth(),
bitmap.getHeight(),
0,
GLES20.GL_RGB,
GLES20.GL_UNSIGNED_BYTE,
pixels);
但这会导致glTexImage2D()
这里可能出现什么问题?