Code example for GL10

Methods: glBlendFunc, glClearColor, glEnable

0
 
	/** Called when the surface is created or recreated. */ 
	@Override 
	public void onSurfaceCreated(GL10 gl, EGLConfig config) {
		// background clear color 
		gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
 
		// enables the blending 
		gl.glEnable(GL10.GL_BLEND);
		// sets the blending function 
		gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
		// enables 2D textures 
		gl.glEnable(GL10.GL_TEXTURE_2D);
 
		// loads the textures (every time the EGL context is lost, the OpenGL resources are freed. 
		TextureManager.loadTextures(gl, context);
	} 
}