Java Code Examples for android.opengl.GLES11#glTexSubImage2D()

The following examples show how to use android.opengl.GLES11#glTexSubImage2D() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GLES11DrawContext.java    From settlers-remake with MIT License 5 votes vote down vote up
@Override
public void updateTexture(TextureHandle textureIndex, int left, int bottom,
		int width, int height, ShortBuffer data) {
	bindTexture(textureIndex);
	GLES11.glTexSubImage2D(GLES11.GL_TEXTURE_2D, 0, left, bottom, width, height,
			GLES11.GL_RGBA, GLES11.GL_UNSIGNED_SHORT_4_4_4_4, data);
}
 
Example 2
Source File: GLES11DrawContext.java    From settlers-remake with MIT License 5 votes vote down vote up
public void updateFontTexture(TextureHandle textureIndex, int left, int bottom,
							   int width, int height, ByteBuffer data) {
	bindTexture(textureIndex);
	if(this instanceof GLES20DrawContext) {
		GLES11.glTexSubImage2D(GLES11.GL_TEXTURE_2D, 0, left, bottom, width,
				height, GLES11.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, data);
	} else {
		GLES11.glTexSubImage2D(GLES11.GL_TEXTURE_2D, 0, left, bottom, width,
				height, GLES11.GL_ALPHA, GLES11.GL_UNSIGNED_BYTE, data);
	}
}