Axiom.RenderSystems.OpenGLES.GLESHardwareIndexBuffer.UnlockImpl C# (CSharp) Method

UnlockImpl() protected method

protected UnlockImpl ( ) : void
return void
		protected override void UnlockImpl()
		{
			if ( _lockedToScratch )
			{
				if ( _scratchUploadOnUnlock )
				{
					// have to write the data back to vertex buffer
					WriteData( _scratchOffset, _scratchSize, _scratchPtr, _scratchOffset == 0 && _scratchSize == sizeInBytes );
				}
				// deallocate from scratch buffer
				( (GLESHardwareBufferManager)HardwareBufferManager.Instance ).DeallocateScratch( _scratchPtr );
				_lockedToScratch = false;
			}
			else
			{
				OpenGL.BindBuffer( All.ElementArrayBuffer, _bufferId );
				if ( !OpenGLOES.UnmapBuffer( All.ElementArrayBuffer ) )
				{
					throw new AxiomException( "Buffer data corrupted, please reload" );
				}
			}
			isLocked = false;
		}