android 纹理贴图 模拟器上正常 为什么真机上就是空白
我的图片不是2的N次方 不过我这样处理GLfloat nWidthPowerOfTwo = next_p2(width);
GLfloat nHeightPowerOfTwo = next_p2(height);
if(width == nWidthPowerOfTwo && height == nHeightPowerOfTwo)
{
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, nWidthPowerOfTwo, nHeightPowerOfTwo, 0, GL_RGBA, GL_UNSIGNED_BYTE, imageData);
}
else
{
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, nWidthPowerOfTwo, nHeightPowerOfTwo, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
LOGI("the bitmap's width or height is not sizeTofit");
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, nHeightPowerOfTwo-height, width, height, GL_RGBA, GL_UNSIGNED_BYTE, imageData);
}
openGL es 1.1版本的 --------------------编程问答-------------------- 有人知道不。。我也是这个问题啊
补充:移动开发 , Android