コード例 #1
0
 void Unlink()
 {
     ambientLight = diffuseColor = diffuseMap = projection = view = world = null;
     boneIndices = boneWeights = normal = position = texel = null;
 }
コード例 #2
0
        /// <summary>Link the program, returning the result.</summary>
        /// <returns></returns>
        public override bool Link()
        {
            bool result = base.Link();
            Unlink();

            if (result) {
                boneIndices = Attributes["BoneIndices"];
                boneWeights = Attributes["BoneWeights"];
                normal = Attributes["Normal"];
                position = Attributes["Position"];
                texel = Attributes["Texel"];

                (ambientLight = Uniforms["AmbientLight"]).Set(ref ambientLightValue);
                (diffuseColor = Uniforms["DiffuseColor"]).Set(ref diffuseColorValue);
                (diffuseMap = Uniforms["DiffuseMap"]).Set(diffuseMapValue ?? Device.WhiteTexture);
                (displayMode = Uniforms["DisplayMode"]).Set((int)displayModeValue);
                (projection = Uniforms["Projection"]).Set(ref projectionValue);
                (view = Uniforms["View"]).Set(ref viewValue);
                (world = Uniforms["World"]).Set(ref worldValue);
            }

            return result;
        }