示例#1
0
        /// <summary>
        ///    Create the specified type of GpuProgram.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        public override GpuProgram Create(string name, GpuProgramType type, string syntaxCode)
        {
            // if there is none, this syntax code must not be supported
            // just return the base GL program since it won't be doing anything anyway
            if (factories[syntaxCode] == null)
            {
                return(new GLGpuProgram(name, type, syntaxCode));
            }

            // get a reference to the factory for this syntax code
            IOpenGLGpuProgramFactory factory =
                (IOpenGLGpuProgramFactory)factories[syntaxCode];

            // create the gpu program
            return(factory.Create(name, type, syntaxCode));
        }
示例#2
0
 /// <summary>
 ///     Registers a factory to handles requests for the creation of low level
 ///     gpu porgrams based on the syntax code.
 /// </summary>
 /// <param name="factory"></param>
 public void RegisterProgramFactory(string syntaxCode, IOpenGLGpuProgramFactory factory)
 {
     // store this factory for the specified syntax code
     this.factories[syntaxCode] = factory;
 }
		/// <summary>
		///     Registers a factory to handles requests for the creation of low level
		///     gpu porgrams based on the syntax code.
		/// </summary>
		/// <param name="factory"></param>
		public void RegisterProgramFactory( string syntaxCode, IOpenGLGpuProgramFactory factory )
		{
			// store this factory for the specified syntax code
			this.factories[ syntaxCode ] = factory;
		}