Axiom.Serialization.MeshSerializerImplv12.ReadGeometryTexCoords C# (CSharp) Метод

ReadGeometryTexCoords() защищенный Метод

protected ReadGeometryTexCoords ( short bindIdx, BinaryReader reader, VertexData data, int coordSet ) : void
bindIdx short
reader System.IO.BinaryReader
data Axiom.Graphics.VertexData
coordSet int
Результат void
		protected virtual void ReadGeometryTexCoords( short bindIdx, BinaryReader reader, VertexData data, int coordSet )
		{
			// get the number of texture dimensions (1D, 2D, 3D, etc)
			short dim = ReadShort( reader );

			// add a vertex element for the current tex coord set
			data.vertexDeclaration.AddElement( bindIdx, 0, VertexElement.MultiplyTypeCount( VertexElementType.Float1, dim ), VertexElementSemantic.TexCoords, coordSet );

			// create the vertex buffer for the tex coords
			HardwareVertexBuffer vBuffer = HardwareBufferManager.Instance.CreateVertexBuffer( data.vertexDeclaration.Clone( bindIdx ), data.vertexCount, mesh.VertexBufferUsage, mesh.UseVertexShadowBuffer );

			// lock the vertex buffer
			IntPtr texCoords = vBuffer.Lock( BufferLocking.Discard );

			// blast the tex coord data into the buffer
			ReadFloats( reader, data.vertexCount * dim, texCoords );

			// unlock the buffer to commit
			vBuffer.Unlock();

			// bind the tex coord buffer
			data.vertexBufferBinding.SetBinding( bindIdx, vBuffer );
		}