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); }
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); }
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); } }