コード例 #1
0
        public static bool GetNormalized(IAFormat iAFormat)
        {
            switch (iAFormat)
            {
            case IAFormat.Dec3N:
            case IAFormat.Short2N:
            case IAFormat.Short4N:
            case IAFormat.UByte4N:
            case IAFormat.UShort2N:
            case IAFormat.UShort4N:
            case IAFormat.Color: return(true);

            case IAFormat.Float1:
            case IAFormat.Float2:
            case IAFormat.Float3:
            case IAFormat.Float4:
            case IAFormat.HalfFour:
            case IAFormat.HalfTwo:
            case IAFormat.Short2:
            case IAFormat.Short4:
            case IAFormat.Ubyte4:
            case IAFormat.UDec3:
                return(false);

            case IAFormat.Unused: throw new ArgumentException();

            default:
                throw new ArgumentException();
            }
        }
コード例 #2
0
        public static int GetSize(IAFormat iAFormat)
        {
            switch (iAFormat)
            {
            case IAFormat.Ubyte4:
            case IAFormat.UByte4N:
            case IAFormat.Color: return(4);

            case IAFormat.Float1: return(4);

            case IAFormat.Float2: return(8);

            case IAFormat.Float3: return(12);

            case IAFormat.Float4: return(16);

            case IAFormat.HalfFour: return(8);

            case IAFormat.HalfTwo:
            case IAFormat.UShort2N:
            case IAFormat.Short2:
            case IAFormat.Short2N: return(4);

            case IAFormat.UShort4N:
            case IAFormat.Short4:
            case IAFormat.Short4N: return(8);

            case IAFormat.Unused: throw new ArgumentException();

            default:
                throw new ArgumentException();
            }
        }
コード例 #3
0
        public static int SizeOfElement(IAFormat type)
        {
            switch (type)
            {
            case IAFormat.Float3:
                return(12);

            case IAFormat.Float4:
                return(16);

            case IAFormat.HalfFour:
            case IAFormat.Short4N:
            case IAFormat.UShort4N:
            case IAFormat.Short4:
            case IAFormat.Float2:
                return(8);

            case IAFormat.HalfTwo:
            case IAFormat.Color:
            case IAFormat.Ubyte4:
            case IAFormat.UByte4N:
            case IAFormat.Short2:
            case IAFormat.Short2N:
            case IAFormat.UShort2N:
            case IAFormat.Float1:
                return(4);
            }
            throw new ArgumentOutOfRangeException("type");
        }
コード例 #4
0
 public VertexElement(short stream, short offset, IAFormat format, IASemantic semantic, byte usageIndex)
 {
     Stream     = stream;
     Offset     = offset;
     Format     = format;
     Semantic   = semantic;
     UsageIndex = usageIndex;
 }
コード例 #5
0
        public static All GetType(IAFormat iAFormat)
        {
            switch (iAFormat)
            {
            case IAFormat.Color: return(All.UnsignedByte);

            case IAFormat.Dec3N: return(All.Int);

            case IAFormat.Float1:
            case IAFormat.Float2:
            case IAFormat.Float3:
            case IAFormat.Float4: return(All.Float);

            case IAFormat.HalfFour:
            case IAFormat.HalfTwo: return(All.HalfFloatOes);

            case IAFormat.Short2: return(All.Short);

            case IAFormat.Short2N: return(All.UnsignedShort);

            case IAFormat.Short4:
            case IAFormat.Short4N: return(All.Short);

            case IAFormat.Ubyte4: return(All.UnsignedByte);

            case IAFormat.UByte4N: return(All.UnsignedByte);

            case IAFormat.UDec3: return(All.Int);

            case IAFormat.Unused: throw new ArgumentException();

            case IAFormat.UShort2N: return(All.UnsignedShort);

            case IAFormat.UShort4N: return(All.UnsignedShort);

            default:
                throw new ArgumentException();
            }
        }
コード例 #6
0
 public VertexElementAttribute(IASemantic semantic, byte usageIndex = 0, short stream = 0, IAFormat type = IAFormat.Unused, short offset = -1)
 {
     this.Semantic   = semantic;
     this.UsageIndex = usageIndex;
     this.Stream     = stream;
     this.Format     = type;
     this.Offset     = offset;
 }