Code example for Lock

Methods: lock, unlock

0
 
			/* 
			 * Before we can issue GL commands, we need to make sure the context 
			 * is current and bound to a surface. 
			 */ 
			m_surfaceLock.lock( );
			if( !m_egl.eglMakeCurrent( EGLManager.getDisplay( ), m_surface,
					m_surface, m_context ) )
			{ 
				m_surfaceLock.unlock( );
				throw new RuntimeException(
						"Failed to bind surface to current context. EGL Error: " + m_egl.eglGetError( ) );
			} 
			setSurfaceCurrent( true ); 
			m_surfaceLock.unlock( );
		} 
 
		/** 
		 * Draws the open GL surface on the screen, and makes it possible 
		 * to change the underlying SurfaceView again. 
		 */