Code example for GL10

Methods: glLoadIdentityglMatrixModeglOrthofglViewport

0
	 * @see android.opengl.GLSurfaceView.Renderer#onSurfaceChanged(javax.microedition.khronos.opengles.GL10, int, int) 
	 */ 
	@Override 
	public void onSurfaceChanged(GL10 gl, int width, int height) {
		//TODO handle landscape view 
		gl.glViewport(0, 0, width, height);
		aspectRatio = (float)width/(float)height;
		setupDraw2D(gl);		
		square = new float[] { 	-100f*aspectRatio, -100.0f, -1f,
				 100f*aspectRatio, -100.0f, -1f,
				-100f*aspectRatio, 100.0f, -1f,
				 100f*aspectRatio, 100.0f, -1f };
		 
		squareBuffer = makeFloatBuffer(square);		
		markerInfo.setScreenSize(width, height);
		screenHeight = height;
		screenWidth = width;
	} 
	 
	/** 
	 * Setup OpenGL to draw in 2D. 
	 */ 
	private void setupDraw2D(GL10 gl) {
		gl.glMatrixMode(GL10.GL_PROJECTION);
		gl.glLoadIdentity();
		gl.glOrthof(-100.0f*aspectRatio, 100.0f*aspectRatio, -100.0f, 100.0f, 1.0f, -1.0f);
		 
		gl.glMatrixMode(GL10.GL_MODELVIEW);
		gl.glLoadIdentity();
	} 
 
	/* (non-Javadoc) 
	 * @see android.opengl.GLSurfaceView.Renderer#onSurfaceCreated(javax.microedition.khronos.opengles.GL10, javax.microedition.khronos.egl.EGLConfig) 
	 */ 
Connect your IDE to all the code out there  Get Codota for Java