Graphics Programs Reference
In-Depth Information
GLES20.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
GLES20.GL_TEXTURE_CUBE_MAP_POSITIVE_Z
GLES20.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
For the GL CUBEMAP TEXTURE application, I have used six different textures. So
six different Bitmap resources are used, two of which are shown in Listing 5-10 .
Listing 5-10. GL CUBEMAP TEXTURE/src/com/apress/android/glcubemaptex-
ture/GLES20Renderer.java
InputStream is1 =
_context.getResources().openRawResource(R.drawable.brick1);
Bitmap img1;
try {
img1 = BitmapFactory.decodeStream(is1);
} finally {
try {
is1.close();
} catch(IOException e) {
// e.printStackTrace();
}
}
GLUtils.texImage2D(GLES20.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
0, img1, 0);
InputStream is2 =
_context.getResources().openRawResource(R.drawable.brick2);
Bitmap img2;
try {
img2 = BitmapFactory.decodeStream(is2);
} finally {
try {
is2.close();
} catch(IOException e) {
// e.printStackTrace();
}
}
GLUtils.texImage2D(GLES20.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
 
 
Search WWH ::




Custom Search