Ejemplo n.º 1
0
        public void SetAttribute(GXVertexAttribute attribute, VertexInputType inputType, int vertexIndex)
        {
            if (CheckAttribute(attribute))
            {
                throw new Exception($"Attribute \"{ attribute }\" is already in the vertex descriptor!");
            }

            Attributes.Add(attribute, new Tuple <VertexInputType, int>(inputType, vertexIndex));
        }
Ejemplo n.º 2
0
        private void WriteAttributeIndex(EndianBinaryWriter writer, uint value, VertexInputType type)
        {
            switch (type)
            {
            case VertexInputType.Direct:
            case VertexInputType.Index8:
                writer.Write((byte)value);
                break;

            case VertexInputType.Index16:
                writer.Write((short)value);
                break;

            case VertexInputType.None:
            default:
                throw new ArgumentException("vertex input type");
            }
        }