Пример #1
0
 public bool TryGetField(string fieldName, [MaybeNullWhen(false)] out VertexFieldData field)
 {
     foreach (var f in _fields)
     {
         if (f.Name == fieldName)
         {
             field = f;
             return(true);
         }
     }
     field = null;
     return(false);
 }
Пример #2
0
 public bool TryGetField(VertexSpecialField specialField, [MaybeNullWhen(false)] out VertexFieldData field)
 {
     foreach (var f in _fields)
     {
         if (f.SpecialField == specialField)
         {
             field = f;
             return(true);
         }
     }
     field = null;
     return(false);
 }
Пример #3
0
        private static void MapPrivate(int index, VertexFieldData field, int vertexSize)
        {
            GL.EnableVertexAttribArray(index);

            var marshalType = field.MarshalType;

            if (marshalType <= VertexFieldMarshalType.HalfFloat)
            {
                // float or half
                GL.VertexAttribPointer(index, field.MarshalCount, (VertexAttribPointerType)_attribTypes[(int)marshalType], false, vertexSize, field.ByteOffset);
            }
            else
            {
                GL.VertexAttribIPointer(index, field.MarshalCount, (VertexAttribIntegerType)_attribTypes[(int)marshalType], vertexSize, (IntPtr)field.ByteOffset);
            }
        }