Java 如何在OpenGL ES中加载和绑定纹理?
因此,我的res/drawable hdpi(例如text.png)文件夹中有一个纹理,如何加载该纹理并将其与glBindTexture绑定Java 如何在OpenGL ES中加载和绑定纹理?,java,android,opengl-es,Java,Android,Opengl Es,因此,我的res/drawable hdpi(例如text.png)文件夹中有一个纹理,如何加载该纹理并将其与glBindTexture绑定 Bitmap img = BitmapFactory.decodeResource(context.getResources(), R.drawable.text); int[] texId = new int[1]; GLES20.glGenTextures(1, texId, 0); GLES20.glBindTexture(GLES20.GL_TEX
Bitmap img = BitmapFactory.decodeResource(context.getResources(), R.drawable.text);
int[] texId = new int[1];
GLES20.glGenTextures(1, texId, 0);
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, texId[0]);
GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, img, 0);
GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR);
我试着用R类加载它