示例#1
0
        /// <summary>
        /// Render propeller in modern opengl.
        /// </summary>
        /// <returns></returns>
        public static PropellerRenderer Create()
        {
            var vs       = new VertexShader(vertexCode);
            var fs       = new FragmentShader(fragmentCode);
            var provider = new ShaderArray(vs, fs);
            var map      = new AttributeMap();

            map.Add("inPosition", Propeller.strPosition);
            map.Add("inColor", Propeller.strColor);
            var model   = new Propeller();
            var builder = new RenderMethodBuilder(provider, map);
            var node    = new PropellerRenderer(model, builder);

            node.Initialize();

            return(node);
        }
示例#2
0
 private PropellerRenderer(Propeller model, params RenderMethodBuilder[] builders)
     : base(model, builders)
 {
     this.ModelSize = model.GetModelSize();
 }
示例#3
0
 private PropellerRenderer(Propeller model, IShaderProgramProvider shaderProgramProvider,
                           AttributeMap attributeMap, params GLState[] switches)
     : base(model, shaderProgramProvider, attributeMap, switches)
 {
     this.ModelSize = model.GetModelSize();
 }