private static int GetElementCount(GXAttributes attribute)
        {
            switch (attribute)
            {
            case GXAttributes.Position:
            case GXAttributes.Normal:
                return(3);

            case GXAttributes.NormalBinormalTangent:
                return(9);

            case GXAttributes.TexCoord0:
            case GXAttributes.TexCoord1:
            case GXAttributes.TexCoord2:
            case GXAttributes.TexCoord3:
            case GXAttributes.TexCoord4:
            case GXAttributes.TexCoord5:
            case GXAttributes.TexCoord6:
            case GXAttributes.TexCoord7:
                return(2);

            case GXAttributes.Color0:
            case GXAttributes.Color1:
                return(4);
            }
            return(0);
        }
        private static int GetChannel(GXAttributes att)
        {
            switch (att)
            {
            case GXAttributes.Color0: return(0);

            case GXAttributes.Color1: return(1);

            case GXAttributes.TexCoord0: return(0);

            case GXAttributes.TexCoord1: return(1);

            case GXAttributes.TexCoord2: return(2);

            case GXAttributes.TexCoord3: return(3);

            case GXAttributes.TexCoord4: return(4);

            case GXAttributes.TexCoord5: return(5);

            case GXAttributes.TexCoord6: return(6);

            case GXAttributes.TexCoord7: return(7);
            }
            return(0);
        }
Ejemplo n.º 3
0
 public GXVertexLayout(GXAttributes attribute,
                       GXComponentType comptype, GXAttributeType attType, uint offset)
 {
     Attribute  = attribute;
     CompType   = comptype;
     AttType    = attType;
     DataOffset = offset;
 }
 private static int GetComponentShift(GXAttributes attribute, GXComponentType type, int compShift)
 {
     if (attribute == GXAttributes.Normal || attribute == GXAttributes.NormalBinormalTangent)
     {
         if (type == GXComponentType.U8 || type == GXComponentType.S8)
         {
             return(6);
         }
         else if (type == GXComponentType.U16 || type == GXComponentType.S16)
         {
             return(14);
         }
     }
     return(GetComponentShiftRaw(type, compShift));
 }