Пример #1
0
        /// <summary>
        ///
        /// </summary>
        protected override void LoadFromSource()
        {
            SelectProfile();

            string[] args = null;

            // This option causes an error with the CG 1.3 compiler
            if (selectedCgProfile == Cg.CG_PROFILE_VS_1_1)
            {
                args = new string[] { "-profileopts", "dcls", null };
            }

            // create the Cg program
            cgProgram = Cg.cgCreateProgram(cgContext, Cg.CG_SOURCE, source, selectedCgProfile, entry, args);

            string cgErrStr = CgHelper.FormatCgError("Unable to compile Cg program " + name, cgContext);

            if (cgErrStr != null)
            {
                LogManager.Instance.Write("Unable to compile CG program {0}:\n{1}", name, cgErrStr);
                CgHelper.CheckCgError("Unable to compile Cg program " + name, cgContext);
            }
        }